mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Themes: Reintroduce PopupHeaderStyleFg/Bg
This commit is contained in:
1 parent
a8d6a31ad4
commit
f719f1c7fd
7 files changed
+23
-3
No files matched your search
+6
-2
@@ -727,8 +727,12 @@ void PopupHeader::Draw(UIContext &dc) {
|
||||
dc.PushScissor(tb);
|
||||
}
|
||||
|
||||
dc.DrawText(text_, bounds_.x + tx, bounds_.centerY(), dc.theme->itemStyle.fgColor, ALIGN_LEFT | ALIGN_VCENTER);
|
||||
dc.Draw()->DrawImageCenterTexel(dc.theme->whiteImage, bounds_.x, bounds_.y2()-2, bounds_.x2(), bounds_.y2(), dc.theme->itemStyle.fgColor);
|
||||
// Header background
|
||||
dc.FillRect(dc.theme->popupHeaderStyle.background, bounds_);
|
||||
// Header title text
|
||||
dc.DrawText(text_, bounds_.x + tx, bounds_.centerY(), dc.theme->popupHeaderStyle.fgColor, ALIGN_LEFT | ALIGN_VCENTER);
|
||||
// Underline
|
||||
dc.Draw()->DrawImageCenterTexel(dc.theme->whiteImage, bounds_.x, bounds_.y2()-2, bounds_.x2(), bounds_.y2(), dc.theme->popupHeaderStyle.fgColor);
|
||||
|
||||
if (availableWidth < tw) {
|
||||
dc.PopScissor();
|
||||
|
||||
@@ -109,6 +109,7 @@ struct Theme {
|
||||
Style infoStyle;
|
||||
|
||||
Style popupStyle;
|
||||
Style popupHeaderStyle;
|
||||
|
||||
uint32_t backgroundColor;
|
||||
};
|
||||
|
||||
+6
-1
@@ -50,6 +50,8 @@ struct ThemeInfo {
|
||||
uint32_t uInfoStyleBg = 0x00000000;
|
||||
uint32_t uPopupStyleFg = 0xFFFFFFFF;
|
||||
uint32_t uPopupStyleBg = 0xFF303030;
|
||||
uint32_t uPopupHeaderStyleFg = 0xFFFFFFFF;
|
||||
uint32_t uPopupHeaderStyleBg = 0x00000000; // default to invisible
|
||||
uint32_t uBackgroundColor = 0xFF754D24;
|
||||
|
||||
std::string sUIAtlas = "ui_atlas";
|
||||
@@ -135,8 +137,10 @@ static void LoadThemeInfo(const std::vector<Path> &directories) {
|
||||
section.Get("HeaderStyleFg", &info.uHeaderStyleFg, info.uHeaderStyleFg);
|
||||
section.Get("InfoStyleFg", &info.uInfoStyleFg, info.uInfoStyleFg);
|
||||
section.Get("InfoStyleBg", &info.uInfoStyleBg, info.uInfoStyleBg);
|
||||
section.Get("PopupStyleFg", &info.uPopupStyleBg, info.uItemStyleFg); // Backwards compat
|
||||
section.Get("PopupStyleFg", &info.uPopupStyleFg, info.uItemStyleFg); // Backwards compat
|
||||
section.Get("PopupStyleBg", &info.uPopupStyleBg, info.uPopupStyleBg);
|
||||
section.Get("PopupHeaderStyleFg", &info.uPopupHeaderStyleFg, info.uItemStyleFg); // Backwards compat
|
||||
section.Get("PopupHeaderStyleBg", &info.uPopupHeaderStyleBg, info.uPopupHeaderStyleBg);
|
||||
section.Get("BackgroundColor", &info.uBackgroundColor, info.uBackgroundColor);
|
||||
|
||||
std::string tmpPath;
|
||||
@@ -228,6 +232,7 @@ void UpdateTheme(UIContext *ctx) {
|
||||
ui_theme.infoStyle = MakeStyle(themeInfos[i].uInfoStyleFg, themeInfos[i].uInfoStyleBg);
|
||||
|
||||
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;
|
||||
|
||||
// Load any missing atlas metadata (the images are loaded from UIContext).
|
||||
|
||||
@@ -25,5 +25,7 @@ InfoStyleFg = "#FFFFFFFF"
|
||||
InfoStyleBg = "#00000000"
|
||||
PopupStyleFg = "#000000FF"
|
||||
PopupStyleBg = "#FFFFAAFF"
|
||||
PopupHeaderStyleFg = "#c0c0c0FF"
|
||||
PopupHeaderStyleBg = "#000080FF"
|
||||
BackgroundColor = "#008080FF"
|
||||
UIAtlas = "../ui_atlas"
|
||||
@@ -13,6 +13,8 @@ InfoStyleFg = "#FFFFFFFF"
|
||||
InfoStyleBg = "#00000000"
|
||||
PopupStyleFg = "#FFFFFFFF"
|
||||
PopupStyleBg = "#1f4d5eFF"
|
||||
PopupHeaderStyleFg = "#FFFFFFFF"
|
||||
PopupHeaderStyleBg = "#00000000"
|
||||
BackgroundColor = "#244D75FF"
|
||||
UIAtlas = "../ui_atlas"
|
||||
|
||||
@@ -35,5 +37,7 @@ InfoStyleFg = "#FFFFFFFF"
|
||||
InfoStyleBg = "#00000000"
|
||||
PopupStyleFg = "#FFFFFFFF"
|
||||
PopupStyleBg = "#0c1d24FF"
|
||||
PopupHeaderStyleFg = "#FFFFFFFF"
|
||||
PopupHeaderStyleBg = "#00000000"
|
||||
BackgroundColor = "#000000FF"
|
||||
UIAtlas = "../ui_atlas"
|
||||
@@ -23,5 +23,7 @@ InfoStyleFg = "#FFFFFFFF"
|
||||
InfoStyleBg = "#00000000"
|
||||
PopupStyleFg = "#FFFFFFFF"
|
||||
PopupStyleBg = "#9498A1FF"
|
||||
PopupHeaderStyleFg = "#FFFFFFFF"
|
||||
PopupHeaderStyleBg = "#00000000"
|
||||
BackgroundColor = "#122537FF"
|
||||
UIAtlas = "../ui_atlas"
|
||||
@@ -24,5 +24,7 @@ InfoStyleFg = "#FFFFFFFF"
|
||||
InfoStyleBg = "#00000000"
|
||||
PopupStyleFg = "#C3D7A4FF"
|
||||
PopupStyleBg = "#94B185FF"
|
||||
PopupHeaderStyleFg = "#FFFFFFFF"
|
||||
PopupHeaderStyleBg = "#00000000"
|
||||
BackgroundColor = "#62865AFF"
|
||||
UIAtlas = "../ui_atlas"
|
||||
Reference in new issue
Block a user