Separated Color::Banner and Color::Header into their own theme colors,

then updated the theme files and defaults.
This commit is contained in:
casey langen 2020-10-31 13:23:58 -07:00
parent 84b2b8738a
commit bd7c60fd57
6 changed files with 76 additions and 28 deletions

View File

@ -122,7 +122,7 @@ MainLayout::MainLayout(
this->hotkeysLayout = std::make_shared<HotkeysLayout>();
this->topBanner.reset(new TextLabel());
this->topBanner->SetContentColor(Color::Banner);
this->topBanner->SetContentColor(Color::Header);
this->topBanner->Hide();
this->AddWindow(this->topBanner);

View File

@ -39,6 +39,9 @@
#include <musikcore/support/Common.h>
#include <set>
/* this whole source unit is freaking bananas, but the curses interface
for setting colors is awful. i'm sorry for anyone who has to do work in here. */
using namespace musik::core;
using namespace cursespp;
using namespace nlohmann;
@ -82,6 +85,8 @@ indicies we'll use to store them */
#define THEME_COLOR_LIST_ITEM_ACTIVE_HIGHLIGHTED_FOREGROUND 49
#define THEME_COLOR_FOOTER_BACKGROUND 50
#define THEME_COLOR_FOOTER_FOREGROUND 51
#define THEME_COLOR_HEADER_BACKGROUND 52
#define THEME_COLOR_HEADER_FOREGROUND 53
/* user-readable names for the color identifiers above. these are
used as key names in the config files */
@ -107,10 +112,12 @@ used as key names in the config files */
#define JSON_KEY_COLOR_BUTTON_FOREGROUND_NORMAL "button_foreground_normal"
#define JSON_KEY_COLOR_BUTTON_BACKGROUND_ACTIVE "button_background_active"
#define JSON_KEY_COLOR_BUTTON_FOREGROUND_ACTIVE "button_foreground_active"
#define JSON_KEY_COLOR_BANNER_BACKGROUND "banner_background"
#define JSON_KEY_COLOR_BANNER_FOREGROUND "banner_foreground"
#define JSON_KEY_COLOR_HEADER_BACKGROUND "header_background"
#define JSON_KEY_COLOR_HEADER_FOREGROUND "header_foreground"
#define JSON_KEY_COLOR_FOOTER_BACKGROUND "footer_background"
#define JSON_KEY_COLOR_FOOTER_FOREGROUND "footer_foreground"
#define JSON_KEY_COLOR_BANNER_BACKGROUND "banner_background"
#define JSON_KEY_COLOR_BANNER_FOREGROUND "banner_foreground"
#define JSON_KEY_COLOR_LIST_HEADER_BACKGROUND "list_header_background"
#define JSON_KEY_COLOR_LIST_HEADER_FOREGROUND "list_header_foreground"
#define JSON_KEY_COLOR_LIST_HEADER_HIGHLIGHTED_BACKGROUND "list_header_highlighted_background"
@ -244,14 +251,18 @@ struct Theme {
buttonBackgroundActive.Set(THEME_COLOR_BUTTON_BACKGROUND_ACTIVE, 166, 226, 46, COLOR_256_GREEN);
buttonForegroundActive.Set(THEME_COLOR_BUTTON_FOREGROUND_ACTIVE, 24, 24, 20, COLOR_BLACK);
/* banner */
bannerBackground.Set(THEME_COLOR_BANNER_BACKGROUND, 24, 24, 20, -1);
bannerForeground.Set(THEME_COLOR_BANNER_FOREGROUND, 128, 128, 128, COLOR_256_MEDIUM_GRAY);
/* header */
headerBackground.Set(THEME_COLOR_HEADER_BACKGROUND, 24, 24, 20, -1);
headerForeground.Set(THEME_COLOR_HEADER_FOREGROUND, 128, 128, 128, COLOR_256_MEDIUM_GRAY);
/* footer */
footerBackground.Set(THEME_COLOR_FOOTER_BACKGROUND, 102, 217, 238, COLOR_256_BLUE);
footerForeground.Set(THEME_COLOR_FOOTER_FOREGROUND, 24, 24, 20, COLOR_BLACK);
/* banner */
bannerBackground.Set(THEME_COLOR_BANNER_BACKGROUND, 255, 150, 32, COLOR_256_ORANGE);
bannerForeground.Set(THEME_COLOR_BANNER_FOREGROUND, 24, 24, 20, COLOR_BLACK);
/* listview */
listHeaderBackground.Set(THEME_COLOR_LIST_HEADER_BACKGROUND, 36, 36, 31, -1);
listHeaderForeground.Set(THEME_COLOR_LIST_HEADER_FOREGROUND, 166, 226, 46, COLOR_256_GREEN);
@ -308,10 +319,12 @@ struct Theme {
this->buttonForegroundNormal.Set(colors.value(JSON_KEY_COLOR_BUTTON_FOREGROUND_NORMAL, unset));
this->buttonBackgroundActive.Set(colors.value(JSON_KEY_COLOR_BUTTON_BACKGROUND_ACTIVE, unset));
this->buttonForegroundActive.Set(colors.value(JSON_KEY_COLOR_BUTTON_FOREGROUND_ACTIVE, unset));
this->bannerBackground.Set(colors.value(JSON_KEY_COLOR_BANNER_BACKGROUND, unset));
this->bannerForeground.Set(colors.value(JSON_KEY_COLOR_BANNER_FOREGROUND, unset));
this->headerBackground.Set(colors.value(JSON_KEY_COLOR_HEADER_BACKGROUND, unset));
this->headerForeground.Set(colors.value(JSON_KEY_COLOR_HEADER_FOREGROUND, unset));
this->footerBackground.Set(colors.value(JSON_KEY_COLOR_FOOTER_BACKGROUND, unset));
this->footerForeground.Set(colors.value(JSON_KEY_COLOR_FOOTER_FOREGROUND, unset));
this->bannerBackground.Set(colors.value(JSON_KEY_COLOR_BANNER_BACKGROUND, unset));
this->bannerForeground.Set(colors.value(JSON_KEY_COLOR_BANNER_FOREGROUND, unset));
this->listHeaderBackground.Set(colors.value(JSON_KEY_COLOR_LIST_HEADER_BACKGROUND, unset));
this->listHeaderForeground.Set(colors.value(JSON_KEY_COLOR_LIST_HEADER_FOREGROUND, unset));
this->listHeaderHighlightedBackground.Set(colors.value(JSON_KEY_COLOR_LIST_HEADER_HIGHLIGHTED_BACKGROUND, unset));
@ -391,11 +404,11 @@ struct Theme {
buttonForegroundActive.Id(mode, COLOR_BLACK),
buttonBackgroundActive.Id(mode, COLOR_GREEN));
/* banner */
/* header */
init_pair(
Color::Banner,
bannerForeground.Id(mode, COLOR_WHITE),
backgroundId);
Color::Header,
headerForeground.Id(mode, COLOR_WHITE),
headerBackground.Id(mode, -1));
/* footer */
init_pair(
@ -403,6 +416,12 @@ struct Theme {
footerForeground.Id(mode, COLOR_BLACK),
footerBackground.Id(mode, COLOR_BLUE));
/* banner */
init_pair(
Color::Banner,
bannerForeground.Id(mode, COLOR_BLACK),
bannerBackground.Id(mode, COLOR_YELLOW));
/* list items */
init_pair(
Color::ListItemHeader,
@ -470,14 +489,18 @@ struct Theme {
ThemeColor buttonBackgroundActive;
ThemeColor buttonForegroundActive;
/* banner */
ThemeColor bannerBackground;
ThemeColor bannerForeground;
/* header */
ThemeColor headerBackground;
ThemeColor headerForeground;
/* footer */
ThemeColor footerBackground;
ThemeColor footerForeground;
/* banner */
ThemeColor bannerBackground;
ThemeColor bannerForeground;
/* listview */
ThemeColor listHeaderBackground;
ThemeColor listHeaderForeground;

View File

@ -76,8 +76,9 @@ namespace cursespp {
OverlayListFrame = 25,
OverlayListFrameFocused = 26,
Banner = 27,
Footer = 28
Header = 27,
Footer = 28,
Banner = 29
};
Color() {

View File

@ -90,11 +90,11 @@
"hex": "#282828",
"palette": 235
},
"banner_background": {
"header_background": {
"hex": "#282828",
"palette": 235
},
"banner_foreground": {
"header_foreground": {
"hex": "#7c6f64",
"palette": 243
},
@ -106,6 +106,14 @@
"hex": "#fbf1c7",
"palette": 229
},
"banner_background": {
"hex": "#458588",
"palette": 66
},
"banner_foreground": {
"hex": "#fbf1c7",
"palette": 229
},
"list_header_background": {
"hex": "#3c3836",
"palette": 237

View File

@ -57,7 +57,7 @@
"overlay_focused_text": {
"hex": "#dc322f",
"palette": 160
},
},
"shortcuts_background": {
"hex": "#586e75",
"palette": 240
@ -90,13 +90,13 @@
"hex": "#fdf6e3",
"palette": 230
},
"banner_background": {
"hex": "#cb4b16",
"palette": 166
"header_background": {
"hex": "#002b36",
"palette": 234
},
"banner_foreground": {
"hex": "#eee8d5",
"palette": 254
"header_foreground": {
"hex": "#93a1a1",
"palette": 245
},
"footer_background": {
"hex": "#cb4b16",
@ -106,6 +106,14 @@
"hex": "#eee8d5",
"palette": 254
},
"banner_background": {
"hex": "#cb4b16",
"palette": 166
},
"banner_foreground": {
"hex": "#eee8d5",
"palette": 254
},
"list_header_background": {
"hex": "#002b36",
"palette": 234

View File

@ -90,11 +90,11 @@
"hex": "#fdf6e3",
"palette": 230
},
"banner_background": {
"header_background": {
"hex": "#fdf6e3",
"palette": 230
},
"banner_foreground": {
"header_foreground": {
"hex": "#657b83",
"palette": 241
},
@ -106,6 +106,14 @@
"hex": "#eee8d5",
"palette": 254
},
"banner_background": {
"hex": "#657b83",
"palette": 241
},
"banner_foreground": {
"hex": "#fdf6e3",
"palette": 230
},
"list_header_background": {
"hex": "#fdf6e3",
"palette": 230