Skip to content

Commit 1516500

Browse files
committed
fw/shell: change dark mode logic and add stubs
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
1 parent 00877e3 commit 1516500

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/fw/shell/prf/stubs.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ void shell_prefs_set_language_english(bool english) {
245245
void shell_prefs_toggle_language_english(void) {
246246
}
247247

248+
GColor shell_prefs_get_theme_highlight_color(void) {
249+
return PBL_IF_COLOR_ELSE(GColorVividCerulean, GColorBlack);
250+
}
251+
252+
DarkMode shell_prefs_get_dark_mode(void) {
253+
return DarkModeOff;
254+
}
255+
256+
void shell_prefs_set_dark_mode(DarkMode mode) {
257+
}
258+
248259
FontInfo *fonts_get_system_emoji_font_for_size(unsigned int font_height) {
249260
return NULL;
250261
}

src/fw/shell/sdk/prefs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ void shell_prefs_set_theme_highlight_color(GColor color) {
294294
// Not used in SDK shell
295295
}
296296

297+
DarkMode shell_prefs_get_dark_mode(void) {
298+
return DarkModeOff;
299+
}
300+
301+
void shell_prefs_set_dark_mode(DarkMode mode) {
302+
// Not used in SDK shell
303+
}
304+
297305
#if CAPABILITY_HAS_APP_SCALING
298306
LegacyAppRenderMode shell_prefs_get_legacy_app_render_mode(void) {
299307
return (LegacyAppRenderMode)s_legacy_app_render_mode;

src/fw/shell/system_theme.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ static bool prv_is_system_app(void) {
186186
}
187187

188188
bool system_theme_is_dark_mode(void) {
189-
if (!PBL_IF_COLOR_ELSE(prv_is_system_app(), false)) {
189+
// Dark mode is only supported on color platforms, so treat all non-color platforms as light mode
190+
if (PBL_IF_COLOR_ELSE(false, true)) {
191+
return false;
192+
}
193+
if (!prv_is_system_app()) {
190194
return false;
191195
}
192196
switch (shell_prefs_get_dark_mode()) {

0 commit comments

Comments
 (0)