From b6d17810be945aa9bfdde1e6c236180e65074802 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 7 May 2023 22:56:24 +0200 Subject: [PATCH] Added support for changing between light and dark color schemes for the menu system --- es-app/src/guis/GuiAlternativeEmulators.cpp | 17 ++-- .../src/guis/GuiCollectionSystemsOptions.cpp | 19 ++-- es-app/src/guis/GuiGamelistFilter.cpp | 9 +- es-app/src/guis/GuiGamelistOptions.cpp | 27 +++--- es-app/src/guis/GuiLaunchScreen.cpp | 8 +- es-app/src/guis/GuiMenu.cpp | 87 ++++++++++++------- es-app/src/guis/GuiMetaDataEd.cpp | 83 ++++++++++-------- es-app/src/guis/GuiOfflineGenerator.cpp | 48 +++++----- es-app/src/guis/GuiScraperMenu.cpp | 22 ++--- es-app/src/guis/GuiScraperMulti.cpp | 10 +-- es-app/src/guis/GuiScraperSearch.cpp | 16 ++-- es-app/src/guis/GuiScraperSingle.cpp | 12 +-- es-app/src/guis/GuiScreensaverOptions.cpp | 12 +-- es-app/src/guis/GuiSettings.cpp | 6 +- es-app/src/guis/GuiThemeDownloader.cpp | 46 +++++----- es-app/src/main.cpp | 2 +- es-app/src/views/ViewController.cpp | 80 +++++++++++++++++ es-app/src/views/ViewController.h | 1 + es-core/src/GuiComponent.h | 46 ++++++++-- es-core/src/Settings.cpp | 1 + es-core/src/Window.cpp | 15 ++-- .../src/components/AnimatedImageComponent.cpp | 1 + .../src/components/AnimatedImageComponent.h | 1 + es-core/src/components/BusyComponent.cpp | 24 ++--- es-core/src/components/ButtonComponent.cpp | 14 ++- es-core/src/components/ComponentGrid.cpp | 2 +- es-core/src/components/ComponentList.cpp | 25 ++++-- .../src/components/DateTimeEditComponent.cpp | 4 +- es-core/src/components/MenuComponent.cpp | 7 +- es-core/src/components/MenuComponent.h | 17 ++-- es-core/src/components/NinePatchComponent.cpp | 69 ++++++--------- es-core/src/components/NinePatchComponent.h | 15 +--- es-core/src/components/OptionListComponent.h | 8 +- es-core/src/components/RatingComponent.cpp | 12 ++- es-core/src/components/RatingComponent.h | 2 + .../src/components/ScrollIndicatorComponent.h | 6 +- es-core/src/components/SliderComponent.cpp | 13 +-- es-core/src/components/SwitchComponent.cpp | 11 ++- es-core/src/components/SwitchComponent.h | 1 - es-core/src/components/TextComponent.cpp | 3 +- es-core/src/components/TextEditComponent.cpp | 9 +- es-core/src/guis/GuiDetectDevice.cpp | 20 +++-- es-core/src/guis/GuiInfoPopup.cpp | 8 +- es-core/src/guis/GuiInputConfig.cpp | 35 ++++---- es-core/src/guis/GuiMsgBox.cpp | 4 +- es-core/src/guis/GuiTextEditKeyboardPopup.cpp | 24 ++--- es-core/src/guis/GuiTextEditPopup.cpp | 10 +-- resources/graphics/arrow.svg | 25 +++++- resources/graphics/busy_0.svg | 53 +++++++++-- resources/graphics/busy_1.svg | 53 +++++++++-- resources/graphics/busy_2.svg | 53 +++++++++-- resources/graphics/busy_3.svg | 53 +++++++++-- resources/graphics/button.svg | 18 +++- resources/graphics/button_filled.svg | 19 +++- resources/graphics/checkbox_checked.svg | 24 ++++- resources/graphics/checkbox_unchecked.svg | 22 ++++- resources/graphics/frame.svg | 18 +++- resources/graphics/off.svg | 18 +++- resources/graphics/on.svg | 16 +++- resources/graphics/option_arrow.svg | 24 ++++- resources/graphics/scroll_down.svg | 4 +- resources/graphics/scroll_up.svg | 4 +- resources/graphics/slider_knob.svg | 21 ++++- resources/graphics/slider_knob_disabled.svg | 19 ---- resources/graphics/star_filled.svg | 3 +- resources/graphics/star_unfilled.svg | 3 +- 66 files changed, 908 insertions(+), 454 deletions(-) delete mode 100644 resources/graphics/slider_knob_disabled.svg diff --git a/es-app/src/guis/GuiAlternativeEmulators.cpp b/es-app/src/guis/GuiAlternativeEmulators.cpp index 453bfb038..ff504845c 100644 --- a/es-app/src/guis/GuiAlternativeEmulators.cpp +++ b/es-app/src/guis/GuiAlternativeEmulators.cpp @@ -41,7 +41,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators() std::string name {(*it)->getName()}; std::shared_ptr systemText { - std::make_shared(name, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + std::make_shared(name, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; systemText->setSize(systemSizeX, systemText->getSize().y); row.addElement(systemText, false); @@ -71,19 +71,20 @@ GuiAlternativeEmulators::GuiAlternativeEmulators() std::shared_ptr labelText; if (label == (*it)->getSystemEnvData()->mLaunchCommands.front().second) { - labelText = std::make_shared( - label, Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); + labelText = + std::make_shared(label, Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), + mMenuColorPrimary, ALIGN_RIGHT); } else { // Mark any non-default value with bold and add a gear symbol as well. labelText = std::make_shared( label + (!invalidEntry ? " " + ViewController::GEAR_CHAR : ""), - Font::get(FONT_SIZE_MEDIUM, FONT_PATH_BOLD), 0x777777FF, ALIGN_RIGHT); + Font::get(FONT_SIZE_MEDIUM, FONT_PATH_BOLD), mMenuColorPrimary, ALIGN_RIGHT); } // Mark invalid entries with red color. if (invalidEntry) - labelText->setColor(TEXTCOLOR_SCRAPERMARKED); + labelText->setColor(mMenuColorRed); mCommandRows[name] = labelText; labelText->setSize(mMenu.getSize().x - systemSizeX - @@ -111,7 +112,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators() ComponentListRow row; std::shared_ptr systemText {std::make_shared( ViewController::EXCLAMATION_CHAR + " NO ALTERNATIVE EMULATORS DEFINED", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_CENTER)}; + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_CENTER)}; row.addElement(systemText, true); mMenu.addRow(row); } @@ -135,7 +136,7 @@ void GuiAlternativeEmulators::updateMenu(const std::string& systemName, mCommandRows[systemName].get()->setValue(label + " " + ViewController::GEAR_CHAR); } - mCommandRows[systemName].get()->setColor(DEFAULT_TEXTCOLOR); + mCommandRows[systemName].get()->setColor(mMenuColorPrimary); } void GuiAlternativeEmulators::selectorWindow(SystemData* system) @@ -154,7 +155,7 @@ void GuiAlternativeEmulators::selectorWindow(SystemData* system) label = entry.second; std::shared_ptr labelText = std::make_shared( - label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_LEFT); + label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_LEFT); labelText->setSelectable(true); if (system->getSystemEnvData()->mLaunchCommands.front().second == label) diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index 42cf0e852..fb342e527 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -34,7 +34,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) Utils::String::toUpper( CollectionSystemsManager::getInstance()->getEditingCollection()) + "' COLLECTION", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); row.makeAcceptInputHandler([this] { CollectionSystemsManager::getInstance()->exitEditMode(); @@ -165,8 +165,9 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) CollectionSystemsManager::getInstance()->getUnusedSystemsFromTheme()}; if (unusedFolders.size() > 0) { ComponentListRow row; - auto themeCollection = std::make_shared( - "CREATE NEW CUSTOM COLLECTION FROM THEME", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto themeCollection = + std::make_shared("CREATE NEW CUSTOM COLLECTION FROM THEME", + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); auto bracketThemeCollection = std::make_shared(); bracketThemeCollection->setResize( glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); @@ -186,7 +187,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) [this, name] { createCustomCollection(name); }}; row.makeAcceptInputHandler(createCollectionCall); auto themeFolder = std::make_shared( - Utils::String::toUpper(name), Font::get(FONT_SIZE_SMALL), 0x777777FF); + Utils::String::toUpper(name), Font::get(FONT_SIZE_SMALL), mMenuColorPrimary); themeFolder->setSelectable(true); row.addElement(themeFolder, true); ss->addRow(row); @@ -198,12 +199,13 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) // Create new custom collection. ComponentListRow row; - auto newCollection = std::make_shared("CREATE NEW CUSTOM COLLECTION", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto newCollection = std::make_shared( + "CREATE NEW CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); auto bracketNewCollection = std::make_shared(); bracketNewCollection->setResize( glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); bracketNewCollection->setImage(":/graphics/arrow.svg"); + bracketNewCollection->setColorShift(mMenuColorPrimary); row.addElement(newCollection, true); row.addElement(bracketNewCollection, false); auto createCollectionCall = [this](const std::string& newVal) { @@ -237,11 +239,12 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) // Delete custom collection. row.elements.clear(); auto deleteCollection = std::make_shared( - "DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + "DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); auto bracketDeleteCollection = std::make_shared(); bracketDeleteCollection->setResize( glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); bracketDeleteCollection->setImage(":/graphics/arrow.svg"); + bracketDeleteCollection->setColorShift(mMenuColorPrimary); row.addElement(deleteCollection, true); row.addElement(bracketDeleteCollection, false); row.makeAcceptInputHandler([this, customSystems] { @@ -299,7 +302,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) }; row.makeAcceptInputHandler(deleteCollectionCall); auto customCollection = std::make_shared( - Utils::String::toUpper(name), Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + Utils::String::toUpper(name), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); customCollection->setSelectable(true); row.addElement(customCollection, true); ss->addRow(row); diff --git a/es-app/src/guis/GuiGamelistFilter.cpp b/es-app/src/guis/GuiGamelistFilter.cpp index 7f5e10810..fad712ec7 100644 --- a/es-app/src/guis/GuiGamelistFilter.cpp +++ b/es-app/src/guis/GuiGamelistFilter.cpp @@ -40,7 +40,7 @@ void GuiGamelistFilter::initializeMenu() // Show filtered menu. row.elements.clear(); row.addElement(std::make_shared("RESET ALL FILTERS", Font::get(FONT_SIZE_MEDIUM), - 0x777777FF), + mMenuColorPrimary), true); row.makeAcceptInputHandler(std::bind(&GuiGamelistFilter::resetAllFilters, this)); mMenu.addRow(row); @@ -88,10 +88,10 @@ void GuiGamelistFilter::addFiltersToMenu() auto lbl = std::make_shared( Utils::String::toUpper(ViewController::KEYBOARD_CHAR + " GAME NAME"), - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); - mTextFilterField = - std::make_shared("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); + mTextFilterField = std::make_shared("", Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary, ALIGN_RIGHT); // Don't show the free text filter entry unless there are any games in the system. if (mSystem->getRootFolder()->getChildren().size() > 0) { @@ -105,6 +105,7 @@ void GuiGamelistFilter::addFiltersToMenu() auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); mTextFilterField->setValue(mFilterIndex->getTextFilter()); diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index c8d3a04a0..73d0f1ebf 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -157,10 +157,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) { if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) { row.elements.clear(); - row.addElement(std::make_shared("FILTER GAMELIST", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + row.addElement(std::make_shared( + "FILTER GAMELIST", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); - row.addElement(makeArrow(), false); + row.addElement(mMenu.makeArrow(), false); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this)); mMenu.addRow(row); } @@ -171,7 +171,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) !mIsCustomCollection) { row.elements.clear(); row.addElement(std::make_shared("THIS SYSTEM HAS NO GAMES", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); mMenu.addRow(row); } @@ -182,7 +183,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) getGamelist()->getCursor()->getSystem()->getName()) { row.elements.clear(); row.addElement(std::make_shared("ADD/REMOVE GAMES TO THIS COLLECTION", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::startEditMode, this)); mMenu.addRow(row); @@ -198,7 +200,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) Utils::String::toUpper( CollectionSystemsManager::getInstance()->getEditingCollection()) + "' COLLECTION", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::exitEditMode, this)); mMenu.addRow(row); @@ -209,9 +211,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) !(mSystem->isCollection() && file->getType() == FOLDER)) { row.elements.clear(); row.addElement(std::make_shared("EDIT THIS FOLDER'S METADATA", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); - row.addElement(makeArrow(), false); + row.addElement(mMenu.makeArrow(), false); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this)); mMenu.addRow(row); } @@ -221,9 +224,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) !(mSystem->isCollection() && file->getType() == FOLDER)) { row.elements.clear(); row.addElement(std::make_shared("EDIT THIS GAME'S METADATA", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); - row.addElement(makeArrow(), false); + row.addElement(mMenu.makeArrow(), false); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this)); mMenu.addRow(row); } @@ -232,7 +236,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system) if (file->getType() == FOLDER && file->metadata.get("folderlink") != "") { row.elements.clear(); row.addElement(std::make_shared("ENTER FOLDER (OVERRIDE FOLDER LINK)", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); row.makeAcceptInputHandler([this, file] { mFolderLinkOverride = true; diff --git a/es-app/src/guis/GuiLaunchScreen.cpp b/es-app/src/guis/GuiLaunchScreen.cpp index d8e3be7ad..3c165b539 100644 --- a/es-app/src/guis/GuiLaunchScreen.cpp +++ b/es-app/src/guis/GuiLaunchScreen.cpp @@ -57,7 +57,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game) "LAUNCHING GAME", Font::get(titleFontSize * std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())), - 0x666666FF, ALIGN_CENTER); + mMenuColorTertiary, ALIGN_CENTER); mGrid->setEntry(mTitle, glm::ivec2 {1, 1}, false, true, glm::ivec2 {1, 1}); // Spacer row. @@ -77,12 +77,12 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game) "GAME NAME", Font::get(gameNameFontSize * std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())), - 0x444444FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid->setEntry(mGameName, glm::ivec2 {1, 5}, false, true, glm::ivec2 {1, 1}); // System name. mSystemName = std::make_shared("SYSTEM NAME", Font::get(FONT_SIZE_MEDIUM), - 0x666666FF, ALIGN_CENTER); + mMenuColorTertiary, ALIGN_CENTER); mGrid->setEntry(mSystemName, glm::ivec2 {1, 6}, false, true, glm::ivec2 {1, 1}); // Spacer row. @@ -193,7 +193,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game) setPosition(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.25f); mBackground.fitTo(mSize); - mBackground.setEdgeColor(0xEEEEEEFF); + mBackground.setFrameColor(mMenuColorFrameLaunchScreen); } void GuiLaunchScreen::closeLaunchScreen() diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 08113e275..98aea7b2d 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -44,35 +44,36 @@ GuiMenu::GuiMenu() : mRenderer {Renderer::getInstance()} , mMenu {"MAIN MENU"} { - bool isFullUI {UIModeController::getInstance()->isUIModeFull()}; + const bool isFullUI {UIModeController::getInstance()->isUIModeFull()}; if (isFullUI) - addEntry("SCRAPER", 0x777777FF, true, [this] { openScraperOptions(); }); + addEntry("SCRAPER", mMenuColorPrimary, true, [this] { openScraperOptions(); }); if (isFullUI) - addEntry("UI SETTINGS", 0x777777FF, true, [this] { openUIOptions(); }); + addEntry("UI SETTINGS", mMenuColorPrimary, true, [this] { openUIOptions(); }); - addEntry("SOUND SETTINGS", 0x777777FF, true, [this] { openSoundOptions(); }); + addEntry("SOUND SETTINGS", mMenuColorPrimary, true, [this] { openSoundOptions(); }); if (isFullUI) - addEntry("INPUT DEVICE SETTINGS", 0x777777FF, true, [this] { openInputDeviceOptions(); }); + addEntry("INPUT DEVICE SETTINGS", mMenuColorPrimary, true, + [this] { openInputDeviceOptions(); }); if (isFullUI) - addEntry("GAME COLLECTION SETTINGS", 0x777777FF, true, + addEntry("GAME COLLECTION SETTINGS", mMenuColorPrimary, true, [this] { openCollectionSystemOptions(); }); if (isFullUI) - addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); }); + addEntry("OTHER SETTINGS", mMenuColorPrimary, true, [this] { openOtherOptions(); }); if (!Settings::getInstance()->getBool("ForceKiosk") && Settings::getInstance()->getString("UIMode") != "kiosk") { #if defined(__APPLE__) - addEntry("QUIT EMULATIONSTATION", 0x777777FF, false, [this] { openQuitMenu(); }); + addEntry("QUIT EMULATIONSTATION", mMenuColorPrimary, false, [this] { openQuitMenu(); }); #else if (Settings::getInstance()->getBool("ShowQuitMenu")) - addEntry("QUIT", 0x777777FF, true, [this] { openQuitMenu(); }); + addEntry("QUIT", mMenuColorPrimary, true, [this] { openQuitMenu(); }); else - addEntry("QUIT EMULATIONSTATION", 0x777777FF, false, [this] { openQuitMenu(); }); + addEntry("QUIT EMULATIONSTATION", mMenuColorPrimary, false, [this] { openQuitMenu(); }); #endif } @@ -117,9 +118,9 @@ void GuiMenu::openUIOptions() themeDownloaderInputRow.elements.clear(); themeDownloaderInputRow.addElement(std::make_shared("THEME DOWNLOADER", Font::get(FONT_SIZE_MEDIUM), - 0x777777FF), + mMenuColorPrimary), true); - themeDownloaderInputRow.addElement(makeArrow(), false); + themeDownloaderInputRow.addElement(mMenu.makeArrow(), false); themeDownloaderInputRow.makeAcceptInputHandler( std::bind(&GuiMenu::openThemeDownloader, this, s)); @@ -565,6 +566,27 @@ void GuiMenu::openUIOptions() } }); + // Menu color scheme. + auto menuColorScheme = std::make_shared>( + getHelpStyle(), "MENU COLOR SCHEME", false); + const std::string selectedMenuColor {Settings::getInstance()->getString("MenuColorScheme")}; + menuColorScheme->add("LIGHT", "light", selectedMenuColor == "light"); + menuColorScheme->add("DARK", "dark", selectedMenuColor == "dark"); + // If there are no objects returned, then there must be a manually modified entry in the + // configuration file. Simply set the menu color scheme to "light" in this case. + if (menuColorScheme->getSelectedObjects().size() == 0) + menuColorScheme->selectEntry(0); + s->addWithLabel("MENU COLOR SCHEME", menuColorScheme); + s->addSaveFunc([this, menuColorScheme, s] { + if (menuColorScheme->getSelected() != + Settings::getInstance()->getString("MenuColorScheme")) { + Settings::getInstance()->setString("MenuColorScheme", menuColorScheme->getSelected()); + s->setNeedsSaving(); + ViewController::getInstance()->setMenuColors(); + GuiMenu::close(false); + } + }); + // Open menu effect. auto menuOpeningEffect = std::make_shared>( getHelpStyle(), "MENU OPENING EFFECT", false); @@ -721,20 +743,22 @@ void GuiMenu::openUIOptions() // Media viewer. ComponentListRow mediaViewerRow; mediaViewerRow.elements.clear(); - mediaViewerRow.addElement(std::make_shared( - "MEDIA VIEWER SETTINGS", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + mediaViewerRow.addElement(std::make_shared("MEDIA VIEWER SETTINGS", + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); - mediaViewerRow.addElement(makeArrow(), false); + mediaViewerRow.addElement(mMenu.makeArrow(), false); mediaViewerRow.makeAcceptInputHandler(std::bind(&GuiMenu::openMediaViewerOptions, this)); s->addRow(mediaViewerRow); // Screensaver. ComponentListRow screensaverRow; screensaverRow.elements.clear(); - screensaverRow.addElement(std::make_shared( - "SCREENSAVER SETTINGS", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + screensaverRow.addElement(std::make_shared("SCREENSAVER SETTINGS", + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); - screensaverRow.addElement(makeArrow(), false); + screensaverRow.addElement(mMenu.makeArrow(), false); screensaverRow.makeAcceptInputHandler(std::bind(&GuiMenu::openScreensaverOptions, this)); s->addRow(screensaverRow); @@ -1203,9 +1227,9 @@ void GuiMenu::openInputDeviceOptions() configureInputRow.elements.clear(); configureInputRow.addElement( std::make_shared("CONFIGURE KEYBOARD AND CONTROLLERS", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); - configureInputRow.addElement(makeArrow(), false); + configureInputRow.addElement(mMenu.makeArrow(), false); configureInputRow.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this, s)); s->addRow(configureInputRow); @@ -1254,21 +1278,22 @@ void GuiMenu::openOtherOptions() alternativeEmulatorsRow.elements.clear(); alternativeEmulatorsRow.addElement(std::make_shared("ALTERNATIVE EMULATORS", Font::get(FONT_SIZE_MEDIUM), - 0x777777FF), + mMenuColorPrimary), true); - alternativeEmulatorsRow.addElement(makeArrow(), false); + alternativeEmulatorsRow.addElement(mMenu.makeArrow(), false); alternativeEmulatorsRow.makeAcceptInputHandler( std::bind([this] { mWindow->pushGui(new GuiAlternativeEmulators); })); s->addRow(alternativeEmulatorsRow); // Game media directory. ComponentListRow rowMediaDir; - auto mediaDirectory = std::make_shared("GAME MEDIA DIRECTORY", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto mediaDirectory = std::make_shared( + "GAME MEDIA DIRECTORY", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); auto bracketMediaDirectory = std::make_shared(); bracketMediaDirectory->setResize( glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); bracketMediaDirectory->setImage(":/graphics/arrow.svg"); + bracketMediaDirectory->setColorShift(mMenuColorPrimary); rowMediaDir.addElement(mediaDirectory, true); rowMediaDir.addElement(bracketMediaDirectory, false); std::string titleMediaDir {"ENTER GAME MEDIA DIRECTORY"}; @@ -1730,8 +1755,8 @@ void GuiMenu::openQuitMenu() }, "NO", nullptr)); }); - auto quitText = std::make_shared("QUIT EMULATIONSTATION", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto quitText = std::make_shared( + "QUIT EMULATIONSTATION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); quitText->setSelectable(true); row.addElement(quitText, true); s->addRow(row); @@ -1747,8 +1772,8 @@ void GuiMenu::openQuitMenu() }, "NO", nullptr)); }); - auto rebootText = std::make_shared("REBOOT SYSTEM", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto rebootText = std::make_shared( + "REBOOT SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); rebootText->setSelectable(true); row.addElement(rebootText, true); s->addRow(row); @@ -1765,7 +1790,7 @@ void GuiMenu::openQuitMenu() "NO", nullptr)); }); auto powerOffText = std::make_shared( - "POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + "POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); powerOffText->setSelectable(true); row.addElement(powerOffText, true); s->addRow(row); @@ -1778,7 +1803,7 @@ void GuiMenu::openQuitMenu() void GuiMenu::addVersionInfo() { mVersion.setFont(Font::get(FONT_SIZE_SMALL)); - mVersion.setColor(0x5E5E5EFF); + mVersion.setColor(mMenuColorTertiary); #if defined(IS_PRERELEASE) mVersion.setText("EMULATIONSTATION-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + @@ -1836,7 +1861,7 @@ void GuiMenu::addEntry(const std::string& name, row.addElement(std::make_shared(name, font, color), true); if (add_arrow) { - std::shared_ptr bracket {makeArrow()}; + std::shared_ptr bracket {mMenu.makeArrow()}; row.addElement(bracket, false); } diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index dedfb0aad..a6ec1693e 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -71,7 +71,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, addChild(&mGrid); mTitle = std::make_shared("EDIT METADATA", Font::get(FONT_SIZE_LARGE), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); // Extract possible subfolders from the path. @@ -93,7 +93,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, folderPath + Utils::FileSystem::getFileName(scraperParams.game->getPath()) + " [" + Utils::String::toUpper(scraperParams.system->getName()) + "]" + (scraperParams.game->getType() == FOLDER ? " " + ViewController::FOLDER_CHAR : ""), - Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER); + Font::get(FONT_SIZE_SMALL), mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mSubtitle, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1}); @@ -135,7 +135,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, if (!Settings::getInstance()->getBool("AlternativeEmulatorPerGame") && it->type == MD_ALT_EMULATOR) { ed = std::make_shared("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), - 0x777777FF, ALIGN_RIGHT); + mMenuColorPrimary, ALIGN_RIGHT); assert(ed); ed->setValue(mMetaData->get(it->key)); mEditors.push_back(ed); @@ -147,7 +147,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, // always looks for the help prompt at the back of the element stack. ComponentListRow row; auto lbl = std::make_shared(Utils::String::toUpper(it->displayName), - Font::get(FONT_SIZE_SMALL), 0x777777FF); + Font::get(FONT_SIZE_SMALL), mMenuColorPrimary); row.addElement(lbl, true); // Label. switch (it->type) { @@ -155,8 +155,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, ed = std::make_shared(); // Make the switches slightly smaller. ed->setSize(glm::ceil(ed->getSize() * 0.9f)); - - ed->setChangedColor(ICONCOLOR_USERMARKED); + ed->setChangedColor(mMenuColorBlue); row.addElement(ed, false, true); break; } @@ -166,7 +165,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, row.addElement(spacer, false); ed = std::make_shared(true, true); - ed->setChangedColor(ICONCOLOR_USERMARKED); + ed->setChangedColor(mMenuColorBlue); const float height {lbl->getSize().y * 0.71f}; ed->setSize(0.0f, height); row.addElement(ed, false, true); @@ -182,8 +181,8 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, row.addElement(spacer, false); ed = std::make_shared(true); - ed->setOriginalColor(DEFAULT_TEXTCOLOR); - ed->setChangedColor(TEXTCOLOR_USERMARKED); + ed->setOriginalColor(mMenuColorPrimary); + ed->setChangedColor(mMenuColorBlue); row.addElement(ed, false); // Pass input to the actual DateTimeEditComponent instead of the spacer. @@ -192,8 +191,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, break; } case MD_CONTROLLER: { - ed = std::make_shared( - "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); + ed = + std::make_shared("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), + mMenuColorPrimary, ALIGN_RIGHT); row.addElement(ed, true); auto spacer = std::make_shared(); @@ -203,6 +203,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); const std::string title {it->displayPrompt}; @@ -211,9 +212,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto updateVal = [ed, originalValue](const std::string& newVal) { ed->setValue(newVal); if (newVal == BadgeComponent::getDisplayName(originalValue)) - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); else - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); }; row.makeAcceptInputHandler([this, title, ed, updateVal] { @@ -225,7 +226,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, ComponentListRow row; std::shared_ptr labelText {std::make_shared( - label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; labelText->setSelectable(true); labelText->setValue(controller.displayName); @@ -250,7 +251,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, ComponentListRow row; std::shared_ptr clearText {std::make_shared( ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; clearText->setSelectable(true); row.addElement(clearText, true); row.makeAcceptInputHandler([s, ed] { @@ -276,8 +277,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, case MD_ALT_EMULATOR: { mInvalidEmulatorEntry = false; - ed = std::make_shared( - "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); + ed = + std::make_shared("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), + mMenuColorPrimary, ALIGN_RIGHT); row.addElement(ed, true); auto spacer = std::make_shared(); @@ -287,6 +289,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); const std::string title {mRenderer->getIsVerticalOrientation() ? "select emulator" : @@ -296,10 +299,10 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto updateVal = [this, ed, originalValue](const std::string& newVal) { ed->setValue(newVal); if (newVal == originalValue) { - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); } else { - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); mInvalidEmulatorEntry = false; } }; @@ -361,7 +364,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, std::shared_ptr labelText { std::make_shared(label, Font::get(FONT_SIZE_MEDIUM), - 0x777777FF)}; + mMenuColorPrimary)}; labelText->setSelectable(true); if (scraperParams.system->getAlternativeEmulator() == "" && @@ -414,8 +417,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, break; } case MD_FOLDER_LINK: { - ed = std::make_shared( - "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); + ed = + std::make_shared("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), + mMenuColorPrimary, ALIGN_RIGHT); row.addElement(ed, true); auto spacer = std::make_shared(); @@ -425,6 +429,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); const std::string title {it->displayPrompt}; @@ -462,9 +467,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, mInvalidFolderLinkEntry = false; ed->setValue(newVal); if (newVal == originalValue) - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); else - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); }; row.makeAcceptInputHandler([this, children, title, ed, updateVal, scraperParams] { @@ -480,7 +485,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, scraperParams.game->getPath() + "/", ""); std::shared_ptr labelText {std::make_shared( - label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; labelText->setSelectable(true); labelText->setValue(filePath); @@ -505,7 +510,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, ComponentListRow row; std::shared_ptr clearText {std::make_shared( ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; clearText->setSelectable(true); row.addElement(clearText, true); row.makeAcceptInputHandler([this, s, ed] { @@ -532,8 +537,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, case MD_MULTILINE_STRING: default: { // MD_STRING. - ed = std::make_shared( - "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); + ed = + std::make_shared("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), + mMenuColorPrimary, ALIGN_RIGHT); row.addElement(ed, true); auto spacer = std::make_shared(); @@ -543,6 +549,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); bool multiLine {it->type == MD_MULTILINE_STRING}; @@ -570,25 +577,25 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, ed->setValue(gamePath); } if (gamePath == originalValue) - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); else - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); } else if (newVal == "" && (currentKey == "developer" || currentKey == "publisher" || currentKey == "genre" || currentKey == "players")) { ed->setValue("unknown"); if (originalValue == "unknown") - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); else - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); } else { ed->setValue(newVal); if (newVal == originalValue) - ed->setColor(DEFAULT_TEXTCOLOR); + ed->setColor(mMenuColorPrimary); else - ed->setColor(TEXTCOLOR_USERMARKED); + ed->setColor(mMenuColorBlue); } }; @@ -705,7 +712,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, } } - mButtons = makeButtonGrid(buttons); + mButtons = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtons, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1}); // Resize + center. @@ -905,7 +912,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result) offset = 0; // Update the list with the scraped metadata values. - for (unsigned int i = 0; i < mEditors.size(); ++i) { + for (unsigned int i {0}; i < mEditors.size(); ++i) { if (mMetaDataDecl.at(i).key == "collectionsortname" && !mIsCustomCollection) offset = 1; @@ -919,9 +926,9 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result) if (mEditors.at(i)->getValue() != metadata->get(key)) { if (key == "rating") - mEditors.at(i)->setOriginalColor(ICONCOLOR_SCRAPERMARKED); + mEditors.at(i)->setOriginalColor(mMenuColorRed); else - mEditors.at(i)->setColor(TEXTCOLOR_SCRAPERMARKED); + mEditors.at(i)->setColor(mMenuColorRed); } // Save all the keys that should be scraped. if (mMetaDataDecl.at(i + offset).shouldScrape) diff --git a/es-app/src/guis/GuiOfflineGenerator.cpp b/es-app/src/guis/GuiOfflineGenerator.cpp index 841b11c80..10b107cdb 100644 --- a/es-app/src/guis/GuiOfflineGenerator.cpp +++ b/es-app/src/guis/GuiOfflineGenerator.cpp @@ -35,18 +35,18 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue& gameQueue) mGame = nullptr; // Header. - mTitle = std::make_shared("MIXIMAGE OFFLINE GENERATOR", - Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); + mTitle = std::make_shared( + "MIXIMAGE OFFLINE GENERATOR", Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {6, 1}); mStatus = std::make_shared("NOT STARTED", Font::get(FONT_SIZE_MEDIUM), - 0x777777FF, ALIGN_CENTER); + mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mStatus, glm::ivec2 {0, 1}, false, true, glm::ivec2 {6, 1}); mGameCounter = std::make_shared( std::to_string(mGamesProcessed) + " OF " + std::to_string(mTotalGames) + (mTotalGames == 1 ? " GAME " : " GAMES ") + "PROCESSED", - Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_CENTER); + Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, ALIGN_CENTER); mGrid.setEntry(mGameCounter, glm::ivec2 {0, 2}, false, true, glm::ivec2 {6, 1}); // Spacer row with top border. @@ -59,54 +59,56 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue& gameQueue) // Generated label. mGeneratedLbl = std::make_shared("Generated:", Font::get(FONT_SIZE_SMALL), - 0x888888FF, ALIGN_LEFT); + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mGeneratedLbl, glm::ivec2 {1, 4}, false, true, glm::ivec2 {1, 1}); // Generated value/counter. - mGeneratedVal = std::make_shared( - std::to_string(mGamesProcessed), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + mGeneratedVal = + std::make_shared(std::to_string(mGamesProcessed), Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mGeneratedVal, glm::ivec2 {2, 4}, false, true, glm::ivec2 {1, 1}); // Overwritten label. mOverwrittenLbl = std::make_shared("Overwritten:", Font::get(FONT_SIZE_SMALL), - 0x888888FF, ALIGN_LEFT); + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mOverwrittenLbl, glm::ivec2 {1, 5}, false, true, glm::ivec2 {1, 1}); // Overwritten value/counter. - mOverwrittenVal = std::make_shared( - std::to_string(mImagesOverwritten), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + mOverwrittenVal = std::make_shared(std::to_string(mImagesOverwritten), + Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mOverwrittenVal, glm::ivec2 {2, 5}, false, true, glm::ivec2 {1, 1}); // Skipping label. const std::string skipLabel {mRenderer->getIsVerticalOrientation() ? "Skipped:" : "Skipped (existing):"}; - mSkippedLbl = std::make_shared(skipLabel, Font::get(FONT_SIZE_SMALL), 0x888888FF, - ALIGN_LEFT); + mSkippedLbl = std::make_shared(skipLabel, Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mSkippedLbl, glm::ivec2 {1, 6}, false, true, glm::ivec2 {1, 1}); // Skipping value/counter. mSkippedVal = std::make_shared( - std::to_string(mGamesSkipped), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + std::to_string(mGamesSkipped), Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mSkippedVal, glm::ivec2 {2, 6}, false, true, glm::ivec2 {1, 1}); // Failed label. - mFailedLbl = std::make_shared("Failed:", Font::get(FONT_SIZE_SMALL), 0x888888FF, - ALIGN_LEFT); + mFailedLbl = std::make_shared("Failed:", Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mFailedLbl, glm::ivec2 {1, 7}, false, true, glm::ivec2 {1, 1}); // Failed value/counter. mFailedVal = std::make_shared( - std::to_string(mGamesFailed), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + std::to_string(mGamesFailed), Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mFailedVal, glm::ivec2 {2, 7}, false, true, glm::ivec2 {1, 1}); // Processing label. mProcessingLbl = std::make_shared("Processing: ", Font::get(FONT_SIZE_SMALL), - 0x888888FF, ALIGN_LEFT); + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mProcessingLbl, glm::ivec2 {3, 4}, false, true, glm::ivec2 {1, 1}); // Processing value. - mProcessingVal = - std::make_shared("", Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + mProcessingVal = std::make_shared("", Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mProcessingVal, glm::ivec2 {4, 4}, false, true, glm::ivec2 {1, 1}); // Spacer row. @@ -115,12 +117,12 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue& gameQueue) // Last error message label. mLastErrorLbl = std::make_shared( - "Last error message:", Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + "Last error message:", Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mLastErrorLbl, glm::ivec2 {1, 9}, false, true, glm::ivec2 {4, 1}); // Last error message value. - mLastErrorVal = - std::make_shared("", Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); + mLastErrorVal = std::make_shared("", Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_LEFT); mGrid.setEntry(mLastErrorVal, glm::ivec2 {1, 10}, false, true, glm::ivec2 {4, 1}); // Right spacer. @@ -172,7 +174,7 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue& gameQueue) }); buttons.push_back(mCloseButton); - mButtonGrid = makeButtonGrid(buttons); + mButtonGrid = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 12}, true, false, glm::ivec2 {6, 1}); diff --git a/es-app/src/guis/GuiScraperMenu.cpp b/es-app/src/guis/GuiScraperMenu.cpp index 97488de53..ff708631d 100644 --- a/es-app/src/guis/GuiScraperMenu.cpp +++ b/es-app/src/guis/GuiScraperMenu.cpp @@ -113,11 +113,11 @@ GuiScraperMenu::GuiScraperMenu(std::string title) } mMenu.addWithLabel("SCRAPE THESE SYSTEMS", mSystems); - addEntry("ACCOUNT SETTINGS", 0x777777FF, true, [this] { + addEntry("ACCOUNT SETTINGS", mMenuColorPrimary, true, [this] { // Open the account options menu. openAccountOptions(); }); - addEntry("CONTENT SETTINGS", 0x777777FF, true, [this] { + addEntry("CONTENT SETTINGS", mMenuColorPrimary, true, [this] { // If the scraper service has been changed before entering this menu, then save the // settings so that the specific options supported by the respective scrapers // can be enabled or disabled. @@ -125,11 +125,11 @@ GuiScraperMenu::GuiScraperMenu(std::string title) mMenu.save(); openContentOptions(); }); - addEntry("MIXIMAGE SETTINGS", 0x777777FF, true, [this] { + addEntry("MIXIMAGE SETTINGS", mMenuColorPrimary, true, [this] { // Open the miximage options menu. openMiximageOptions(); }); - addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { + addEntry("OTHER SETTINGS", mMenuColorPrimary, true, [this] { // If the scraper service has been changed before entering this menu, then save the // settings so that the specific options supported by the respective scrapers // can be enabled or disabled. @@ -168,8 +168,8 @@ void GuiScraperMenu::openAccountOptions() auto s = new GuiSettings("ACCOUNT SETTINGS"); // ScreenScraper username. - auto scraperUsernameScreenScraper = - std::make_shared("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); + auto scraperUsernameScreenScraper = std::make_shared( + "", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_RIGHT); s->addEditableTextComponent("SCREENSCRAPER USERNAME", scraperUsernameScreenScraper, Settings::getInstance()->getString("ScraperUsernameScreenScraper")); s->addSaveFunc([scraperUsernameScreenScraper, s] { @@ -182,8 +182,8 @@ void GuiScraperMenu::openAccountOptions() }); // ScreenScraper password. - auto scraperPasswordScreenScraper = - std::make_shared("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); + auto scraperPasswordScreenScraper = std::make_shared( + "", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_RIGHT); std::string passwordMasked; if (Settings::getInstance()->getString("ScraperPasswordScreenScraper") != "") { passwordMasked = "********"; @@ -631,9 +631,9 @@ void GuiScraperMenu::openMiximageOptions() offlineGeneratorRow.elements.clear(); offlineGeneratorRow.addElement(std::make_shared("OFFLINE GENERATOR", Font::get(FONT_SIZE_MEDIUM), - 0x777777FF), + mMenuColorPrimary), true); - offlineGeneratorRow.addElement(makeArrow(), false); + offlineGeneratorRow.addElement(mMenu.makeArrow(), false); offlineGeneratorRow.makeAcceptInputHandler( std::bind(&GuiScraperMenu::openOfflineGenerator, this, s)); s->addRow(offlineGeneratorRow); @@ -1198,7 +1198,7 @@ void GuiScraperMenu::addEntry(const std::string& name, row.addElement(std::make_shared(name, font, color), true); if (add_arrow) { - std::shared_ptr bracket {makeArrow()}; + std::shared_ptr bracket {mMenu.makeArrow()}; row.addElement(bracket, false); } diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index 5faff4b03..6178b4d9c 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -45,15 +45,15 @@ GuiScraperMulti::GuiScraperMulti(const std::queue& searches // Set up grid. mTitle = std::make_shared("SCRAPING IN PROGRESS", Font::get(FONT_SIZE_LARGE), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); - mSystem = std::make_shared("SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, - ALIGN_CENTER); + mSystem = std::make_shared("SYSTEM", Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mSystem, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1}); mSubtitle = std::make_shared("subtitle text", Font::get(FONT_SIZE_SMALL), - 0x888888FF, ALIGN_CENTER); + mMenuColorSecondary, ALIGN_CENTER); mGrid.setEntry(mSubtitle, glm::ivec2 {0, 3}, false, true, glm::ivec2 {2, 1}); if (mApproveResults && !Settings::getInstance()->getBool("ScraperSemiautomatic")) @@ -144,7 +144,7 @@ GuiScraperMulti::GuiScraperMulti(const std::queue& searches buttons.push_back(std::make_shared("STOP", "stop", std::bind(&GuiScraperMulti::finish, this))); - mButtonGrid = makeButtonGrid(buttons); + mButtonGrid = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1}); // Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 0c2a14163..736ba889b 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -59,8 +59,8 @@ GuiScraperSearch::GuiScraperSearch(SearchType type, unsigned int scrapeCount) glm::ivec2 {1, 3}, GridFlags::BORDER_TOP | GridFlags::BORDER_BOTTOM); // Selected result name. - mResultName = - std::make_shared("Result name", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + mResultName = std::make_shared("Result name", Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary); // Selected result thumbnail. mResultThumbnail = std::make_shared(); @@ -75,15 +75,15 @@ GuiScraperSearch::GuiScraperSearch(SearchType type, unsigned int scrapeCount) else mDescContainer->setScrollParameters(6000.0f, 3000.0f, 0.8f); - mResultDesc = - std::make_shared("Result desc", Font::get(FONT_SIZE_SMALL), 0x777777FF); + mResultDesc = std::make_shared("Result desc", Font::get(FONT_SIZE_SMALL), + mMenuColorPrimary); mDescContainer->addChild(mResultDesc.get()); mDescContainer->setAutoScroll(true); // Metadata. auto font = Font::get(FONT_SIZE_SMALL); // Placeholder, gets replaced in onSizeChanged(). - const unsigned int mdColor {0x777777FF}; - const unsigned int mdLblColor {0x666666FF}; + const unsigned int mdColor {mMenuColorPrimary}; + const unsigned int mdLblColor {mMenuColorTertiary}; mMD_Rating = std::make_shared(false, true); mMD_ReleaseDate = std::make_shared(); mMD_ReleaseDate->setColor(mdColor); @@ -381,7 +381,7 @@ void GuiScraperSearch::onSearchDone(std::vector& results) mResultList->setLoopRows(true); auto font = Font::get(FONT_SIZE_MEDIUM); - unsigned int color {0x777777FF}; + unsigned int color {mMenuColorPrimary}; if (results.empty()) { // Check if the scraper used is still valid. if (!isValidConfiguredScraper()) { @@ -650,7 +650,7 @@ void GuiScraperSearch::render(const glm::mat4& parentTrans) glm::mat4 trans {parentTrans * getTransform()}; renderChildren(trans); - mRenderer->drawRect(0.0f, 0.0f, mSize.x, mSize.y, 0x00000009, 0x00000009); + mRenderer->drawRect(0.0f, 0.0f, mSize.x, mSize.y, mMenuColorPanelDimmed, mMenuColorPanelDimmed); // Slight adjustment upwards so the busy grid is not rendered precisely at the text edge. trans = glm::translate( diff --git a/es-app/src/guis/GuiScraperSingle.cpp b/es-app/src/guis/GuiScraperSingle.cpp index d87c8f2b1..e9858bce9 100644 --- a/es-app/src/guis/GuiScraperSingle.cpp +++ b/es-app/src/guis/GuiScraperSingle.cpp @@ -48,13 +48,13 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params, mGameName = std::make_shared( scrapeName + ((mSearchParams.game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""), - Font::get(FONT_SIZE_LARGE), 0x777777FF, ALIGN_CENTER); - mGameName->setColor(0x555555FF); + Font::get(FONT_SIZE_LARGE), mMenuColorPrimary, ALIGN_CENTER); + mGameName->setColor(mMenuColorTitle); mGrid.setEntry(mGameName, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); - mSystemName = - std::make_shared(Utils::String::toUpper(mSearchParams.system->getFullName()), - Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_CENTER); + mSystemName = std::make_shared( + Utils::String::toUpper(mSearchParams.system->getFullName()), Font::get(FONT_SIZE_SMALL), + mMenuColorSecondary, ALIGN_CENTER); mGrid.setEntry(mSystemName, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1}); // Row 3 is a spacer. @@ -104,7 +104,7 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params, } delete this; })); - mButtonGrid = makeButtonGrid(buttons); + mButtonGrid = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1}); diff --git a/es-app/src/guis/GuiScreensaverOptions.cpp b/es-app/src/guis/GuiScreensaverOptions.cpp index f8b5b5591..5820b53d8 100644 --- a/es-app/src/guis/GuiScreensaverOptions.cpp +++ b/es-app/src/guis/GuiScreensaverOptions.cpp @@ -82,18 +82,18 @@ GuiScreensaverOptions::GuiScreensaverOptions(const std::string& title) ComponentListRow row; row.elements.clear(); row.addElement(std::make_shared("SLIDESHOW SCREENSAVER SETTINGS", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); - row.addElement(makeArrow(), false); + row.addElement(getMenu().makeArrow(), false); row.makeAcceptInputHandler( std::bind(&GuiScreensaverOptions::openSlideshowScreensaverOptions, this)); addRow(row); row.elements.clear(); row.addElement(std::make_shared("VIDEO SCREENSAVER SETTINGS", - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); - row.addElement(makeArrow(), false); + row.addElement(getMenu().makeArrow(), false); row.makeAcceptInputHandler( std::bind(&GuiScreensaverOptions::openVideoScreensaverOptions, this)); addRow(row); @@ -192,8 +192,8 @@ void GuiScreensaverOptions::openSlideshowScreensaverOptions() }); // Custom image directory. - auto screensaverSlideshowImageDir = - std::make_shared("", Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_RIGHT); + auto screensaverSlideshowImageDir = std::make_shared( + "", Font::get(FONT_SIZE_SMALL), mMenuColorPrimary, ALIGN_RIGHT); s->addEditableTextComponent( "CUSTOM IMAGE DIRECTORY", screensaverSlideshowImageDir, Settings::getInstance()->getString("ScreensaverSlideshowImageDir"), diff --git a/es-app/src/guis/GuiSettings.cpp b/es-app/src/guis/GuiSettings.cpp index 7a89012ca..a0fcea828 100644 --- a/es-app/src/guis/GuiSettings.cpp +++ b/es-app/src/guis/GuiSettings.cpp @@ -176,18 +176,18 @@ void GuiSettings::addEditableTextComponent(const std::string label, row.elements.clear(); auto lbl = std::make_shared(Utils::String::toUpper(label), - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); - + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); row.addElement(lbl, true); row.addElement(ed, true); auto spacer = std::make_shared(); - spacer->setSize(Renderer::getScreenWidth() * 0.005f, 0); + spacer->setSize(Renderer::getScreenWidth() * 0.005f, 0.0f); row.addElement(spacer, false); auto bracket = std::make_shared(); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); row.addElement(bracket, false); // OK callback (apply new value to ed). diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 4505bbad0..6f8632b1d 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -40,7 +40,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) // Set up main grid. mTitle = std::make_shared("THEME DOWNLOADER", Font::get(FONT_SIZE_LARGE), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}, GridFlags::BORDER_BOTTOM); @@ -51,46 +51,46 @@ GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) glm::ivec2 {1, 5}); mVariantsLabel = - std::make_shared("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); + std::make_shared("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mVariantsLabel, glm::ivec2 {1, 0}, false, true, glm::ivec2 {1, 1}); mColorSchemesLabel = - std::make_shared("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); + std::make_shared("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mColorSchemesLabel, glm::ivec2 {1, 1}, false, true, glm::ivec2 {1, 1}); mAspectRatiosLabel = - std::make_shared("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); + std::make_shared("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mAspectRatiosLabel, glm::ivec2 {3, 0}, false, true, glm::ivec2 {1, 1}); mFutureUseLabel = - std::make_shared("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); + std::make_shared("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mFutureUseLabel, glm::ivec2 {3, 1}, false, true, glm::ivec2 {1, 1}); mCenterGrid->setEntry(std::make_shared(), glm::ivec2 {5, 0}, false, false, glm::ivec2 {1, 5}); mVariantCount = std::make_shared("", Font::get(fontSizeSmall, FONT_PATH_LIGHT), - 0x555555FF, ALIGN_LEFT); + mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mVariantCount, glm::ivec2 {2, 0}, false, true, glm::ivec2 {1, 1}); mColorSchemesCount = std::make_shared( - "", Font::get(fontSizeSmall, FONT_PATH_LIGHT), 0x555555FF, ALIGN_LEFT); + "", Font::get(fontSizeSmall, FONT_PATH_LIGHT), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mColorSchemesCount, glm::ivec2 {2, 1}, false, true, glm::ivec2 {1, 1}); mAspectRatiosCount = std::make_shared( - "", Font::get(fontSizeSmall, FONT_PATH_LIGHT), 0x555555FF, ALIGN_LEFT); + "", Font::get(fontSizeSmall, FONT_PATH_LIGHT), mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mAspectRatiosCount, glm::ivec2 {4, 0}, false, true, glm::ivec2 {1, 1}); mFutureUseCount = std::make_shared("", Font::get(fontSizeSmall, FONT_PATH_LIGHT), - 0x555555FF, ALIGN_LEFT); + mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mFutureUseCount, glm::ivec2 {4, 1}, false, true, glm::ivec2 {1, 1}); mDownloadStatus = std::make_shared("", Font::get(fontSizeSmall, FONT_PATH_BOLD), - 0x555555FF, ALIGN_LEFT); + mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mDownloadStatus, glm::ivec2 {1, 2}, false, true, glm::ivec2 {2, 1}); mLocalChanges = std::make_shared("", Font::get(fontSizeSmall, FONT_PATH_BOLD), - 0x555555FF, ALIGN_LEFT); + mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mLocalChanges, glm::ivec2 {3, 2}, false, true, glm::ivec2 {2, 1}); mScreenshot = std::make_shared(); @@ -98,7 +98,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) mCenterGrid->setEntry(mScreenshot, glm::ivec2 {1, 3}, false, true, glm::ivec2 {4, 1}); mAuthor = std::make_shared("", Font::get(FONT_SIZE_MINI * 0.9f, FONT_PATH_LIGHT), - 0x555555FF, ALIGN_LEFT); + mMenuColorTitle, ALIGN_LEFT); mCenterGrid->setEntry(mAuthor, glm::ivec2 {1, 4}, false, true, glm::ivec2 {4, 1}); mList = std::make_shared(); @@ -124,7 +124,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) std::vector> buttons; buttons.push_back(std::make_shared("CLOSE", "CLOSE", [&] { delete this; })); - mButtons = makeButtonGrid(buttons); + mButtons = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtons, glm::ivec2 {0, 3}, true, false, glm::ivec2 {2, 1}, GridFlags::BORDER_TOP); @@ -689,8 +689,8 @@ void GuiThemeDownloader::populateGUI() themeName.append(" ").append(ViewController::EXCLAMATION_CHAR); ComponentListRow row; - std::shared_ptr themeNameElement { - std::make_shared(themeName, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; + std::shared_ptr themeNameElement {std::make_shared( + themeName, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)}; ThemeGUIEntry guiEntry; guiEntry.themeName = themeNameElement; @@ -861,31 +861,31 @@ void GuiThemeDownloader::updateInfoPane() if (mThemeSets[mList->getCursorId()].isCloned) { mDownloadStatus->setText(ViewController::TICKMARK_CHAR + " INSTALLED"); - mDownloadStatus->setColor(0x449944FF); + mDownloadStatus->setColor(mMenuColorGreen); } else if (mThemeSets[mList->getCursorId()].invalidRepository || mThemeSets[mList->getCursorId()].manuallyDownloaded) { mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " MANUAL DOWNLOAD"); - mDownloadStatus->setColor(0x992222FF); + mDownloadStatus->setColor(mMenuColorRed); } else if (mThemeSets[mList->getCursorId()].corruptRepository) { mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " CORRUPT"); - mDownloadStatus->setColor(0x992222FF); + mDownloadStatus->setColor(mMenuColorRed); } else if (mThemeSets[mList->getCursorId()].shallowRepository) { mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " SHALLOW"); - mDownloadStatus->setColor(0x992222FF); + mDownloadStatus->setColor(mMenuColorRed); } else { if (mThemeSets[mList->getCursorId()].newEntry) mDownloadStatus->setText("NOT INSTALLED (NEW)"); else mDownloadStatus->setText("NOT INSTALLED"); - mDownloadStatus->setColor(0x999999FF); + mDownloadStatus->setColor(mMenuColorSecondary); } if (mThemeSets[mList->getCursorId()].hasLocalChanges) { mLocalChanges->setText(ViewController::EXCLAMATION_CHAR + " LOCAL CHANGES"); - mLocalChanges->setColor(0x992222FF); + mLocalChanges->setColor(mMenuColorRed); } else { mLocalChanges->setText(""); @@ -1036,8 +1036,8 @@ void GuiThemeDownloader::render(const glm::mat4& parentTrans) if (mGrayRectangleCoords.size() == 4) { mRenderer->setMatrix(parentTrans * getTransform()); mRenderer->drawRect(mGrayRectangleCoords[0], mGrayRectangleCoords[1], - mGrayRectangleCoords[2], mGrayRectangleCoords[3], 0x00000009, - 0x00000009); + mGrayRectangleCoords[2], mGrayRectangleCoords[3], mMenuColorPanelDimmed, + mMenuColorPanelDimmed); } if (mFetching) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 4f1847824..9a67aedfc 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -721,7 +721,7 @@ int main(int argc, char* argv[]) renderer = Renderer::getInstance(); window = Window::getInstance(); - ViewController::getInstance(); + ViewController::getInstance()->setMenuColors(); CollectionSystemsManager::getInstance(); Screensaver screensaver; MediaViewer mediaViewer; diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 6ff5efc2b..962dd9db1 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -59,6 +59,86 @@ ViewController* ViewController::getInstance() return &instance; } +void ViewController::setMenuColors() +{ + if (Settings::getInstance()->getString("MenuColorScheme") == "dark") { + mMenuColorFrame = 0x191919FF; + mMenuColorFrameLaunchScreen = 0x121212FF; + mMenuColorFrameBusyComponent = 0x090909FF; + mMenuColorPanelDimmed = 0x00000032; + + mMenuColorTitle = 0xA6A6A6FF; + mMenuColorPrimary = 0x909090FF; + mMenuColorSecondary = 0xA3A3A3FF; + mMenuColorTertiary = 0xA0A0A0FF; + mMenuColorRed = 0xCA3E3EFF; + mMenuColorGreen = 0x449944FF; + mMenuColorBlue = 0x4757ddff; + + mMenuColorSelector = 0x070707FF; + mMenuColorSeparators = 0x303030FF; + mMenuColorBusyComponent = 0x888888FF; + mMenuColorScrollIndicators = 0x929292FF; + mMenuColorPopupText = 0xBBBBBBFF; + + mMenuColorButtonFocused = 0x050505FF; + mMenuColorButtonTextFocused = 0xAFAFAFFF; + mMenuColorButtonTextUnfocused = 0x878787FF; + mMenuColorButtonFlatFocused = 0x090909FF; + mMenuColorButtonFlatUnfocused = 0x242424FF; + + mMenuColorKeyboardModifier = 0xC62F2FFF; + mMenuColorKeyboardCursorFocused = 0xAAAAAAFF; + mMenuColorKeyboardCursorUnfocused = 0x666666FF; + mMenuColorKeyboardText = 0x92929200; + mMenuColorTextInputFrameFocused = 0x090909FF; + mMenuColorTextInputFrameUnfocused = 0x242424FF; + + mMenuColorSlider = 0xAAAAAAFF; + mMenuColorSliderKnobDisabled = 0x464646FF; + mMenuColorDateTimeEditMarker = 0xFFFFFF22; + mMenuColorDetectDeviceHeld = 0x99999900; + } + else { + mMenuColorFrame = 0xEFEFEFFF; + mMenuColorFrameLaunchScreen = 0xDFDFDFFF; + mMenuColorFrameBusyComponent = 0xFFFFFFFF; + mMenuColorPanelDimmed = 0x00000009; + + mMenuColorTitle = 0x555555FF; + mMenuColorPrimary = 0x777777FF; + mMenuColorSecondary = 0x888888FF; + mMenuColorTertiary = 0x666666FF; + mMenuColorRed = 0x992222FF; + mMenuColorGreen = 0x449944FF; + mMenuColorBlue = 0x222299FF; + + mMenuColorSelector = 0xFFFFFFFF; + mMenuColorSeparators = 0xC6C7C6FF; + mMenuColorBusyComponent = 0xB8B8B8FF; + mMenuColorScrollIndicators = 0x888888FF; + mMenuColorPopupText = 0x444444FF; + + mMenuColorButtonFocused = 0x777777FF; + mMenuColorButtonTextFocused = 0xFFFFFFFF; + mMenuColorButtonTextUnfocused = 0x777777FF; + mMenuColorButtonFlatFocused = 0x878787FF; + mMenuColorButtonFlatUnfocused = 0xDADADAFF; + + mMenuColorKeyboardModifier = 0xF26767FF; + mMenuColorKeyboardCursorFocused = 0x777777FF; + mMenuColorKeyboardCursorUnfocused = 0xC7C7C7FF; + mMenuColorKeyboardText = 0x77777700; + mMenuColorTextInputFrameFocused = 0xFFFFFFFF; + mMenuColorTextInputFrameUnfocused = 0xFFFFFFFF; + + mMenuColorSlider = 0x777777FF; + mMenuColorSliderKnobDisabled = 0xC9C9C9FF; + mMenuColorDateTimeEditMarker = 0x00000022; + mMenuColorDetectDeviceHeld = 0x44444400; + } +} + void ViewController::invalidSystemsFileDialog() { std::string errorMessage = "COULDN'T PARSE THE SYSTEMS CONFIGURATION FILE. " diff --git a/es-app/src/views/ViewController.h b/es-app/src/views/ViewController.h index 61b3a88f2..49253573c 100644 --- a/es-app/src/views/ViewController.h +++ b/es-app/src/views/ViewController.h @@ -33,6 +33,7 @@ public: static ViewController* getInstance(); // These functions are called from main(). + void setMenuColors(); void invalidSystemsFileDialog(); void noGamesDialog(); void invalidAlternativeEmulatorDialog(); diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 215bc2155..7f61b29aa 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -17,14 +17,6 @@ #include #include -#define DEFAULT_TEXTCOLOR 0x777777FF -#define DEFAULT_INVERTED_TEXTCOLOR 0x444444FF -#define DEFAULT_INVERTED_IMAGECOLOR 0x666666FF -#define DEFAULT_COLORSHIFT 0xFFFFFFFF -#define ICONCOLOR_SCRAPERMARKED 0xFF7777FF -#define ICONCOLOR_USERMARKED 0x7777FFFF -#define TEXTCOLOR_SCRAPERMARKED 0x992222FF -#define TEXTCOLOR_USERMARKED 0x222299FF #define DISABLED_OPACITY 0.314f class Animation; @@ -355,6 +347,44 @@ protected: unsigned int mColorChangedValue; unsigned int mComponentThemeFlags; + // Default values are for the "light" color scheme. + static inline unsigned int mMenuColorFrame {0xEFEFEFFF}; + static inline unsigned int mMenuColorFrameLaunchScreen {0xDFDFDFFF}; + static inline unsigned int mMenuColorFrameBusyComponent {0xFFFFFFFF}; + static inline unsigned int mMenuColorPanelDimmed {0x00000009}; + + static inline unsigned int mMenuColorTitle {0x555555FF}; + static inline unsigned int mMenuColorPrimary {0x777777FF}; + static inline unsigned int mMenuColorSecondary {0x888888FF}; + static inline unsigned int mMenuColorTertiary {0x666666FF}; + static inline unsigned int mMenuColorRed {0x992222FF}; + static inline unsigned int mMenuColorGreen {0x449944FF}; + static inline unsigned int mMenuColorBlue {0x222299FF}; + + static inline unsigned int mMenuColorSelector {0xFFFFFFFF}; + static inline unsigned int mMenuColorSeparators {0xC6C7C6FF}; + static inline unsigned int mMenuColorBusyComponent {0xB8B8B8FF}; + static inline unsigned int mMenuColorScrollIndicators {0x888888FF}; + static inline unsigned int mMenuColorPopupText {0x444444FF}; + + static inline unsigned int mMenuColorButtonFocused {0x777777FF}; + static inline unsigned int mMenuColorButtonTextFocused {0xFFFFFFFF}; + static inline unsigned int mMenuColorButtonTextUnfocused {0x777777FF}; + static inline unsigned int mMenuColorButtonFlatFocused {0x878787FF}; + static inline unsigned int mMenuColorButtonFlatUnfocused {0xDADADAFF}; + + static inline unsigned int mMenuColorKeyboardModifier {0xF26767FF}; + static inline unsigned int mMenuColorKeyboardCursorFocused {0x777777FF}; + static inline unsigned int mMenuColorKeyboardCursorUnfocused {0xC7C7C7FF}; + static inline unsigned int mMenuColorKeyboardText {0x77777700}; + static inline unsigned int mMenuColorTextInputFrameFocused {0x777777FF}; + static inline unsigned int mMenuColorTextInputFrameUnfocused {0xFFFFFFFF}; + + static inline unsigned int mMenuColorSlider {0x777777FF}; + static inline unsigned int mMenuColorSliderKnobDisabled {0xC9C9C9FF}; + static inline unsigned int mMenuColorDateTimeEditMarker {0x00000022}; + static inline unsigned int mMenuColorDetectDeviceHeld {0x44444400}; + glm::vec3 mPosition; glm::vec2 mOrigin; glm::vec2 mRotationOrigin; diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index adc980e9a..d294617c0 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -160,6 +160,7 @@ void Settings::setDefaults() mStringMap["QuickSystemSelect"] = {"leftrightshoulders", "leftrightshoulders"}; mStringMap["StartupSystem"] = {"", ""}; mStringMap["DefaultSortOrder"] = {"filename, ascending", "filename, ascending"}; + mStringMap["MenuColorScheme"] = {"light", "light"}; mStringMap["MenuOpeningEffect"] = {"scale-up", "scale-up"}; mStringMap["LaunchScreenDuration"] = {"normal", "normal"}; mStringMap["UIMode"] = {"full", "full"}; diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 943120d4f..820bbea30 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -135,12 +135,12 @@ bool Window::init() mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f, (mRenderer->getScreenHeight() - mSplash->getSize().y) / 2.0f * 0.6f); - mSplashTextScanning = std::unique_ptr(mDefaultFonts.at(1)->buildTextCache( - "Searching for games...", 0.0f, 0.0f, DEFAULT_TEXTCOLOR)); + mSplashTextScanning = std::unique_ptr( + mDefaultFonts.at(1)->buildTextCache("Searching for games...", 0.0f, 0.0f, 0x777777FF)); mSplashTextPopulating = std::unique_ptr( - mDefaultFonts.at(1)->buildTextCache("Loading systems...", 0.0f, 0.0f, DEFAULT_TEXTCOLOR)); + mDefaultFonts.at(1)->buildTextCache("Loading systems...", 0.0f, 0.0f, 0x777777FF)); mSplashTextReloading = std::unique_ptr( - mDefaultFonts.at(1)->buildTextCache("Reloading...", 0.0f, 0.0f, DEFAULT_TEXTCOLOR)); + mDefaultFonts.at(1)->buildTextCache("Reloading...", 0.0f, 0.0f, 0x777777FF)); mSplashTextPositions.x = (mRenderer->getScreenWidth() - mSplashTextScanning->metrics.size.x) / 2.0f; @@ -161,7 +161,7 @@ bool Window::init() progressBarRect.barPosX = (mRenderer->getScreenWidth() / 2.0f) - (progressBarRect.barWidth / 2.0f); progressBarRect.barPosY = mSplashTextPositions.y + (progressBarRect.barHeight * 2.0f); - progressBarRect.color = DEFAULT_TEXTCOLOR; + progressBarRect.color = 0x777777FF; mProgressBarRectangles.emplace_back(progressBarRect); const float borderThickness {std::ceil(2.0f * mRenderer->getScreenResolutionModifier())}; @@ -528,7 +528,10 @@ void Window::render() // clang-format on // Also dim the background slightly. - backgroundParameters.dimming = 0.60f; + if (Settings::getInstance()->getString("MenuColorScheme") == "dark") + backgroundParameters.dimming = 0.80f; + else + backgroundParameters.dimming = 0.60f; mRenderer->shaderPostprocessing(Renderer::Shader::CORE | Renderer::Shader::BLUR_HORIZONTAL | diff --git a/es-core/src/components/AnimatedImageComponent.cpp b/es-core/src/components/AnimatedImageComponent.cpp index 4f530cc5a..169be0e63 100644 --- a/es-core/src/components/AnimatedImageComponent.cpp +++ b/es-core/src/components/AnimatedImageComponent.cpp @@ -34,6 +34,7 @@ void AnimatedImageComponent::load(const AnimationDef* def) auto img = std::unique_ptr(new ImageComponent); img->setResize(mSize); img->setImage(std::string(def->frames[i].path), false); + img->setColorShift(def->color); mFrames.push_back(ImageFrame(std::move(img), def->frames[i].time)); } diff --git a/es-core/src/components/AnimatedImageComponent.h b/es-core/src/components/AnimatedImageComponent.h index 00704a0ea..396101afb 100644 --- a/es-core/src/components/AnimatedImageComponent.h +++ b/es-core/src/components/AnimatedImageComponent.h @@ -21,6 +21,7 @@ struct AnimationFrame { struct AnimationDef { AnimationFrame* frames; size_t frameCount; + unsigned int color; bool loop; }; diff --git a/es-core/src/components/BusyComponent.cpp b/es-core/src/components/BusyComponent.cpp index 2aeb6150a..616206ae0 100644 --- a/es-core/src/components/BusyComponent.cpp +++ b/es-core/src/components/BusyComponent.cpp @@ -11,22 +11,13 @@ #include "components/AnimatedImageComponent.h" #include "components/ImageComponent.h" -// Animation definition. -AnimationFrame BUSY_ANIMATION_FRAMES[] { - {":/graphics/busy_0.svg", 300}, - {":/graphics/busy_1.svg", 300}, - {":/graphics/busy_2.svg", 300}, - {":/graphics/busy_3.svg", 300}, -}; - -const AnimationDef BUSY_ANIMATION_DEF = {BUSY_ANIMATION_FRAMES, 4, true}; - BusyComponent::BusyComponent() : mBackground {":/graphics/frame.png"} , mGrid {glm::ivec2 {5, 3}} { mAnimation = std::make_shared(); - mText = std::make_shared("WORKING...", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + mText = std::make_shared("WORKING...", Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary); // Col 0 = animation, col 1 = spacer, col 2 = text. mGrid.setEntry(mAnimation, glm::ivec2 {1, 1}, false, true); @@ -59,8 +50,17 @@ void BusyComponent::onSizeChanged() mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3), textHeight + (2.0f * Renderer::getScreenResolutionModifier())}, mAnimation->getPosition(), glm::vec2 {0.0f, 0.0f}); + mBackground.setFrameColor(mMenuColorFrameBusyComponent); - mAnimation->load(&BUSY_ANIMATION_DEF); + AnimationFrame BUSY_ANIMATION_FRAMES[] { + {":/graphics/busy_0.svg", 300}, + {":/graphics/busy_1.svg", 300}, + {":/graphics/busy_2.svg", 300}, + {":/graphics/busy_3.svg", 300}, + }; + + const AnimationDef animationDef {BUSY_ANIMATION_FRAMES, 4, mMenuColorBusyComponent, true}; + mAnimation->load(&animationDef); } void BusyComponent::reset() diff --git a/es-core/src/components/ButtonComponent.cpp b/es-core/src/components/ButtonComponent.cpp index 4de217645..b15519de8 100644 --- a/es-core/src/components/ButtonComponent.cpp +++ b/es-core/src/components/ButtonComponent.cpp @@ -24,10 +24,10 @@ ButtonComponent::ButtonComponent(const std::string& text, , mFocused {false} , mEnabled {true} , mFlatStyle {flatStyle} - , mTextColorFocused {0xFFFFFFFF} - , mTextColorUnfocused {0x777777FF} - , mFlatColorFocused {0x878787FF} - , mFlatColorUnfocused {0x60606025} + , mTextColorFocused {mMenuColorButtonTextFocused} + , mTextColorUnfocused {mMenuColorButtonTextUnfocused} + , mFlatColorFocused {mMenuColorButtonFlatFocused} + , mFlatColorUnfocused {mMenuColorButtonFlatUnfocused} { mBox.setSharpCorners(true); @@ -172,12 +172,10 @@ void ButtonComponent::updateImage() { if (!mEnabled || !mPressedFunc) { mBox.setImagePath(":/graphics/button_filled.svg"); - mBox.setCenterColor(0x770000FF); - mBox.setEdgeColor(0x770000FF); + mBox.setFrameColor(0x770000FF); return; } - mBox.setCenterColor(0xFFFFFFFF); - mBox.setEdgeColor(0xFFFFFFFF); + mBox.setFrameColor(mMenuColorButtonFocused); mBox.setImagePath(mFocused ? ":/graphics/button_filled.svg" : ":/graphics/button.svg"); } diff --git a/es-core/src/components/ComponentGrid.cpp b/es-core/src/components/ComponentGrid.cpp index b05888cfa..d6010473e 100644 --- a/es-core/src/components/ComponentGrid.cpp +++ b/es-core/src/components/ComponentGrid.cpp @@ -432,7 +432,7 @@ void ComponentGrid::render(const glm::mat4& parentTrans) for (size_t i = 0; i < mSeparators.size(); ++i) { mRenderer->setMatrix(trans); mRenderer->drawRect(mSeparators[i][0], mSeparators[i][1], mSeparators[i][2], - mSeparators[i][3], 0xC6C7C6FF, 0xC6C7C6FF); + mSeparators[i][3], mMenuColorSeparators, mMenuColorSeparators); } } diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index cedc136fe..7905d4b85 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -311,6 +311,15 @@ void ComponentList::render(const glm::mat4& parentTrans) trans = glm::translate(trans, glm::vec3 {0.0f, -mCameraOffset, 0.0f}); glm::mat4 loopTrans {trans}; + const bool darkColorScheme {Settings::getInstance()->getString("MenuColorScheme") == "dark"}; + + // Draw selector bar if we're using the dark color scheme. + if (mFocused && mOpacity == 1.0f && darkColorScheme) { + const float selectedRowHeight {getRowHeight(mEntries.at(mCursor).data)}; + mRenderer->setMatrix(trans); + mRenderer->drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, + mMenuColorSelector, mMenuColorSelector, false, mOpacity, mDimming); + } // Draw our entries. std::vector drawAfterCursor; @@ -362,9 +371,9 @@ void ComponentList::render(const glm::mat4& parentTrans) } else { if (isTextComponent) - it->component->setColor(DEFAULT_INVERTED_TEXTCOLOR); + it->component->setColor(mMenuColorPrimary); else - it->component->setColorShift(DEFAULT_INVERTED_IMAGECOLOR); + it->component->setColorShift(mMenuColorPrimary); renderLoopFunc(); // Revert to the original color after rendering. if (isTextComponent) @@ -386,13 +395,13 @@ void ComponentList::render(const glm::mat4& parentTrans) // Custom rendering. mRenderer->setMatrix(trans); - // Draw selector bar. - if (mFocused) { + // Draw selector bar if we're using the light color scheme. + if (mFocused && !darkColorScheme) { const float selectedRowHeight {getRowHeight(mEntries.at(mCursor).data)}; if (mOpacity == 1.0f) { - mRenderer->drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, 0xFFFFFFFF, - 0xFFFFFFFF, false, mOpacity, mDimming, + mRenderer->drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, + mMenuColorSelector, mMenuColorSelector, false, mOpacity, mDimming, Renderer::BlendFactor::ONE_MINUS_DST_COLOR, Renderer::BlendFactor::ZERO); @@ -413,12 +422,12 @@ void ComponentList::render(const glm::mat4& parentTrans) float y {0.0f}; for (unsigned int i {0}; i < mEntries.size(); ++i) { mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenResolutionModifier(), - 0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming); + mMenuColorSeparators, mMenuColorSeparators, false, mOpacity, mDimming); y += getRowHeight(mEntries.at(i).data); } mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenResolutionModifier(), - 0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming); + mMenuColorSeparators, mMenuColorSeparators, false, mOpacity, mDimming); mRenderer->popClipRect(); } diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index f00baf929..90b09f988 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -23,7 +23,7 @@ DateTimeEditComponent::DateTimeEditComponent(bool alignRight, DisplayMode dispMo , mKeyRepeatDir {0} , mKeyRepeatTimer {0} , mRelativeUpdateAccumulator {0} - , mColor {0x777777FF} + , mColor {mMenuColorPrimary} , mFont {Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)} , mAlignRight {alignRight} , mUppercase {false} @@ -201,7 +201,7 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans) if (mEditIndex >= 0 && static_cast(mEditIndex) < mCursorBoxes.size()) mRenderer->drawRect(mCursorBoxes[mEditIndex][0], mCursorBoxes[mEditIndex][1], mCursorBoxes[mEditIndex][2], mCursorBoxes[mEditIndex][3], - 0x00000022, 0x00000022); + mMenuColorDateTimeEditMarker, mMenuColorDateTimeEditMarker); } } } diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 9ab8457bf..73be51242 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -32,7 +32,7 @@ MenuComponent::MenuComponent(std::string title, const std::shared_ptr& tit // Set up title. mTitle = std::make_shared(); mTitle->setHorizontalAlignment(ALIGN_CENTER); - mTitle->setColor(0x555555FF); + mTitle->setColor(mMenuColorTitle); setTitle(title, titleFont); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); @@ -165,7 +165,7 @@ void MenuComponent::updateGrid() } } -std::shared_ptr makeButtonGrid( +std::shared_ptr MenuComponent::makeButtonGrid( const std::vector>& buttons) { std::shared_ptr buttonGrid { @@ -190,10 +190,11 @@ std::shared_ptr makeButtonGrid( return buttonGrid; } -std::shared_ptr makeArrow() +std::shared_ptr MenuComponent::makeArrow() { auto bracket = std::make_shared(); bracket->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()); bracket->setImage(":/graphics/arrow.svg"); + bracket->setColorShift(mMenuColorPrimary); return bracket; } diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index a5b0bbfa7..31f1dfbfe 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -9,8 +9,10 @@ #ifndef ES_CORE_COMPONENTS_MENU_COMPONENT_H #define ES_CORE_COMPONENTS_MENU_COMPONENT_H +#include "components/ButtonComponent.h" #include "components/ComponentGrid.h" #include "components/ComponentList.h" +#include "components/ImageComponent.h" #include "components/NinePatchComponent.h" #include "components/ScrollIndicatorComponent.h" #include "components/TextComponent.h" @@ -18,13 +20,6 @@ #include -class ButtonComponent; -class ImageComponent; - -std::shared_ptr makeButtonGrid( - const std::vector>& buttons); -std::shared_ptr makeArrow(); - class MenuComponent : public GuiComponent { public: @@ -51,7 +46,8 @@ public: { ComponentListRow row; row.addElement(std::make_shared(Utils::String::toUpper(label), - Font::get(FONT_SIZE_MEDIUM), 0x777777FF), + Font::get(FONT_SIZE_MEDIUM), + mMenuColorPrimary), true); row.addElement(comp, false, invert_when_selected); addRow(row, setCursorHere); @@ -63,6 +59,11 @@ public: const std::string& helpText, const std::function& callback); + static std::shared_ptr makeButtonGrid( + const std::vector>& buttons); + + std::shared_ptr makeArrow(); + void setTitle(std::string title, const std::shared_ptr& font); std::shared_ptr getList() { return mList; } diff --git a/es-core/src/components/NinePatchComponent.cpp b/es-core/src/components/NinePatchComponent.cpp index 61d67d332..3573dc7b1 100644 --- a/es-core/src/components/NinePatchComponent.cpp +++ b/es-core/src/components/NinePatchComponent.cpp @@ -13,34 +13,24 @@ #include "resources/Font.h" #include "resources/TextureResource.h" -NinePatchComponent::NinePatchComponent(const std::string& path, - unsigned int edgeColor, - unsigned int centerColor) +NinePatchComponent::NinePatchComponent(const std::string& path) : mRenderer {Renderer::getInstance()} - , mVertices {nullptr} , mPath {path} , mCornerSize {16.0f, 16.0f} , mSharpCorners {false} - , mEdgeColor {edgeColor} - , mCenterColor {centerColor} + , mFrameColor {mMenuColorFrame} { if (!mPath.empty()) buildVertices(); } -NinePatchComponent::~NinePatchComponent() -{ - if (mVertices != nullptr) - delete[] mVertices; -} - void NinePatchComponent::updateColors() { - for (int i = 0; i < 6 * 9; ++i) - mVertices[i].color = mEdgeColor; + if (mVertices == nullptr) + return; - for (int i = 6 * 4; i < 6; ++i) - mVertices[(6 * 4) + i].color = mCenterColor; + for (int i {0}; i < 6 * 9; ++i) + (*mVertices)[i].color = mFrameColor; } void NinePatchComponent::buildVertices() @@ -48,9 +38,7 @@ void NinePatchComponent::buildVertices() if (mSize.x == 0.0f || mSize.y == 0.0f) return; - if (mVertices != nullptr) - delete[] mVertices; - + mVertices.reset(); glm::vec2 relCornerSize {0.0f, 0.0f}; // Don't scale the rasterized version of the frame as it would look bad. @@ -70,13 +58,12 @@ void NinePatchComponent::buildVertices() mTexture->rasterizeAt(texSize.x, texSize.y); - if (mTexture->getSize() == glm::ivec2 {}) { - mVertices = nullptr; - LOG(LogWarning) << "NinePatchComponent has no texture"; + if (mTexture->getSize() == glm::ivec2 {0, 0}) { + LOG(LogError) << "NinePatchComponent has no texture"; return; } - mVertices = new Renderer::Vertex[6 * 9]; + mVertices = std::make_unique>(6 * 9); const float imgSizeX[3] {relCornerSize.x, mSize.x - relCornerSize.x * 2.0f, relCornerSize.x}; const float imgSizeY[3] {relCornerSize.y, mSize.y - relCornerSize.y * 2.0f, relCornerSize.y}; @@ -93,9 +80,9 @@ void NinePatchComponent::buildVertices() const float texPosY[3] {1.0f, 1.0f + texSizeY[0], 1.0f + texSizeY[0] + texSizeY[1]}; // clang-format on - int v = 0; + int v {0}; - for (int slice = 0; slice < 9; ++slice) { + for (int slice {0}; slice < 9; ++slice) { const int sliceX {slice % 3}; const int sliceY {slice / 3}; const glm::vec2 imgPos {imgPosX[sliceX], imgPosY[sliceY]}; @@ -104,19 +91,19 @@ void NinePatchComponent::buildVertices() const glm::vec2 texSizeSlice {texSizeX[sliceX], texSizeY[sliceY]}; // clang-format off - mVertices[v + 1] = {{imgPos.x , imgPos.y }, {texPos.x, texPos.y }, 0}; - mVertices[v + 2] = {{imgPos.x , imgPos.y + imgSize.y}, {texPos.x, texPos.y + texSizeSlice.y}, 0}; - mVertices[v + 3] = {{imgPos.x + imgSize.x, imgPos.y }, {texPos.x + texSizeSlice.x, texPos.y }, 0}; - mVertices[v + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0}; + (*mVertices)[v + 1] = {{imgPos.x , imgPos.y }, {texPos.x, texPos.y }, 0}; + (*mVertices)[v + 2] = {{imgPos.x , imgPos.y + imgSize.y}, {texPos.x, texPos.y + texSizeSlice.y}, 0}; + (*mVertices)[v + 3] = {{imgPos.x + imgSize.x, imgPos.y }, {texPos.x + texSizeSlice.x, texPos.y }, 0}; + (*mVertices)[v + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0}; // clang-format on // Round vertices. - for (int i = 1; i < 5; ++i) - mVertices[v + i].position = glm::round(mVertices[v + i].position); + for (int i {1}; i < 5; ++i) + (*mVertices)[v + i].position = glm::round((*mVertices)[v + i].position); // Make duplicates of first and last vertex so this can be rendered as a triangle strip. - mVertices[v + 0] = mVertices[v + 1]; - mVertices[v + 5] = mVertices[v + 4]; + (*mVertices)[v + 0] = (*mVertices)[v + 1]; + (*mVertices)[v + 5] = (*mVertices)[v + 4]; v += 6; } @@ -133,10 +120,10 @@ void NinePatchComponent::render(const glm::mat4& parentTrans) if (mTexture && mVertices != nullptr) { mRenderer->setMatrix(trans); - mVertices->opacity = mOpacity; - mVertices->shaderFlags = Renderer::ShaderFlags::PREMULTIPLIED; + (*mVertices)[0].opacity = mOpacity; + (*mVertices)[0].shaderFlags = Renderer::ShaderFlags::PREMULTIPLIED; mTexture->bind(); - mRenderer->drawTriangleStrips(&mVertices[0], 6 * 9); + mRenderer->drawTriangleStrips(&mVertices->at(0), 6 * 9); } renderChildren(trans); @@ -159,14 +146,8 @@ void NinePatchComponent::setImagePath(const std::string& path) buildVertices(); } -void NinePatchComponent::setEdgeColor(unsigned int edgeColor) +void NinePatchComponent::setFrameColor(unsigned int frameColor) { - mEdgeColor = edgeColor; - updateColors(); -} - -void NinePatchComponent::setCenterColor(unsigned int centerColor) -{ - mCenterColor = centerColor; + mFrameColor = frameColor; updateColors(); } diff --git a/es-core/src/components/NinePatchComponent.h b/es-core/src/components/NinePatchComponent.h index 5086b9e5a..010c231e5 100644 --- a/es-core/src/components/NinePatchComponent.h +++ b/es-core/src/components/NinePatchComponent.h @@ -29,10 +29,7 @@ class TextureResource; class NinePatchComponent : public GuiComponent { public: - NinePatchComponent(const std::string& path = "", - unsigned int edgeColor = 0xFFFFFFFF, - unsigned int centerColor = 0xFFFFFFFF); - virtual ~NinePatchComponent(); + NinePatchComponent(const std::string& path = ""); void render(const glm::mat4& parentTrans) override; @@ -42,10 +39,7 @@ public: glm::vec2 padding = {-32.0f, -32.0f}); void setImagePath(const std::string& path); - // Apply a color shift to the "edge" parts of the ninepatch. - void setEdgeColor(unsigned int edgeColor); - // Apply a color shift to the "center" part of the ninepatch. - void setCenterColor(unsigned int centerColor); + void setFrameColor(unsigned int frameColor); const glm::vec2& getCornerSize() const { return mCornerSize; } void setCornerSize(const glm::vec2& size) @@ -60,13 +54,12 @@ private: void updateColors(); Renderer* mRenderer; - Renderer::Vertex* mVertices; + std::unique_ptr> mVertices; std::string mPath; glm::vec2 mCornerSize; bool mSharpCorners; - unsigned int mEdgeColor; - unsigned int mCenterColor; + unsigned int mFrameColor; std::shared_ptr mTexture; }; diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index b392ab36a..e8a38a908 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -45,7 +45,7 @@ public: { auto font {Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)}; mText.setFont(font); - mText.setColor(0x777777FF); + mText.setColor(mMenuColorPrimary); mText.setHorizontalAlignment(ALIGN_CENTER); addChild(&mText); @@ -54,14 +54,17 @@ public: if (mMultiSelect) { mRightArrow.setImage(":/graphics/arrow.svg"); + mRightArrow.setColorShift(mMenuColorPrimary); addChild(&mRightArrow); } else { mLeftArrow.setImage(":/graphics/option_arrow.svg"); + mLeftArrow.setColorShift(mMenuColorPrimary); mLeftArrow.setFlipX(true); addChild(&mLeftArrow); mRightArrow.setImage(":/graphics/option_arrow.svg"); + mRightArrow.setColorShift(mMenuColorPrimary); addChild(&mRightArrow); } @@ -431,7 +434,7 @@ private: for (auto it = mParent->mEntries.begin(); it != mParent->mEntries.end(); ++it) { row.elements.clear(); auto textComponent = std::make_shared( - Utils::String::toUpper(it->name), font, 0x777777FF); + Utils::String::toUpper(it->name), font, mMenuColorPrimary); row.addElement(textComponent, true); if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) { @@ -446,6 +449,7 @@ private: auto checkbox = std::make_shared(); checkbox->setResize(0, font->getLetterHeight()); checkbox->setImage(it->selected ? CHECKED_PATH : UNCHECKED_PATH); + checkbox->setColorShift(mMenuColorPrimary); row.addElement(checkbox, false); if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) diff --git a/es-core/src/components/RatingComponent.cpp b/es-core/src/components/RatingComponent.cpp index a63d98d24..3a0a26077 100644 --- a/es-core/src/components/RatingComponent.cpp +++ b/es-core/src/components/RatingComponent.cpp @@ -17,8 +17,8 @@ RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation) : mRenderer {Renderer::getInstance()} , mValue {0.5f} , mImageRatio {1.0f} - , mColorOriginalValue {DEFAULT_COLORSHIFT} - , mColorChangedValue {DEFAULT_COLORSHIFT} + , mColorOriginalValue {mMenuColorPrimary} + , mColorChangedValue {mMenuColorPrimary} , mColorizeChanges {colorizeChanges} , mOverlay {true} { @@ -29,11 +29,13 @@ RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation) mIconFilled.setTileSize(mSize.y, mSize.y); mIconFilled.setDynamic(false); mIconFilled.setLinearInterpolation(linearInterpolation); + mIconFilled.setColorShift(mMenuColorPrimary); mIconUnfilled.setResize(mSize, false); mIconUnfilled.setTileSize(mSize.y, mSize.y); mIconUnfilled.setDynamic(false); mIconUnfilled.setLinearInterpolation(linearInterpolation); + mIconUnfilled.setColorShift(mMenuColorPrimary); mIconFilled.setImage(std::string(":/graphics/star_filled.svg"), true); mIconUnfilled.setImage(std::string(":/graphics/star_unfilled.svg"), true); @@ -63,7 +65,7 @@ void RatingComponent::setValue(const std::string& value) // This should only happen if an external scraper has been used or if the file has // been manually edited. if (mColorizeChanges && mValue != stof(value)) { - mOriginalValue = ICONCOLOR_USERMARKED; + mOriginalValue = mMenuColorBlue; mIconFilled.setColorShift(0x449944FF); } @@ -267,6 +269,10 @@ void RatingComponent::applyTheme(const std::shared_ptr& theme, mIconFilled.setColorShift(elem->get("color")); mIconUnfilled.setColorShift(elem->get("color")); } + else { + mIconFilled.setColorShift(0xFFFFFFFF); + mIconFilled.setColorShift(0xFFFFFFFF); + } } } diff --git a/es-core/src/components/RatingComponent.h b/es-core/src/components/RatingComponent.h index 16e40df50..e036e9b31 100644 --- a/es-core/src/components/RatingComponent.h +++ b/es-core/src/components/RatingComponent.h @@ -34,6 +34,8 @@ public: void onSizeChanged() override; void setDimming(float dimming) override; + unsigned int getColorShift() const override { return mIconFilled.getColorShift(); } + void setColorShift(unsigned int color) override { mIconFilled.setColorShift(color); } void setOriginalColor(unsigned int color) override { mColorOriginalValue = color; } void setChangedColor(unsigned int color) override { mColorChangedValue = color; } diff --git a/es-core/src/components/ScrollIndicatorComponent.h b/es-core/src/components/ScrollIndicatorComponent.h index 910587e2a..f9913351b 100644 --- a/es-core/src/components/ScrollIndicatorComponent.h +++ b/es-core/src/components/ScrollIndicatorComponent.h @@ -11,10 +11,11 @@ #define FADE_IN_TIME 90.0f +#include "GuiComponent.h" #include "animations/LambdaAnimation.h" #include "components/ComponentList.h" -class ScrollIndicatorComponent +class ScrollIndicatorComponent : public GuiComponent { public: ScrollIndicatorComponent(std::shared_ptr componentList, @@ -27,6 +28,9 @@ public: scrollUp->setImage(":/graphics/scroll_up.svg"); scrollDown->setImage(":/graphics/scroll_down.svg"); + scrollUp->setColorShift(mMenuColorScrollIndicators); + scrollDown->setColorShift(mMenuColorScrollIndicators); + scrollUp->setOpacity(0.0f); scrollDown->setOpacity(0.0f); diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 34878da9e..2e5c499a0 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -35,10 +35,12 @@ SliderComponent::SliderComponent(float min, float max, float increment, const st mKnob.setResize(0.0f, std::round(mSize.y * 0.7f)); mKnob.setOrigin(0.5f, 0.0f); mKnob.setImage(":/graphics/slider_knob.svg"); + mKnob.setColorShift(mMenuColorSlider); mKnobDisabled.setResize(0.0f, std::round(mSize.y * 0.7f)); mKnobDisabled.setOrigin(0.5f, 0.0f); - mKnobDisabled.setImage(":/graphics/slider_knob_disabled.svg"); + mKnobDisabled.setImage(":/graphics/slider_knob.svg"); + mKnobDisabled.setColorShift(mMenuColorSliderKnobDisabled); } bool SliderComponent::input(InputConfig* config, Input input) @@ -106,9 +108,10 @@ void SliderComponent::render(const glm::mat4& parentTrans) if (mTextCache) mFont->renderTextCache(mTextCache.get()); - mRenderer->drawRect(mKnob.getSize().x / 2.0f, mBarPosY, width, mBarHeight, - 0x77777700 | static_cast(mOpacity * 255.0f), - 0x77777700 | static_cast(mOpacity * 255.0f)); + mRenderer->drawRect( + mKnob.getSize().x / 2.0f, mBarPosY, width, mBarHeight, + (mMenuColorSlider & 0xFFFFFF00) | static_cast(mOpacity * 255.0f), + (mMenuColorSlider & 0xFFFFFF00) | static_cast(mOpacity * 255.0f)); if (mOpacity > DISABLED_OPACITY) mKnob.render(trans); @@ -156,7 +159,7 @@ void SliderComponent::onValueChanged() glm::vec2 textSize {mFont->sizeText(max)}; mTextCache = std::shared_ptr(mFont->buildTextCache( - val, mSize.x - textSize.x, (mSize.y - textSize.y) / 2.0f, 0x777777FF)); + val, mSize.x - textSize.x, (mSize.y - textSize.y) / 2.0f, mMenuColorPrimary)); mTextCache->metrics.size.x = textSize.x; // Fudge the width. } diff --git a/es-core/src/components/SwitchComponent.cpp b/es-core/src/components/SwitchComponent.cpp index be84cd2db..a7fc3031a 100644 --- a/es-core/src/components/SwitchComponent.cpp +++ b/es-core/src/components/SwitchComponent.cpp @@ -13,11 +13,12 @@ SwitchComponent::SwitchComponent(bool state) : mState {state} , mOriginalValue {state} - , mColorOriginalValue {DEFAULT_COLORSHIFT} - , mColorChangedValue {DEFAULT_COLORSHIFT} + , mColorOriginalValue {mMenuColorPrimary} + , mColorChangedValue {mMenuColorPrimary} { mImage.setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()); mImage.setImage(":/graphics/off.svg"); + mImage.setColorShift(mMenuColorPrimary); mSize = mImage.getSize(); } @@ -43,7 +44,13 @@ bool SwitchComponent::input(InputConfig* config, Input input) void SwitchComponent::render(const glm::mat4& parentTrans) { glm::mat4 trans {parentTrans * getTransform()}; + const float imageOpacity {mImage.getOpacity()}; + const float opacity { + mState ? imageOpacity : + (mState == mOriginalValue ? 0.5f * imageOpacity : 0.7f * imageOpacity)}; + mImage.setOpacity(opacity); mImage.render(trans); + mImage.setOpacity(imageOpacity); renderChildren(trans); } diff --git a/es-core/src/components/SwitchComponent.h b/es-core/src/components/SwitchComponent.h index 60843e59a..25a2dc8f0 100644 --- a/es-core/src/components/SwitchComponent.h +++ b/es-core/src/components/SwitchComponent.h @@ -12,7 +12,6 @@ #include "GuiComponent.h" #include "components/ImageComponent.h" -// A simple "on/off" switch. class SwitchComponent : public GuiComponent { public: diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 92e6f86d9..07e8da1f3 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -288,9 +288,8 @@ void TextComponent::onTextChanged() return; } - if (!mFont || text.empty() || mSize.x < 0.0f) { + if (!mFont || text.empty() || mSize.x < 0.0f) return; - } float lineHeight {0.0f}; const bool isScrollable {mParent && mParent->isScrollable()}; diff --git a/es-core/src/components/TextEditComponent.cpp b/es-core/src/components/TextEditComponent.cpp index 469a6e6a1..6c904a0a0 100644 --- a/es-core/src/components/TextEditComponent.cpp +++ b/es-core/src/components/TextEditComponent.cpp @@ -41,6 +41,7 @@ void TextEditComponent::onFocusGained() { mFocused = true; mBox.setImagePath(":/graphics/textinput_focused.svg"); + mBox.setFrameColor(mMenuColorTextInputFrameFocused); startEditing(); } @@ -48,6 +49,7 @@ void TextEditComponent::onFocusLost() { mFocused = false; mBox.setImagePath(":/graphics/textinput.svg"); + mBox.setFrameColor(mMenuColorTextInputFrameUnfocused); } void TextEditComponent::onSizeChanged() @@ -270,7 +272,8 @@ void TextEditComponent::onTextChanged() mWrappedText = (isMultiline() ? mFont->wrapText(mText, getTextAreaSize().x, 0.0f, 1.5f, true) : mText); mTextCache = std::unique_ptr(mFont->buildTextCache( - mWrappedText, 0.0f, 0.0f, 0x77777700 | static_cast(mOpacity * 255.0f))); + mWrappedText, 0.0f, 0.0f, + mMenuColorKeyboardText | static_cast(mOpacity * 255.0f))); if (mCursor > static_cast(mText.length())) mCursor = static_cast(mText.length()); @@ -334,13 +337,13 @@ void TextEditComponent::render(const glm::mat4& parentTrans) if (!mEditing) { mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f, 2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight, - 0xC7C7C7FF, 0xC7C7C7FF); + mMenuColorKeyboardCursorUnfocused, mMenuColorKeyboardCursorUnfocused); } if (mEditing && mBlinkTime < BLINKTIME / 2) { mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f, 2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight, - 0x777777FF, 0x777777FF); + mMenuColorKeyboardCursorFocused, mMenuColorKeyboardCursorFocused); } } diff --git a/es-core/src/guis/GuiDetectDevice.cpp b/es-core/src/guis/GuiDetectDevice.cpp index bd04b55a3..86762de32 100644 --- a/es-core/src/guis/GuiDetectDevice.cpp +++ b/es-core/src/guis/GuiDetectDevice.cpp @@ -34,8 +34,9 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun, addChild(&mGrid); // Title. - mTitle = std::make_shared(firstRun ? "WELCOME" : "CONFIGURE INPUT DEVICE", - Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); + mTitle = + std::make_shared(firstRun ? "WELCOME" : "CONFIGURE INPUT DEVICE", + Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {1, 1}, GridFlags::BORDER_BOTTOM); @@ -52,26 +53,26 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun, deviceInfo << " (ONLY ACCEPTING INPUT FROM FIRST CONTROLLER)"; mDeviceInfo = std::make_shared(deviceInfo.str(), Font::get(FONT_SIZE_SMALL), - 0x999999FF, ALIGN_CENTER); + mMenuColorSecondary, ALIGN_CENTER); mGrid.setEntry(mDeviceInfo, glm::ivec2 {0, 1}, false, true); // Message. if (numDevices > 0) { mMsg1 = std::make_shared( "HOLD A BUTTON ON YOUR GAMEPAD OR KEYBOARD TO CONFIGURE IT", Font::get(FONT_SIZE_SMALL), - 0x777777FF, ALIGN_CENTER); + mMenuColorPrimary, ALIGN_CENTER); } else { - mMsg1 = - std::make_shared("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT", - Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER); + mMsg1 = std::make_shared("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT", + Font::get(FONT_SIZE_SMALL), mMenuColorPrimary, + ALIGN_CENTER); } mGrid.setEntry(mMsg1, glm::ivec2 {0, 2}, false, true); const std::string msg2str {firstRun ? "PRESS ESC TO SKIP (OR F4 TO QUIT AT ANY TIME)" : "PRESS ESC TO CANCEL"}; - mMsg2 = std::make_shared(msg2str, Font::get(FONT_SIZE_SMALL), 0x777777FF, + mMsg2 = std::make_shared(msg2str, Font::get(FONT_SIZE_SMALL), mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mMsg2, glm::ivec2 {0, 3}, false, true); @@ -156,7 +157,8 @@ void GuiDetectDevice::update(int deltaTime) mHoldTime -= deltaTime; // Fade in device name. const float t {std::fabs((static_cast(mHoldTime) / HOLD_TIME) - 1.0f)}; - mDeviceHeld->setColor(0x44444400 | static_cast(t * 255.0f)); + mDeviceHeld->setColor(mMenuColorDetectDeviceHeld | + static_cast(t * 255.0f)); if (mHoldTime <= 0) { // A device was selected. mWindow->pushGui(new GuiInputConfig(mHoldingConfig, true, mDoneCallback)); diff --git a/es-core/src/guis/GuiInfoPopup.cpp b/es-core/src/guis/GuiInfoPopup.cpp index 2116cdf2f..51c5cc3f0 100644 --- a/es-core/src/guis/GuiInfoPopup.cpp +++ b/es-core/src/guis/GuiInfoPopup.cpp @@ -25,8 +25,8 @@ GuiInfoPopup::GuiInfoPopup(std::string message, int duration) float maxWidth {Renderer::getScreenWidth() * 0.9f}; float maxHeight {Renderer::getScreenHeight() * 0.2f}; - std::shared_ptr s { - std::make_shared("", Font::get(FONT_SIZE_MINI), 0x444444FF, ALIGN_CENTER)}; + std::shared_ptr s {std::make_shared( + "", Font::get(FONT_SIZE_MINI), mMenuColorPopupText, ALIGN_CENTER)}; // We do this to force the text container to resize and return the actual expected popup size. s->setSize(0.0f, 0.0f); @@ -115,7 +115,7 @@ bool GuiInfoPopup::updateState() mGrid->setOpacity(mAlpha); // Apply fade-in effect to popup frame. - mFrame->setEdgeColor(0xFFFFFF00 | static_cast(mAlpha * 255.0f)); - mFrame->setCenterColor(0xFFFFFF00 | static_cast(mAlpha * 255.0f)); + mFrame->setFrameColor((mMenuColorFrame & 0xFFFFFF00) | + static_cast(mAlpha * 255.0f)); return true; } diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index b6b587441..ab83951b1 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -53,8 +53,8 @@ GuiInputConfig::GuiInputConfig(InputConfig* target, // 0 is a spacer row. mGrid.setEntry(std::make_shared(), glm::ivec2 {0, 0}, false); - mTitle = std::make_shared("CONFIGURING", Font::get(FONT_SIZE_LARGE), 0x555555FF, - ALIGN_CENTER); + mTitle = std::make_shared("CONFIGURING", Font::get(FONT_SIZE_LARGE), + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mTitle, glm::ivec2 {0, 1}, false, true); std::stringstream ss; @@ -64,12 +64,14 @@ GuiInputConfig::GuiInputConfig(InputConfig* target, ss << "CEC"; else ss << "GAMEPAD " << (target->getDeviceId() + 1) << " (" << target->getDeviceName() << ")"; - mSubtitle1 = std::make_shared( - Utils::String::toUpper(ss.str()), Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); + mSubtitle1 = std::make_shared(Utils::String::toUpper(ss.str()), + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, + ALIGN_CENTER); mGrid.setEntry(mSubtitle1, glm::ivec2 {0, 2}, false, true); - mSubtitle2 = std::make_shared( - "HOLD ANY BUTTON 1 SECOND TO SKIP", Font::get(FONT_SIZE_SMALL), 0x999999FF, ALIGN_CENTER); + mSubtitle2 = std::make_shared("HOLD ANY BUTTON 1 SECOND TO SKIP", + Font::get(FONT_SIZE_SMALL), mMenuColorSecondary, + ALIGN_CENTER); // The opacity will be set to visible for any row that is skippable. mSubtitle2->setOpacity(0.0f); @@ -86,7 +88,7 @@ GuiInputConfig::GuiInputConfig(InputConfig* target, auto icon = std::make_shared(); icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 1.25f); icon->setImage(sGuiInputConfigList[i].icon); - icon->setColorShift(0x777777FF); + icon->setColorShift(mMenuColorPrimary); row.addElement(icon, false); // Spacer between icon and text. @@ -95,11 +97,12 @@ GuiInputConfig::GuiInputConfig(InputConfig* target, row.addElement(spacer, false); auto text = std::make_shared(sGuiInputConfigList[i].dispName, - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); row.addElement(text, true); - auto mapping = std::make_shared( - "-NOT DEFINED-", Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), 0x999999FF, ALIGN_RIGHT); + auto mapping = std::make_shared("-NOT DEFINED-", + Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), + mMenuColorSecondary, ALIGN_RIGHT); setNotDefined(mapping); // Overrides the text and color set above. row.addElement(mapping, true); mMappings.push_back(mapping); @@ -179,7 +182,7 @@ GuiInputConfig::GuiInputConfig(InputConfig* target, buttons.push_back( std::make_shared("OK", "ok", [okFunction] { okFunction(); })); - mButtonGrid = makeButtonGrid(buttons); + mButtonGrid = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 6}, true, false); // Adjust the width relative to the aspect ratio of the screen to make the GUI look coherent @@ -298,7 +301,7 @@ void GuiInputConfig::update(int deltaTime) std::stringstream ss; ss << "HOLD FOR " << HOLD_TO_SKIP_MS / 1000 - curSec << "S TO SKIP"; text->setText(ss.str()); - text->setColor(0x777777FF); + text->setColor(mMenuColorPrimary); } } } @@ -342,25 +345,25 @@ void GuiInputConfig::rowDone() void GuiInputConfig::error(const std::shared_ptr& text, const std::string& /*msg*/) { text->setText("ALREADY TAKEN"); - text->setColor(0x656565FF); + text->setColor(mMenuColorPrimary); } void GuiInputConfig::setPress(const std::shared_ptr& text) { text->setText("PRESS ANYTHING"); - text->setColor(0x656565FF); + text->setColor(mMenuColorPrimary); } void GuiInputConfig::setNotDefined(const std::shared_ptr& text) { text->setText("-NOT DEFINED-"); - text->setColor(0x999999FF); + text->setColor(mMenuColorSecondary); } void GuiInputConfig::setAssignedTo(const std::shared_ptr& text, Input input) { text->setText(Utils::String::toUpper(input.string())); - text->setColor(0x777777FF); + text->setColor(mMenuColorPrimary); } bool GuiInputConfig::assign(Input input, int inputId) diff --git a/es-core/src/guis/GuiMsgBox.cpp b/es-core/src/guis/GuiMsgBox.cpp index 418c181d7..478308f47 100644 --- a/es-core/src/guis/GuiMsgBox.cpp +++ b/es-core/src/guis/GuiMsgBox.cpp @@ -46,7 +46,7 @@ GuiMsgBox::GuiMsgBox(const HelpStyle& helpstyle, const float minWidth { floorf(glm::clamp(0.30f * aspectValue, 0.10f, 0.50f) * mRenderer->getScreenWidth())}; - mMsg = std::make_shared(text, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, + mMsg = std::make_shared(text, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_CENTER); mGrid.setEntry(mMsg, glm::ivec2 {0, 0}, false, false); @@ -75,7 +75,7 @@ GuiMsgBox::GuiMsgBox(const HelpStyle& helpstyle, } // Put the buttons into a ComponentGrid. - mButtonGrid = makeButtonGrid(mButtons); + mButtonGrid = MenuComponent::makeButtonGrid(mButtons); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 1}, true, false, glm::ivec2 {1, 1}, GridFlags::BORDER_TOP); diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 40b0702d8..356fadb28 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -114,8 +114,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( addChild(&mBackground); addChild(&mGrid); - mTitle = std::make_shared(Utils::String::toUpper(title), - Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); + mTitle = std::make_shared( + Utils::String::toUpper(title), Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER); std::vector> kbLayout; @@ -143,11 +143,11 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( if (mComplexMode) { mInfoString = std::make_shared(infoString, Font::get(FONT_SIZE_MEDIUM), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mInfoString, glm::ivec2 {0, yPos}, false, true); mDefaultValue = std::make_shared(defaultValue, Font::get(FONT_SIZE_SMALL), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mGrid.setEntry(mDefaultValue, glm::ivec2 {0, yPos + 1}, false, true); yPos += 2; } @@ -585,12 +585,12 @@ void GuiTextEditKeyboardPopup::shiftKeys() mShift = !mShift; if (mShift) { - mShiftButton->setFlatColorFocused(0xF26767FF); - mShiftButton->setFlatColorUnfocused(0xF26767FF); + mShiftButton->setFlatColorFocused(mMenuColorKeyboardModifier); + mShiftButton->setFlatColorUnfocused(mMenuColorKeyboardModifier); } else { - mShiftButton->setFlatColorFocused(0x878787FF); - mShiftButton->setFlatColorUnfocused(0x60606025); + mShiftButton->setFlatColorFocused(mMenuColorButtonFlatFocused); + mShiftButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused); } if (mAlt && mShift) { @@ -618,12 +618,12 @@ void GuiTextEditKeyboardPopup::altKeys() mAlt = !mAlt; if (mAlt) { - mAltButton->setFlatColorFocused(0xF26767FF); - mAltButton->setFlatColorUnfocused(0xF26767FF); + mAltButton->setFlatColorFocused(mMenuColorKeyboardModifier); + mAltButton->setFlatColorUnfocused(mMenuColorKeyboardModifier); } else { - mAltButton->setFlatColorFocused(0x878787FF); - mAltButton->setFlatColorUnfocused(0x60606025); + mAltButton->setFlatColorFocused(mMenuColorButtonFlatFocused); + mAltButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused); } if (mShift && mAlt) { diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index 85cdab4dd..cac2014f5 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -45,14 +45,14 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle, addChild(&mBackground); addChild(&mGrid); - mTitle = std::make_shared(Utils::String::toUpper(title), - Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); + mTitle = std::make_shared( + Utils::String::toUpper(title), Font::get(FONT_SIZE_MEDIUM), mMenuColorTitle, ALIGN_CENTER); if (mComplexMode) { mInfoString = std::make_shared(infoString, Font::get(FONT_SIZE_SMALL), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); mDefaultValue = std::make_shared(defaultValue, Font::get(FONT_SIZE_SMALL), - 0x555555FF, ALIGN_CENTER); + mMenuColorTitle, ALIGN_CENTER); } mText = std::make_shared(); @@ -79,7 +79,7 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle, buttons.push_back( std::make_shared("CANCEL", "discard changes", [this] { delete this; })); - mButtonGrid = makeButtonGrid(buttons); + mButtonGrid = MenuComponent::makeButtonGrid(buttons); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true); diff --git a/resources/graphics/arrow.svg b/resources/graphics/arrow.svg index 505356ade..11253f67b 100644 --- a/resources/graphics/arrow.svg +++ b/resources/graphics/arrow.svg @@ -1,4 +1,21 @@ - - - - + + + + + diff --git a/resources/graphics/busy_0.svg b/resources/graphics/busy_0.svg index 646e7c2ee..9126c580a 100644 --- a/resources/graphics/busy_0.svg +++ b/resources/graphics/busy_0.svg @@ -1,7 +1,48 @@ - - - - - - + + + + + + + diff --git a/resources/graphics/busy_1.svg b/resources/graphics/busy_1.svg index 19297c4e2..0fd938aa6 100644 --- a/resources/graphics/busy_1.svg +++ b/resources/graphics/busy_1.svg @@ -1,7 +1,48 @@ - - - - - - + + + + + + + diff --git a/resources/graphics/busy_2.svg b/resources/graphics/busy_2.svg index 31bff4e9a..5c60d42bc 100644 --- a/resources/graphics/busy_2.svg +++ b/resources/graphics/busy_2.svg @@ -1,7 +1,48 @@ - - - - - - + + + + + + + diff --git a/resources/graphics/busy_3.svg b/resources/graphics/busy_3.svg index 523efb627..0d7bb1d15 100644 --- a/resources/graphics/busy_3.svg +++ b/resources/graphics/busy_3.svg @@ -1,7 +1,48 @@ - - - - - - + + + + + + + diff --git a/resources/graphics/button.svg b/resources/graphics/button.svg index b70113cf1..46be54786 100644 --- a/resources/graphics/button.svg +++ b/resources/graphics/button.svg @@ -1,6 +1,16 @@ - - + + + + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.90893817;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="M 4.4345762,0.95447028 H 43.565423 c 1.927979,0 3.480107,1.55212772 3.480107,3.48010702 V 43.565424 c 0,1.927979 -1.552128,3.480107 -3.480107,3.480107 H 4.4345762 c -1.9279794,0 -3.48010712,-1.552128 -3.48010712,-3.480107 V 4.4345773 c 0,-1.9279793 1.55212772,-3.48010702 3.48010712,-3.48010702 z" + id="path2" /> diff --git a/resources/graphics/button_filled.svg b/resources/graphics/button_filled.svg index ab6e12ec9..be02cdacf 100644 --- a/resources/graphics/button_filled.svg +++ b/resources/graphics/button_filled.svg @@ -1,9 +1,20 @@ - - + + + + d="M 4.4345767,0.95446968 H 43.565423 c 1.92798,0 3.480107,1.55212772 3.480107,3.48010702 V 43.565423 c 0,1.92798 -1.552127,3.480107 -3.480107,3.480107 H 4.4345767 c -1.9279793,0 -3.48010702,-1.552127 -3.48010702,-3.480107 V 4.4345767 c 0,-1.9279793 1.55212772,-3.48010702 3.48010702,-3.48010702 z" + id="path2" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.909;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + id="path4" /> diff --git a/resources/graphics/checkbox_checked.svg b/resources/graphics/checkbox_checked.svg index 8d01a7dca..fa7dfd0c8 100644 --- a/resources/graphics/checkbox_checked.svg +++ b/resources/graphics/checkbox_checked.svg @@ -1,8 +1,24 @@ - - + + + + d="m12 2 h40 a10 10 90 0 1 10 10 v40 a10 10 90 0 1 -10 10 h-40 a10 10 90 0 1 -10 -10 v-40 a10 10 90 0 1 10 -10 z" + fill="none" + stroke="#777" + stroke-linejoin="round" + stroke-width="4" + id="path2" + style="stroke:#ffffff;stroke-opacity:1" /> + style="fill:#ffffff;stroke:none;stroke-width:1.36160743;fill-opacity:1" + id="path4" /> diff --git a/resources/graphics/checkbox_unchecked.svg b/resources/graphics/checkbox_unchecked.svg index 5808eb13d..b97159355 100644 --- a/resources/graphics/checkbox_unchecked.svg +++ b/resources/graphics/checkbox_unchecked.svg @@ -1,4 +1,20 @@ - - - + + + + diff --git a/resources/graphics/frame.svg b/resources/graphics/frame.svg index 82331d6b1..538b474cc 100644 --- a/resources/graphics/frame.svg +++ b/resources/graphics/frame.svg @@ -1,6 +1,16 @@ - - + + + + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.98800004;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="M 8.3579788,0 H 39.642021 C 44.272341,0 48,3.7276586 48,8.3579788 V 39.642021 C 48,44.272341 44.272341,48 39.642021,48 H 8.3579788 C 3.7276586,48 0,44.272341 0,39.642021 V 8.3579788 C 0,3.7276586 3.7276586,0 8.3579788,0 Z" + id="path2" /> diff --git a/resources/graphics/off.svg b/resources/graphics/off.svg index e7730bf15..44b9db3bc 100644 --- a/resources/graphics/off.svg +++ b/resources/graphics/off.svg @@ -1,6 +1,16 @@ - - + + + + style="fill:#ffffff;fill-opacity:1;stroke-width:0.74354357" + d="M 10.491203,0.17871838 C 4.9585292,0.17871839 0.45799999,5.0240707 0.45799999,10.979499 c 0,5.95543 4.50053021,10.800782 10.03320301,10.800782 h 22.933594 c 5.53267,0 10.033203,-4.845352 10.033203,-10.800782 0,-5.9554283 -4.500533,-10.80078062 -10.033203,-10.80078062 z m 0,3.08593752 c 3.951701,0 7.166015,3.4611877 7.166015,7.7148431 0,4.253654 -3.214314,7.714844 -7.166015,7.714844 -3.9517019,0 -7.1660155,-3.46119 -7.1660155,-7.714844 0,-4.2536554 3.2143137,-7.7148431 7.1660155,-7.7148431 z m 0,1.5429688 c -3.1612188,0 -5.7343748,2.7691042 -5.7343748,6.1718743 -1e-7,3.402769 2.5731559,6.171875 5.7343748,6.171875 3.161215,0 5.732422,-2.769106 5.732422,-6.171875 0,-3.4027701 -2.571207,-6.1718743 -5.732422,-6.1718743 z" + id="path2" /> diff --git a/resources/graphics/on.svg b/resources/graphics/on.svg index 9e8b2507f..1e83f9c89 100644 --- a/resources/graphics/on.svg +++ b/resources/graphics/on.svg @@ -1,6 +1,16 @@ - - + + + + style="fill:#ffffff;fill-opacity:1;stroke-width:0.74354357" + id="path2" /> diff --git a/resources/graphics/option_arrow.svg b/resources/graphics/option_arrow.svg index 3027a4bc9..be588613b 100644 --- a/resources/graphics/option_arrow.svg +++ b/resources/graphics/option_arrow.svg @@ -1,4 +1,20 @@ - - - - + + + + + diff --git a/resources/graphics/scroll_down.svg b/resources/graphics/scroll_down.svg index 26a4b7a63..776d781c6 100644 --- a/resources/graphics/scroll_down.svg +++ b/resources/graphics/scroll_down.svg @@ -26,9 +26,9 @@ + style="fill:none;stroke:#ffffff;stroke-width:4.34399986;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:4.34399986;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> diff --git a/resources/graphics/scroll_up.svg b/resources/graphics/scroll_up.svg index cf3cbed1e..354594b4b 100644 --- a/resources/graphics/scroll_up.svg +++ b/resources/graphics/scroll_up.svg @@ -26,9 +26,9 @@ + style="fill:none;stroke:#fefefe;stroke-width:4.34399986;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;stroke:#fefefe;stroke-width:4.34399986;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> diff --git a/resources/graphics/slider_knob.svg b/resources/graphics/slider_knob.svg index 6600ecb6c..06349c511 100644 --- a/resources/graphics/slider_knob.svg +++ b/resources/graphics/slider_knob.svg @@ -1,4 +1,19 @@ - - - + + + + diff --git a/resources/graphics/slider_knob_disabled.svg b/resources/graphics/slider_knob_disabled.svg deleted file mode 100644 index 968eafa19..000000000 --- a/resources/graphics/slider_knob_disabled.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/resources/graphics/star_filled.svg b/resources/graphics/star_filled.svg index d938e3204..4ee940db4 100644 --- a/resources/graphics/star_filled.svg +++ b/resources/graphics/star_filled.svg @@ -15,5 +15,6 @@ stroke="#777777" stroke-linejoin="round" stroke-width="4" - id="path2" /> + id="path2" + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;fill-rule:nonzero" /> diff --git a/resources/graphics/star_unfilled.svg b/resources/graphics/star_unfilled.svg index 168faf882..36bf30739 100644 --- a/resources/graphics/star_unfilled.svg +++ b/resources/graphics/star_unfilled.svg @@ -15,5 +15,6 @@ stroke="#777777" stroke-linejoin="round" stroke-width="4" - id="path2" /> + id="path2" + style="stroke:#fefefe;stroke-opacity:1" />