Skip to content

Commit f03695e

Browse files
committed
thememanager: track sidebar color, remove platform-specific tints
settings screen will allow customizing this value going forward Defaults to chesto's dark gray
1 parent 1ca7650 commit f03695e

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

gui/MainDisplay.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "../libs/chesto/src/Constraint.hpp"
1212

1313
#include "MainDisplay.hpp"
14+
#include "ThemeManager.hpp"
1415
#include "main.hpp"
1516

1617
using namespace std::string_literals; // for ""s
@@ -26,11 +27,19 @@ MainDisplay::MainDisplay()
2627

2728
needsRedraw = true;
2829

30+
updateSidebarColor();
31+
2932
// use HD resolution for hb-appstore
3033
// setScreenResolution(1920, 1080);
3134
// setScreenResolution(3840, 2160); // 4k
3235
}
3336

37+
void MainDisplay::updateSidebarColor() {
38+
// set the background color (used as sidebar color)
39+
auto color = HBAS::ThemeManager::sidebarColor;
40+
backgroundColor = fromRGB(color.r, color.g, color.b);
41+
}
42+
3443
void MainDisplay::setupMusic() {
3544
// initialize music (only if MUSIC defined)
3645
this->initMusic();

gui/MainDisplay.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class MainDisplay : public RootDisplay
3636
void beginInitialLoad();
3737

3838
bool checkMetaRepoForUpdates(Get* get);
39+
void updateSidebarColor();
3940

4041
Get* get = NULL;
4142

gui/ThemeManager.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace HBAS::ThemeManager
88

99
// Colours
1010
inline CST_Color background = {0xff, 0xff, 0xff, 0xff};
11+
inline CST_Color sidebarColor = {30, 30, 30, 0xff};
12+
// inline CST_Color sidebarColor = {0x00, 0x84, 0xff, 0xff}; // homebrew blue (highlighting is off)
1113
inline CST_Color textPrimary = {0x00, 0x00, 0x00, 0xff};
1214
inline CST_Color textSecondary = {0x50, 0x50, 0x50, 0xff};
1315

0 commit comments

Comments
 (0)