mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-31 02:23:04 -07:00
Add experimental dark mode setting
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <furi_hal.h>
|
||||
#include <stdint.h>
|
||||
#include <u8g2_glue.h>
|
||||
#include <xtreme/settings.h>
|
||||
|
||||
const CanvasFontParameters canvas_font_params[FontTotalNumber] = {
|
||||
[FontPrimary] = {.leading_default = 12, .leading_min = 11, .height = 8, .descender = 2},
|
||||
@@ -105,11 +106,22 @@ CanvasFontParameters* canvas_get_font_params(Canvas* canvas, Font font) {
|
||||
|
||||
void canvas_clear(Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
u8g2_ClearBuffer(&canvas->fb);
|
||||
if(XTREME_SETTINGS()->dark_mode) {
|
||||
u8g2_FillBuffer(&canvas->fb);
|
||||
} else {
|
||||
u8g2_ClearBuffer(&canvas->fb);
|
||||
}
|
||||
}
|
||||
|
||||
void canvas_set_color(Canvas* canvas, Color color) {
|
||||
furi_assert(canvas);
|
||||
if(XTREME_SETTINGS()->dark_mode) {
|
||||
if(color == ColorBlack) {
|
||||
color = ColorWhite;
|
||||
} else if(color == ColorWhite) {
|
||||
color = ColorBlack;
|
||||
}
|
||||
}
|
||||
u8g2_SetDrawColor(&canvas->fb, color);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,9 @@ void XTREME_SETTINGS_LOAD() {
|
||||
xtreme_settings->bar_borders = true; // ON
|
||||
xtreme_settings->bar_background = false; // OFF
|
||||
xtreme_settings->bad_bt = false; // USB
|
||||
xtreme_settings->sort_dirs_first = true; // ON
|
||||
xtreme_settings->butthurt_timer = 43200; // 12 H
|
||||
xtreme_settings->sort_dirs_first = true; // ON
|
||||
xtreme_settings->dark_mode = false; // OFF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#define MAX_PACK_NAME_LEN 32
|
||||
|
||||
#define XTREME_SETTINGS_VERSION (3)
|
||||
#define XTREME_SETTINGS_VERSION (4)
|
||||
#define XTREME_SETTINGS_PATH INT_PATH(XTREME_SETTINGS_FILE_NAME)
|
||||
#define XTREME_SETTINGS_MAGIC (0x69)
|
||||
|
||||
@@ -28,8 +28,9 @@ typedef struct {
|
||||
bool bar_borders;
|
||||
bool bar_background;
|
||||
bool bad_bt;
|
||||
bool sort_dirs_first;
|
||||
int32_t butthurt_timer;
|
||||
bool sort_dirs_first;
|
||||
bool dark_mode;
|
||||
} XtremeSettings;
|
||||
|
||||
XtremeSettings* XTREME_SETTINGS();
|
||||
|
||||
Reference in New Issue
Block a user