diff --git a/Common/UI/ScrollView.cpp b/Common/UI/ScrollView.cpp index c18566d518..8e6af422a1 100644 --- a/Common/UI/ScrollView.cpp +++ b/Common/UI/ScrollView.cpp @@ -250,7 +250,7 @@ void ScrollView::Draw(UIContext &dc) { if (bob.show) { Bounds bobBounds(bounds_.x2() - bob.thickness, bounds_.y + bob.offset, bob.thickness, bob.size); - dc.FillRect(Drawable(0x80FFFFFF), bobBounds); + dc.FillRect(Drawable(dc.GetTheme().scrollbarColor), bobBounds); } } diff --git a/Common/UI/View.h b/Common/UI/View.h index f25684f8ae..7b24ea4f53 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -112,6 +112,7 @@ struct Theme { Style popupHeaderStyle; uint32_t backgroundColor; + uint32_t scrollbarColor; }; // The four cardinal directions should be enough, plus Prev/Next in "element order". diff --git a/UI/Theme.cpp b/UI/Theme.cpp index 9c9d3cecf4..4cf1b544da 100644 --- a/UI/Theme.cpp +++ b/UI/Theme.cpp @@ -54,6 +54,7 @@ struct ThemeInfo { uint32_t uPopupHeaderStyleFg = 0xFFFFFFFF; uint32_t uPopupHeaderStyleBg = 0x00000000; // default to invisible uint32_t uBackgroundColor = 0xFF754D24; + uint32_t uScrollbarColor = 0x80FFFFFF; std::string sUIAtlas = "ui_atlas"; @@ -144,6 +145,7 @@ static void LoadThemeInfo(const std::vector &directories) { section.Get("PopupHeaderStyleFg", &info.uPopupHeaderStyleFg, info.uItemStyleFg); // Backwards compat section.Get("PopupHeaderStyleBg", &info.uPopupHeaderStyleBg, info.uPopupHeaderStyleBg); section.Get("BackgroundColor", &info.uBackgroundColor, info.uBackgroundColor); + section.Get("ScrollbarColor", &info.uScrollbarColor, info.uScrollbarColor); std::string tmpPath; section.Get("UIAtlas", &tmpPath, ""); @@ -236,6 +238,7 @@ void UpdateTheme(UIContext *ctx) { ui_theme.popupStyle = MakeStyle(themeInfos[i].uPopupStyleFg, themeInfos[i].uPopupStyleBg); ui_theme.popupHeaderStyle = MakeStyle(themeInfos[i].uPopupHeaderStyleFg, themeInfos[i].uPopupHeaderStyleBg); ui_theme.backgroundColor = themeInfos[i].uBackgroundColor; + ui_theme.scrollbarColor = themeInfos[i].uScrollbarColor; // Load any missing atlas metadata (the images are loaded from UIContext). LoadAtlasMetadata(ui_atlas, (themeInfos[i].sUIAtlas + ".meta").c_str(), true); diff --git a/assets/themes/1995.ini b/assets/themes/1995.ini index 4ad6eef1b5..3f43c0d0fd 100644 --- a/assets/themes/1995.ini +++ b/assets/themes/1995.ini @@ -29,4 +29,5 @@ PopupStyleBg = "#FFFFAAFF" PopupHeaderStyleFg = "#c0c0c0FF" PopupHeaderStyleBg = "#000080FF" BackgroundColor = "#008080FF" +ScrollbarColor = "#00000080" UIAtlas = "../ui_atlas" diff --git a/assets/themes/defaultthemes.ini b/assets/themes/defaultthemes.ini index 15b98fa842..345d92ede2 100644 --- a/assets/themes/defaultthemes.ini +++ b/assets/themes/defaultthemes.ini @@ -17,6 +17,7 @@ PopupStyleBg = "#1f4d5eFF" PopupHeaderStyleFg = "#FFFFFFFF" PopupHeaderStyleBg = "#00000000" BackgroundColor = "#244D75FF" +ScrollbarColor = "#FFFFFF80" UIAtlas = "../ui_atlas" # Colors are either in the format "#RGBA" or 0xABGR (e.g. green is "#00FF00FF" or 0xFF00FF00) @@ -42,4 +43,5 @@ PopupStyleBg = "#0c1d24FF" PopupHeaderStyleFg = "#FFFFFFFF" PopupHeaderStyleBg = "#00000000" BackgroundColor = "#000000FF" +ScrollbarColor = "#FFFFFF80" UIAtlas = "../ui_atlas" diff --git a/assets/themes/slateforest.ini b/assets/themes/slateforest.ini index c444cf6c31..a939d803ba 100644 --- a/assets/themes/slateforest.ini +++ b/assets/themes/slateforest.ini @@ -27,4 +27,5 @@ PopupStyleBg = "#9498A1FF" PopupHeaderStyleFg = "#FFFFFFFF" PopupHeaderStyleBg = "#00000000" BackgroundColor = "#122537FF" +ScrollbarColor = "#FFFFFF80" UIAtlas = "../ui_atlas" diff --git a/assets/themes/vinewood.ini b/assets/themes/vinewood.ini index 939eb97181..3d168f3b12 100644 --- a/assets/themes/vinewood.ini +++ b/assets/themes/vinewood.ini @@ -28,4 +28,5 @@ PopupStyleBg = "#94B185FF" PopupHeaderStyleFg = "#FFFFFFFF" PopupHeaderStyleBg = "#00000000" BackgroundColor = "#62865AFF" +ScrollbarColor = "#FFFFFF80" UIAtlas = "../ui_atlas"