Change a few colors of the theme. (#87)

Co-authored-by: Yorunokyujitsu <Yorunokyujitsu@gmail.com>
This commit is contained in:
ITotalJustice
2025-01-12 22:21:54 +00:00
committed by GitHub
parent 91a08d36b4
commit e3f846c9ec
11 changed files with 22 additions and 21 deletions

View File

@@ -13,11 +13,11 @@ line = 0xffbc41
line_seperator = 0xffbc41 line_seperator = 0xffbc41
text = 0xffbc41 text = 0xffbc41
text_info = 0xffbc41 text_info = 0xd79f36
text_selected = 0x529cff text_selected = 0x529cff
selected_background = 0x0f115c selected_background = 0x0f115c
scrollbar = 0x3250f0 scrollbar = 0x529cff
scrollbar_background = ; hide the background scrollbar_background = ; hide the background
progressbar = 0x3250f0 progressbar = 0x3250f0

View File

@@ -1,16 +1,16 @@
[theme] [theme]
background = 0x2d2d2d background = 0x2d2d2d
grid = 0x46464630 grid = 0x46464630
popup = 0x464646 popup = 0x2d2d2d
error = 0xfa5a3a error = 0xfa5a3a
line = 0xfbfbfb line = 0xfbfbfb
line_seperator = 0xd1d1d1 line_separator = 0x707070
text = 0xfbfbfb text = 0xfbfbfb
text_info = 0xd1d1d1 text_info = 0xd1d1d1
text_selected = 0x00ffc8 text_selected = 0x00ffc8
selected_background = 0x464646 selected_background = 0x212227
sidebar = 0x000000dc sidebar = 0x000000dc

View File

@@ -1,11 +1,11 @@
[theme] [theme]
background = 0xececec background = 0xebebeb
grid = 0xf1f1f1 grid = 0xf0f0f0
popup = 0xf1f1f1 popup = 0xebebeb
error = 0xfa5a3a error = 0xfa5a3a
line = 0x373737 line = 0x373737
line_seperator = 0x373737 line_separator = 0x6d787a
text = 0x373737 text = 0x373737
text_info = 0x808080 text_info = 0x808080
@@ -24,7 +24,7 @@ progressbar_background = 0x808080
highlight_1 = 0x1989c6 highlight_1 = 0x1989c6
highlight_2 = 0x89f0f2 highlight_2 = 0x89f0f2
icon_colour = 0x6f7779 icon_colour = 0x6d787a
icon_audio = romfs:/theme/icon_audio.png icon_audio = romfs:/theme/icon_audio.png
icon_video = romfs:/theme/icon_video.png icon_video = romfs:/theme/icon_video.png
icon_image = romfs:/theme/icon_image.png icon_image = romfs:/theme/icon_image.png

View File

@@ -182,7 +182,7 @@ enum ThemeEntryID {
// colour of line separators in a list. // colour of line separators in a list.
ThemeEntryID_LINE, ThemeEntryID_LINE,
ThemeEntryID_LINE_SEPERATOR, ThemeEntryID_LINE_SEPARATOR,
// colour of the sidebar backrgound. // colour of the sidebar backrgound.
ThemeEntryID_SIDEBAR, ThemeEntryID_SIDEBAR,

View File

@@ -51,9 +51,10 @@ constexpr ThemeIdPair THEME_ENTRIES[] = {
{ "text_info", ThemeEntryID_TEXT_INFO, ElementType::Colour }, { "text_info", ThemeEntryID_TEXT_INFO, ElementType::Colour },
{ "text_selected", ThemeEntryID_TEXT_SELECTED, ElementType::Colour }, { "text_selected", ThemeEntryID_TEXT_SELECTED, ElementType::Colour },
{ "selected_background", ThemeEntryID_SELECTED_BACKGROUND, ElementType::Colour }, { "selected_background", ThemeEntryID_SELECTED_BACKGROUND, ElementType::Colour },
{ "error", ThemeEntryID_ERROR, ElementType::Colour },
{ "popup", ThemeEntryID_POPUP, ElementType::Colour }, { "popup", ThemeEntryID_POPUP, ElementType::Colour },
{ "line", ThemeEntryID_LINE, ElementType::Colour }, { "line", ThemeEntryID_LINE, ElementType::Colour },
{ "line_seperator", ThemeEntryID_LINE_SEPERATOR, ElementType::Colour }, { "line_separator", ThemeEntryID_LINE_SEPARATOR, ElementType::Colour },
{ "sidebar", ThemeEntryID_SIDEBAR, ElementType::Colour }, { "sidebar", ThemeEntryID_SIDEBAR, ElementType::Colour },
{ "scrollbar", ThemeEntryID_SCROLLBAR, ElementType::Colour }, { "scrollbar", ThemeEntryID_SCROLLBAR, ElementType::Colour },
{ "scrollbar_background", ThemeEntryID_SCROLLBAR_BACKGROUND, ElementType::Colour }, { "scrollbar_background", ThemeEntryID_SCROLLBAR_BACKGROUND, ElementType::Colour },

View File

@@ -1147,7 +1147,7 @@ auto ErrorBox::Draw(NVGcontext* vg, Theme* theme) -> void {
gfx::drawTextArgs(vg, center_x, 380, 20, NVG_ALIGN_CENTER | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_INFO), "If this message appears repeatedly, please open an issue."_i18n.c_str()); gfx::drawTextArgs(vg, center_x, 380, 20, NVG_ALIGN_CENTER | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_INFO), "If this message appears repeatedly, please open an issue."_i18n.c_str());
gfx::drawTextArgs(vg, center_x, 415, 20, NVG_ALIGN_CENTER | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_INFO), "https://github.com/ITotalJustice/sphaira/issues"); gfx::drawTextArgs(vg, center_x, 415, 20, NVG_ALIGN_CENTER | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_INFO), "https://github.com/ITotalJustice/sphaira/issues");
gfx::drawRectOutline(vg, theme, 4.f, box); gfx::drawRectOutline(vg, theme, 4.f, box);
gfx::drawTextArgs(vg, center_x, box.y + box.h/2, 23, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT), "OK"_i18n.c_str()); gfx::drawTextArgs(vg, center_x, box.y + box.h/2, 23, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_SELECTED), "OK"_i18n.c_str());
} }
} // namespace sphaira::ui } // namespace sphaira::ui

View File

@@ -581,7 +581,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
const auto& text_col = theme->GetColour(ThemeEntryID_TEXT); const auto& text_col = theme->GetColour(ThemeEntryID_TEXT);
if (m_entries_current.empty()) { if (m_entries_current.empty()) {
gfx::drawTextArgs(vg, SCREEN_WIDTH / 2.f, SCREEN_HEIGHT / 2.f, 36.f, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, text_col, "Empty..."_i18n.c_str()); gfx::drawTextArgs(vg, SCREEN_WIDTH / 2.f, SCREEN_HEIGHT / 2.f, 36.f, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_INFO), "Empty..."_i18n.c_str());
return; return;
} }
@@ -605,7 +605,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
} }
if (e.IsSelected()) { if (e.IsSelected()) {
gfx::drawText(vg, Vec2{x, y + (h / 2.f) - (24.f / 2)}, 24.f, "\uE14B", nullptr, NVG_ALIGN_RIGHT | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_SELECTED)); gfx::drawText(vg, Vec2{x - 10.f, y + (h / 2.f) - (24.f / 2)}, 24.f, "\uE14B", nullptr, NVG_ALIGN_RIGHT | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT_SELECTED));
} }
auto text_id = ThemeEntryID_TEXT; auto text_id = ThemeEntryID_TEXT;
@@ -614,7 +614,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
gfx::drawRectOutline(vg, theme, 4.f, v); gfx::drawRectOutline(vg, theme, 4.f, v);
} else { } else {
if (i != m_entries_current.size() - 1) { if (i != m_entries_current.size() - 1) {
gfx::drawRect(vg, Vec4{x, y + h, w, 1.f}, theme->GetColour(ThemeEntryID_LINE_SEPERATOR)); gfx::drawRect(vg, Vec4{x, y + h, w, 1.f}, theme->GetColour(ThemeEntryID_LINE_SEPARATOR));
} }
} }

View File

@@ -389,7 +389,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
const auto& text_col = theme->GetColour(ThemeEntryID_TEXT); const auto& text_col = theme->GetColour(ThemeEntryID_TEXT);
if (m_entries.empty()) { if (m_entries.empty()) {
gfx::drawTextArgs(vg, SCREEN_WIDTH / 2.f, SCREEN_HEIGHT / 2.f, 36.f, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, text_col, "Empty..."_i18n.c_str()); gfx::drawTextArgs(vg, SCREEN_WIDTH / 2.f, SCREEN_HEIGHT / 2.f, 36.f, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_INFO), "Empty..."_i18n.c_str());
return; return;
} }
@@ -405,7 +405,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
gfx::drawRectOutline(vg, theme, 4.f, v); gfx::drawRectOutline(vg, theme, 4.f, v);
} else { } else {
if (i != m_entries.size() - 1) { if (i != m_entries.size() - 1) {
gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPERATOR)); gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPARATOR));
} }
} }

View File

@@ -101,7 +101,7 @@ auto OptionBox::Draw(NVGcontext* vg, Theme* theme) -> void {
gfx::drawTextBox(vg, m_pos.x + padding, m_pos.y + 110.f, 26.f, m_pos.w - padding*2, theme->GetColour(ThemeEntryID_TEXT), m_message.c_str(), NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); gfx::drawTextBox(vg, m_pos.x + padding, m_pos.y + 110.f, 26.f, m_pos.w - padding*2, theme->GetColour(ThemeEntryID_TEXT), m_message.c_str(), NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgRestore(vg); nvgRestore(vg);
gfx::drawRect(vg, m_spacer_line, theme->GetColour(ThemeEntryID_LINE)); gfx::drawRect(vg, m_spacer_line, theme->GetColour(ThemeEntryID_LINE_SEPARATOR));
for (auto&p: m_entries) { for (auto&p: m_entries) {
p.Draw(vg, theme); p.Draw(vg, theme);

View File

@@ -123,7 +123,7 @@ auto PopupList::Draw(NVGcontext* vg, Theme* theme) -> void {
gfx::drawText(vg, x + m_text_xoffset, y + (h / 2.f), 20.f, m_items[i].c_str(), NULL, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_SELECTED)); gfx::drawText(vg, x + m_text_xoffset, y + (h / 2.f), 20.f, m_items[i].c_str(), NULL, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_SELECTED));
} else { } else {
if (i != m_items.size() - 1) { if (i != m_items.size() - 1) {
gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPERATOR)); gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPARATOR));
} }
gfx::drawText(vg, x + m_text_xoffset, y + (h / 2.f), 20.f, m_items[i].c_str(), NULL, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT)); gfx::drawText(vg, x + m_text_xoffset, y + (h / 2.f), 20.f, m_items[i].c_str(), NULL, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT));
} }

View File

@@ -229,7 +229,7 @@ auto Sidebar::Draw(NVGcontext* vg, Theme* theme) -> void {
const auto& [x, y, w, h] = v; const auto& [x, y, w, h] = v;
if (i != m_items.size() - 1) { if (i != m_items.size() - 1) {
gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPERATOR)); gfx::drawRect(vg, x, y + h, w, 1.f, theme->GetColour(ThemeEntryID_LINE_SEPARATOR));
} }
m_items[i]->SetY(y); m_items[i]->SetY(y);