Added support for changing between light and dark color schemes for the menu system

This commit is contained in:
Leon Styhre 2023-05-07 22:56:24 +02:00
parent fa0a64caa6
commit b6d17810be
66 changed files with 908 additions and 454 deletions

View file

@ -41,7 +41,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators()
std::string name {(*it)->getName()}; std::string name {(*it)->getName()};
std::shared_ptr<TextComponent> systemText { std::shared_ptr<TextComponent> systemText {
std::make_shared<TextComponent>(name, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; std::make_shared<TextComponent>(name, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
systemText->setSize(systemSizeX, systemText->getSize().y); systemText->setSize(systemSizeX, systemText->getSize().y);
row.addElement(systemText, false); row.addElement(systemText, false);
@ -71,19 +71,20 @@ GuiAlternativeEmulators::GuiAlternativeEmulators()
std::shared_ptr<TextComponent> labelText; std::shared_ptr<TextComponent> labelText;
if (label == (*it)->getSystemEnvData()->mLaunchCommands.front().second) { if (label == (*it)->getSystemEnvData()->mLaunchCommands.front().second) {
labelText = std::make_shared<TextComponent>( labelText =
label, Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); std::make_shared<TextComponent>(label, Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT),
mMenuColorPrimary, ALIGN_RIGHT);
} }
else { else {
// Mark any non-default value with bold and add a gear symbol as well. // Mark any non-default value with bold and add a gear symbol as well.
labelText = std::make_shared<TextComponent>( labelText = std::make_shared<TextComponent>(
label + (!invalidEntry ? " " + ViewController::GEAR_CHAR : ""), 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. // Mark invalid entries with red color.
if (invalidEntry) if (invalidEntry)
labelText->setColor(TEXTCOLOR_SCRAPERMARKED); labelText->setColor(mMenuColorRed);
mCommandRows[name] = labelText; mCommandRows[name] = labelText;
labelText->setSize(mMenu.getSize().x - systemSizeX - labelText->setSize(mMenu.getSize().x - systemSizeX -
@ -111,7 +112,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators()
ComponentListRow row; ComponentListRow row;
std::shared_ptr<TextComponent> systemText {std::make_shared<TextComponent>( std::shared_ptr<TextComponent> systemText {std::make_shared<TextComponent>(
ViewController::EXCLAMATION_CHAR + " NO ALTERNATIVE EMULATORS DEFINED", 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); row.addElement(systemText, true);
mMenu.addRow(row); 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()->setValue(label + " " + ViewController::GEAR_CHAR);
} }
mCommandRows[systemName].get()->setColor(DEFAULT_TEXTCOLOR); mCommandRows[systemName].get()->setColor(mMenuColorPrimary);
} }
void GuiAlternativeEmulators::selectorWindow(SystemData* system) void GuiAlternativeEmulators::selectorWindow(SystemData* system)
@ -154,7 +155,7 @@ void GuiAlternativeEmulators::selectorWindow(SystemData* system)
label = entry.second; label = entry.second;
std::shared_ptr<TextComponent> labelText = std::make_shared<TextComponent>( std::shared_ptr<TextComponent> labelText = std::make_shared<TextComponent>(
label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_LEFT); label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_LEFT);
labelText->setSelectable(true); labelText->setSelectable(true);
if (system->getSystemEnvData()->mLaunchCommands.front().second == label) if (system->getSystemEnvData()->mLaunchCommands.front().second == label)

View file

@ -34,7 +34,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
Utils::String::toUpper( Utils::String::toUpper(
CollectionSystemsManager::getInstance()->getEditingCollection()) + CollectionSystemsManager::getInstance()->getEditingCollection()) +
"' COLLECTION", "' COLLECTION",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
row.makeAcceptInputHandler([this] { row.makeAcceptInputHandler([this] {
CollectionSystemsManager::getInstance()->exitEditMode(); CollectionSystemsManager::getInstance()->exitEditMode();
@ -165,8 +165,9 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
CollectionSystemsManager::getInstance()->getUnusedSystemsFromTheme()}; CollectionSystemsManager::getInstance()->getUnusedSystemsFromTheme()};
if (unusedFolders.size() > 0) { if (unusedFolders.size() > 0) {
ComponentListRow row; ComponentListRow row;
auto themeCollection = std::make_shared<TextComponent>( auto themeCollection =
"CREATE NEW CUSTOM COLLECTION FROM THEME", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); std::make_shared<TextComponent>("CREATE NEW CUSTOM COLLECTION FROM THEME",
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
auto bracketThemeCollection = std::make_shared<ImageComponent>(); auto bracketThemeCollection = std::make_shared<ImageComponent>();
bracketThemeCollection->setResize( bracketThemeCollection->setResize(
glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()});
@ -186,7 +187,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
[this, name] { createCustomCollection(name); }}; [this, name] { createCustomCollection(name); }};
row.makeAcceptInputHandler(createCollectionCall); row.makeAcceptInputHandler(createCollectionCall);
auto themeFolder = std::make_shared<TextComponent>( auto themeFolder = std::make_shared<TextComponent>(
Utils::String::toUpper(name), Font::get(FONT_SIZE_SMALL), 0x777777FF); Utils::String::toUpper(name), Font::get(FONT_SIZE_SMALL), mMenuColorPrimary);
themeFolder->setSelectable(true); themeFolder->setSelectable(true);
row.addElement(themeFolder, true); row.addElement(themeFolder, true);
ss->addRow(row); ss->addRow(row);
@ -198,12 +199,13 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
// Create new custom collection. // Create new custom collection.
ComponentListRow row; ComponentListRow row;
auto newCollection = std::make_shared<TextComponent>("CREATE NEW CUSTOM COLLECTION", auto newCollection = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "CREATE NEW CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
auto bracketNewCollection = std::make_shared<ImageComponent>(); auto bracketNewCollection = std::make_shared<ImageComponent>();
bracketNewCollection->setResize( bracketNewCollection->setResize(
glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()});
bracketNewCollection->setImage(":/graphics/arrow.svg"); bracketNewCollection->setImage(":/graphics/arrow.svg");
bracketNewCollection->setColorShift(mMenuColorPrimary);
row.addElement(newCollection, true); row.addElement(newCollection, true);
row.addElement(bracketNewCollection, false); row.addElement(bracketNewCollection, false);
auto createCollectionCall = [this](const std::string& newVal) { auto createCollectionCall = [this](const std::string& newVal) {
@ -237,11 +239,12 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
// Delete custom collection. // Delete custom collection.
row.elements.clear(); row.elements.clear();
auto deleteCollection = std::make_shared<TextComponent>( auto deleteCollection = std::make_shared<TextComponent>(
"DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
auto bracketDeleteCollection = std::make_shared<ImageComponent>(); auto bracketDeleteCollection = std::make_shared<ImageComponent>();
bracketDeleteCollection->setResize( bracketDeleteCollection->setResize(
glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()});
bracketDeleteCollection->setImage(":/graphics/arrow.svg"); bracketDeleteCollection->setImage(":/graphics/arrow.svg");
bracketDeleteCollection->setColorShift(mMenuColorPrimary);
row.addElement(deleteCollection, true); row.addElement(deleteCollection, true);
row.addElement(bracketDeleteCollection, false); row.addElement(bracketDeleteCollection, false);
row.makeAcceptInputHandler([this, customSystems] { row.makeAcceptInputHandler([this, customSystems] {
@ -299,7 +302,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title)
}; };
row.makeAcceptInputHandler(deleteCollectionCall); row.makeAcceptInputHandler(deleteCollectionCall);
auto customCollection = std::make_shared<TextComponent>( auto customCollection = std::make_shared<TextComponent>(
Utils::String::toUpper(name), Font::get(FONT_SIZE_MEDIUM), 0x777777FF); Utils::String::toUpper(name), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
customCollection->setSelectable(true); customCollection->setSelectable(true);
row.addElement(customCollection, true); row.addElement(customCollection, true);
ss->addRow(row); ss->addRow(row);

View file

@ -40,7 +40,7 @@ void GuiGamelistFilter::initializeMenu()
// Show filtered menu. // Show filtered menu.
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("RESET ALL FILTERS", Font::get(FONT_SIZE_MEDIUM), row.addElement(std::make_shared<TextComponent>("RESET ALL FILTERS", Font::get(FONT_SIZE_MEDIUM),
0x777777FF), mMenuColorPrimary),
true); true);
row.makeAcceptInputHandler(std::bind(&GuiGamelistFilter::resetAllFilters, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistFilter::resetAllFilters, this));
mMenu.addRow(row); mMenu.addRow(row);
@ -88,10 +88,10 @@ void GuiGamelistFilter::addFiltersToMenu()
auto lbl = std::make_shared<TextComponent>( auto lbl = std::make_shared<TextComponent>(
Utils::String::toUpper(ViewController::KEYBOARD_CHAR + " GAME NAME"), Utils::String::toUpper(ViewController::KEYBOARD_CHAR + " GAME NAME"),
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
mTextFilterField = mTextFilterField = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MEDIUM),
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); mMenuColorPrimary, ALIGN_RIGHT);
// Don't show the free text filter entry unless there are any games in the system. // Don't show the free text filter entry unless there are any games in the system.
if (mSystem->getRootFolder()->getChildren().size() > 0) { if (mSystem->getRootFolder()->getChildren().size() > 0) {
@ -105,6 +105,7 @@ void GuiGamelistFilter::addFiltersToMenu()
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
mTextFilterField->setValue(mFilterIndex->getTextFilter()); mTextFilterField->setValue(mFilterIndex->getTextFilter());

View file

@ -157,10 +157,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) { if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) { if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("FILTER GAMELIST", row.addElement(std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), "FILTER GAMELIST", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
row.addElement(makeArrow(), false); row.addElement(mMenu.makeArrow(), false);
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this));
mMenu.addRow(row); mMenu.addRow(row);
} }
@ -171,7 +171,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
!mIsCustomCollection) { !mIsCustomCollection) {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("THIS SYSTEM HAS NO GAMES", row.addElement(std::make_shared<TextComponent>("THIS SYSTEM HAS NO GAMES",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
mMenu.addRow(row); mMenu.addRow(row);
} }
@ -182,7 +183,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
getGamelist()->getCursor()->getSystem()->getName()) { getGamelist()->getCursor()->getSystem()->getName()) {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("ADD/REMOVE GAMES TO THIS COLLECTION", row.addElement(std::make_shared<TextComponent>("ADD/REMOVE GAMES TO THIS COLLECTION",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::startEditMode, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::startEditMode, this));
mMenu.addRow(row); mMenu.addRow(row);
@ -198,7 +200,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
Utils::String::toUpper( Utils::String::toUpper(
CollectionSystemsManager::getInstance()->getEditingCollection()) + CollectionSystemsManager::getInstance()->getEditingCollection()) +
"' COLLECTION", "' COLLECTION",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::exitEditMode, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::exitEditMode, this));
mMenu.addRow(row); mMenu.addRow(row);
@ -209,9 +211,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
!(mSystem->isCollection() && file->getType() == FOLDER)) { !(mSystem->isCollection() && file->getType() == FOLDER)) {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("EDIT THIS FOLDER'S METADATA", row.addElement(std::make_shared<TextComponent>("EDIT THIS FOLDER'S METADATA",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
row.addElement(makeArrow(), false); row.addElement(mMenu.makeArrow(), false);
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this));
mMenu.addRow(row); mMenu.addRow(row);
} }
@ -221,9 +224,10 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
!(mSystem->isCollection() && file->getType() == FOLDER)) { !(mSystem->isCollection() && file->getType() == FOLDER)) {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("EDIT THIS GAME'S METADATA", row.addElement(std::make_shared<TextComponent>("EDIT THIS GAME'S METADATA",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
row.addElement(makeArrow(), false); row.addElement(mMenu.makeArrow(), false);
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this)); row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openMetaDataEd, this));
mMenu.addRow(row); mMenu.addRow(row);
} }
@ -232,7 +236,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
if (file->getType() == FOLDER && file->metadata.get("folderlink") != "") { if (file->getType() == FOLDER && file->metadata.get("folderlink") != "") {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("ENTER FOLDER (OVERRIDE FOLDER LINK)", row.addElement(std::make_shared<TextComponent>("ENTER FOLDER (OVERRIDE FOLDER LINK)",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
row.makeAcceptInputHandler([this, file] { row.makeAcceptInputHandler([this, file] {
mFolderLinkOverride = true; mFolderLinkOverride = true;

View file

@ -57,7 +57,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
"LAUNCHING GAME", "LAUNCHING GAME",
Font::get(titleFontSize * Font::get(titleFontSize *
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())), 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}); mGrid->setEntry(mTitle, glm::ivec2 {1, 1}, false, true, glm::ivec2 {1, 1});
// Spacer row. // Spacer row.
@ -77,12 +77,12 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
"GAME NAME", "GAME NAME",
Font::get(gameNameFontSize * Font::get(gameNameFontSize *
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())), 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}); mGrid->setEntry(mGameName, glm::ivec2 {1, 5}, false, true, glm::ivec2 {1, 1});
// System name. // System name.
mSystemName = std::make_shared<TextComponent>("SYSTEM NAME", Font::get(FONT_SIZE_MEDIUM), mSystemName = std::make_shared<TextComponent>("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}); mGrid->setEntry(mSystemName, glm::ivec2 {1, 6}, false, true, glm::ivec2 {1, 1});
// Spacer row. // Spacer row.
@ -193,7 +193,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
setPosition(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.25f); setPosition(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.25f);
mBackground.fitTo(mSize); mBackground.fitTo(mSize);
mBackground.setEdgeColor(0xEEEEEEFF); mBackground.setFrameColor(mMenuColorFrameLaunchScreen);
} }
void GuiLaunchScreen::closeLaunchScreen() void GuiLaunchScreen::closeLaunchScreen()

View file

@ -44,35 +44,36 @@ GuiMenu::GuiMenu()
: mRenderer {Renderer::getInstance()} : mRenderer {Renderer::getInstance()}
, mMenu {"MAIN MENU"} , mMenu {"MAIN MENU"}
{ {
bool isFullUI {UIModeController::getInstance()->isUIModeFull()}; const bool isFullUI {UIModeController::getInstance()->isUIModeFull()};
if (isFullUI) if (isFullUI)
addEntry("SCRAPER", 0x777777FF, true, [this] { openScraperOptions(); }); addEntry("SCRAPER", mMenuColorPrimary, true, [this] { openScraperOptions(); });
if (isFullUI) 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) if (isFullUI)
addEntry("INPUT DEVICE SETTINGS", 0x777777FF, true, [this] { openInputDeviceOptions(); }); addEntry("INPUT DEVICE SETTINGS", mMenuColorPrimary, true,
[this] { openInputDeviceOptions(); });
if (isFullUI) if (isFullUI)
addEntry("GAME COLLECTION SETTINGS", 0x777777FF, true, addEntry("GAME COLLECTION SETTINGS", mMenuColorPrimary, true,
[this] { openCollectionSystemOptions(); }); [this] { openCollectionSystemOptions(); });
if (isFullUI) if (isFullUI)
addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); }); addEntry("OTHER SETTINGS", mMenuColorPrimary, true, [this] { openOtherOptions(); });
if (!Settings::getInstance()->getBool("ForceKiosk") && if (!Settings::getInstance()->getBool("ForceKiosk") &&
Settings::getInstance()->getString("UIMode") != "kiosk") { Settings::getInstance()->getString("UIMode") != "kiosk") {
#if defined(__APPLE__) #if defined(__APPLE__)
addEntry("QUIT EMULATIONSTATION", 0x777777FF, false, [this] { openQuitMenu(); }); addEntry("QUIT EMULATIONSTATION", mMenuColorPrimary, false, [this] { openQuitMenu(); });
#else #else
if (Settings::getInstance()->getBool("ShowQuitMenu")) if (Settings::getInstance()->getBool("ShowQuitMenu"))
addEntry("QUIT", 0x777777FF, true, [this] { openQuitMenu(); }); addEntry("QUIT", mMenuColorPrimary, true, [this] { openQuitMenu(); });
else else
addEntry("QUIT EMULATIONSTATION", 0x777777FF, false, [this] { openQuitMenu(); }); addEntry("QUIT EMULATIONSTATION", mMenuColorPrimary, false, [this] { openQuitMenu(); });
#endif #endif
} }
@ -117,9 +118,9 @@ void GuiMenu::openUIOptions()
themeDownloaderInputRow.elements.clear(); themeDownloaderInputRow.elements.clear();
themeDownloaderInputRow.addElement(std::make_shared<TextComponent>("THEME DOWNLOADER", themeDownloaderInputRow.addElement(std::make_shared<TextComponent>("THEME DOWNLOADER",
Font::get(FONT_SIZE_MEDIUM), Font::get(FONT_SIZE_MEDIUM),
0x777777FF), mMenuColorPrimary),
true); true);
themeDownloaderInputRow.addElement(makeArrow(), false); themeDownloaderInputRow.addElement(mMenu.makeArrow(), false);
themeDownloaderInputRow.makeAcceptInputHandler( themeDownloaderInputRow.makeAcceptInputHandler(
std::bind(&GuiMenu::openThemeDownloader, this, s)); std::bind(&GuiMenu::openThemeDownloader, this, s));
@ -565,6 +566,27 @@ void GuiMenu::openUIOptions()
} }
}); });
// Menu color scheme.
auto menuColorScheme = std::make_shared<OptionListComponent<std::string>>(
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. // Open menu effect.
auto menuOpeningEffect = std::make_shared<OptionListComponent<std::string>>( auto menuOpeningEffect = std::make_shared<OptionListComponent<std::string>>(
getHelpStyle(), "MENU OPENING EFFECT", false); getHelpStyle(), "MENU OPENING EFFECT", false);
@ -721,20 +743,22 @@ void GuiMenu::openUIOptions()
// Media viewer. // Media viewer.
ComponentListRow mediaViewerRow; ComponentListRow mediaViewerRow;
mediaViewerRow.elements.clear(); mediaViewerRow.elements.clear();
mediaViewerRow.addElement(std::make_shared<TextComponent>( mediaViewerRow.addElement(std::make_shared<TextComponent>("MEDIA VIEWER SETTINGS",
"MEDIA VIEWER SETTINGS", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
mediaViewerRow.addElement(makeArrow(), false); mediaViewerRow.addElement(mMenu.makeArrow(), false);
mediaViewerRow.makeAcceptInputHandler(std::bind(&GuiMenu::openMediaViewerOptions, this)); mediaViewerRow.makeAcceptInputHandler(std::bind(&GuiMenu::openMediaViewerOptions, this));
s->addRow(mediaViewerRow); s->addRow(mediaViewerRow);
// Screensaver. // Screensaver.
ComponentListRow screensaverRow; ComponentListRow screensaverRow;
screensaverRow.elements.clear(); screensaverRow.elements.clear();
screensaverRow.addElement(std::make_shared<TextComponent>( screensaverRow.addElement(std::make_shared<TextComponent>("SCREENSAVER SETTINGS",
"SCREENSAVER SETTINGS", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
screensaverRow.addElement(makeArrow(), false); screensaverRow.addElement(mMenu.makeArrow(), false);
screensaverRow.makeAcceptInputHandler(std::bind(&GuiMenu::openScreensaverOptions, this)); screensaverRow.makeAcceptInputHandler(std::bind(&GuiMenu::openScreensaverOptions, this));
s->addRow(screensaverRow); s->addRow(screensaverRow);
@ -1203,9 +1227,9 @@ void GuiMenu::openInputDeviceOptions()
configureInputRow.elements.clear(); configureInputRow.elements.clear();
configureInputRow.addElement( configureInputRow.addElement(
std::make_shared<TextComponent>("CONFIGURE KEYBOARD AND CONTROLLERS", std::make_shared<TextComponent>("CONFIGURE KEYBOARD AND CONTROLLERS",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
configureInputRow.addElement(makeArrow(), false); configureInputRow.addElement(mMenu.makeArrow(), false);
configureInputRow.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this, s)); configureInputRow.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this, s));
s->addRow(configureInputRow); s->addRow(configureInputRow);
@ -1254,21 +1278,22 @@ void GuiMenu::openOtherOptions()
alternativeEmulatorsRow.elements.clear(); alternativeEmulatorsRow.elements.clear();
alternativeEmulatorsRow.addElement(std::make_shared<TextComponent>("ALTERNATIVE EMULATORS", alternativeEmulatorsRow.addElement(std::make_shared<TextComponent>("ALTERNATIVE EMULATORS",
Font::get(FONT_SIZE_MEDIUM), Font::get(FONT_SIZE_MEDIUM),
0x777777FF), mMenuColorPrimary),
true); true);
alternativeEmulatorsRow.addElement(makeArrow(), false); alternativeEmulatorsRow.addElement(mMenu.makeArrow(), false);
alternativeEmulatorsRow.makeAcceptInputHandler( alternativeEmulatorsRow.makeAcceptInputHandler(
std::bind([this] { mWindow->pushGui(new GuiAlternativeEmulators); })); std::bind([this] { mWindow->pushGui(new GuiAlternativeEmulators); }));
s->addRow(alternativeEmulatorsRow); s->addRow(alternativeEmulatorsRow);
// Game media directory. // Game media directory.
ComponentListRow rowMediaDir; ComponentListRow rowMediaDir;
auto mediaDirectory = std::make_shared<TextComponent>("GAME MEDIA DIRECTORY", auto mediaDirectory = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "GAME MEDIA DIRECTORY", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
auto bracketMediaDirectory = std::make_shared<ImageComponent>(); auto bracketMediaDirectory = std::make_shared<ImageComponent>();
bracketMediaDirectory->setResize( bracketMediaDirectory->setResize(
glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()});
bracketMediaDirectory->setImage(":/graphics/arrow.svg"); bracketMediaDirectory->setImage(":/graphics/arrow.svg");
bracketMediaDirectory->setColorShift(mMenuColorPrimary);
rowMediaDir.addElement(mediaDirectory, true); rowMediaDir.addElement(mediaDirectory, true);
rowMediaDir.addElement(bracketMediaDirectory, false); rowMediaDir.addElement(bracketMediaDirectory, false);
std::string titleMediaDir {"ENTER GAME MEDIA DIRECTORY"}; std::string titleMediaDir {"ENTER GAME MEDIA DIRECTORY"};
@ -1730,8 +1755,8 @@ void GuiMenu::openQuitMenu()
}, },
"NO", nullptr)); "NO", nullptr));
}); });
auto quitText = std::make_shared<TextComponent>("QUIT EMULATIONSTATION", auto quitText = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "QUIT EMULATIONSTATION", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
quitText->setSelectable(true); quitText->setSelectable(true);
row.addElement(quitText, true); row.addElement(quitText, true);
s->addRow(row); s->addRow(row);
@ -1747,8 +1772,8 @@ void GuiMenu::openQuitMenu()
}, },
"NO", nullptr)); "NO", nullptr));
}); });
auto rebootText = std::make_shared<TextComponent>("REBOOT SYSTEM", auto rebootText = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "REBOOT SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
rebootText->setSelectable(true); rebootText->setSelectable(true);
row.addElement(rebootText, true); row.addElement(rebootText, true);
s->addRow(row); s->addRow(row);
@ -1765,7 +1790,7 @@ void GuiMenu::openQuitMenu()
"NO", nullptr)); "NO", nullptr));
}); });
auto powerOffText = std::make_shared<TextComponent>( auto powerOffText = std::make_shared<TextComponent>(
"POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); "POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
powerOffText->setSelectable(true); powerOffText->setSelectable(true);
row.addElement(powerOffText, true); row.addElement(powerOffText, true);
s->addRow(row); s->addRow(row);
@ -1778,7 +1803,7 @@ void GuiMenu::openQuitMenu()
void GuiMenu::addVersionInfo() void GuiMenu::addVersionInfo()
{ {
mVersion.setFont(Font::get(FONT_SIZE_SMALL)); mVersion.setFont(Font::get(FONT_SIZE_SMALL));
mVersion.setColor(0x5E5E5EFF); mVersion.setColor(mMenuColorTertiary);
#if defined(IS_PRERELEASE) #if defined(IS_PRERELEASE)
mVersion.setText("EMULATIONSTATION-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + 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<TextComponent>(name, font, color), true); row.addElement(std::make_shared<TextComponent>(name, font, color), true);
if (add_arrow) { if (add_arrow) {
std::shared_ptr<ImageComponent> bracket {makeArrow()}; std::shared_ptr<ImageComponent> bracket {mMenu.makeArrow()};
row.addElement(bracket, false); row.addElement(bracket, false);
} }

View file

@ -71,7 +71,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
addChild(&mGrid); addChild(&mGrid);
mTitle = std::make_shared<TextComponent>("EDIT METADATA", Font::get(FONT_SIZE_LARGE), mTitle = std::make_shared<TextComponent>("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}); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
// Extract possible subfolders from the path. // Extract possible subfolders from the path.
@ -93,7 +93,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
folderPath + Utils::FileSystem::getFileName(scraperParams.game->getPath()) + " [" + folderPath + Utils::FileSystem::getFileName(scraperParams.game->getPath()) + " [" +
Utils::String::toUpper(scraperParams.system->getName()) + "]" + Utils::String::toUpper(scraperParams.system->getName()) + "]" +
(scraperParams.game->getType() == FOLDER ? " " + ViewController::FOLDER_CHAR : ""), (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}); 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") && if (!Settings::getInstance()->getBool("AlternativeEmulatorPerGame") &&
it->type == MD_ALT_EMULATOR) { it->type == MD_ALT_EMULATOR) {
ed = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), ed = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT),
0x777777FF, ALIGN_RIGHT); mMenuColorPrimary, ALIGN_RIGHT);
assert(ed); assert(ed);
ed->setValue(mMetaData->get(it->key)); ed->setValue(mMetaData->get(it->key));
mEditors.push_back(ed); 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. // always looks for the help prompt at the back of the element stack.
ComponentListRow row; ComponentListRow row;
auto lbl = std::make_shared<TextComponent>(Utils::String::toUpper(it->displayName), auto lbl = std::make_shared<TextComponent>(Utils::String::toUpper(it->displayName),
Font::get(FONT_SIZE_SMALL), 0x777777FF); Font::get(FONT_SIZE_SMALL), mMenuColorPrimary);
row.addElement(lbl, true); // Label. row.addElement(lbl, true); // Label.
switch (it->type) { switch (it->type) {
@ -155,8 +155,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
ed = std::make_shared<SwitchComponent>(); ed = std::make_shared<SwitchComponent>();
// Make the switches slightly smaller. // Make the switches slightly smaller.
ed->setSize(glm::ceil(ed->getSize() * 0.9f)); ed->setSize(glm::ceil(ed->getSize() * 0.9f));
ed->setChangedColor(mMenuColorBlue);
ed->setChangedColor(ICONCOLOR_USERMARKED);
row.addElement(ed, false, true); row.addElement(ed, false, true);
break; break;
} }
@ -166,7 +165,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
row.addElement(spacer, false); row.addElement(spacer, false);
ed = std::make_shared<RatingComponent>(true, true); ed = std::make_shared<RatingComponent>(true, true);
ed->setChangedColor(ICONCOLOR_USERMARKED); ed->setChangedColor(mMenuColorBlue);
const float height {lbl->getSize().y * 0.71f}; const float height {lbl->getSize().y * 0.71f};
ed->setSize(0.0f, height); ed->setSize(0.0f, height);
row.addElement(ed, false, true); row.addElement(ed, false, true);
@ -182,8 +181,8 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
row.addElement(spacer, false); row.addElement(spacer, false);
ed = std::make_shared<DateTimeEditComponent>(true); ed = std::make_shared<DateTimeEditComponent>(true);
ed->setOriginalColor(DEFAULT_TEXTCOLOR); ed->setOriginalColor(mMenuColorPrimary);
ed->setChangedColor(TEXTCOLOR_USERMARKED); ed->setChangedColor(mMenuColorBlue);
row.addElement(ed, false); row.addElement(ed, false);
// Pass input to the actual DateTimeEditComponent instead of the spacer. // Pass input to the actual DateTimeEditComponent instead of the spacer.
@ -192,8 +191,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
break; break;
} }
case MD_CONTROLLER: { case MD_CONTROLLER: {
ed = std::make_shared<TextComponent>( ed =
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT),
mMenuColorPrimary, ALIGN_RIGHT);
row.addElement(ed, true); row.addElement(ed, true);
auto spacer = std::make_shared<GuiComponent>(); auto spacer = std::make_shared<GuiComponent>();
@ -203,6 +203,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
const std::string title {it->displayPrompt}; const std::string title {it->displayPrompt};
@ -211,9 +212,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
auto updateVal = [ed, originalValue](const std::string& newVal) { auto updateVal = [ed, originalValue](const std::string& newVal) {
ed->setValue(newVal); ed->setValue(newVal);
if (newVal == BadgeComponent::getDisplayName(originalValue)) if (newVal == BadgeComponent::getDisplayName(originalValue))
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
else else
ed->setColor(TEXTCOLOR_USERMARKED); ed->setColor(mMenuColorBlue);
}; };
row.makeAcceptInputHandler([this, title, ed, updateVal] { row.makeAcceptInputHandler([this, title, ed, updateVal] {
@ -225,7 +226,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
ComponentListRow row; ComponentListRow row;
std::shared_ptr<TextComponent> labelText {std::make_shared<TextComponent>( std::shared_ptr<TextComponent> labelText {std::make_shared<TextComponent>(
label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
labelText->setSelectable(true); labelText->setSelectable(true);
labelText->setValue(controller.displayName); labelText->setValue(controller.displayName);
@ -250,7 +251,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
ComponentListRow row; ComponentListRow row;
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>( std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY", ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
clearText->setSelectable(true); clearText->setSelectable(true);
row.addElement(clearText, true); row.addElement(clearText, true);
row.makeAcceptInputHandler([s, ed] { row.makeAcceptInputHandler([s, ed] {
@ -276,8 +277,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
case MD_ALT_EMULATOR: { case MD_ALT_EMULATOR: {
mInvalidEmulatorEntry = false; mInvalidEmulatorEntry = false;
ed = std::make_shared<TextComponent>( ed =
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT),
mMenuColorPrimary, ALIGN_RIGHT);
row.addElement(ed, true); row.addElement(ed, true);
auto spacer = std::make_shared<GuiComponent>(); auto spacer = std::make_shared<GuiComponent>();
@ -287,6 +289,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
const std::string title {mRenderer->getIsVerticalOrientation() ? "select emulator" : 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) { auto updateVal = [this, ed, originalValue](const std::string& newVal) {
ed->setValue(newVal); ed->setValue(newVal);
if (newVal == originalValue) { if (newVal == originalValue) {
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
} }
else { else {
ed->setColor(TEXTCOLOR_USERMARKED); ed->setColor(mMenuColorBlue);
mInvalidEmulatorEntry = false; mInvalidEmulatorEntry = false;
} }
}; };
@ -361,7 +364,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
std::shared_ptr<TextComponent> labelText { std::shared_ptr<TextComponent> labelText {
std::make_shared<TextComponent>(label, Font::get(FONT_SIZE_MEDIUM), std::make_shared<TextComponent>(label, Font::get(FONT_SIZE_MEDIUM),
0x777777FF)}; mMenuColorPrimary)};
labelText->setSelectable(true); labelText->setSelectable(true);
if (scraperParams.system->getAlternativeEmulator() == "" && if (scraperParams.system->getAlternativeEmulator() == "" &&
@ -414,8 +417,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
break; break;
} }
case MD_FOLDER_LINK: { case MD_FOLDER_LINK: {
ed = std::make_shared<TextComponent>( ed =
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT),
mMenuColorPrimary, ALIGN_RIGHT);
row.addElement(ed, true); row.addElement(ed, true);
auto spacer = std::make_shared<GuiComponent>(); auto spacer = std::make_shared<GuiComponent>();
@ -425,6 +429,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
const std::string title {it->displayPrompt}; const std::string title {it->displayPrompt};
@ -462,9 +467,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
mInvalidFolderLinkEntry = false; mInvalidFolderLinkEntry = false;
ed->setValue(newVal); ed->setValue(newVal);
if (newVal == originalValue) if (newVal == originalValue)
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
else else
ed->setColor(TEXTCOLOR_USERMARKED); ed->setColor(mMenuColorBlue);
}; };
row.makeAcceptInputHandler([this, children, title, ed, updateVal, scraperParams] { row.makeAcceptInputHandler([this, children, title, ed, updateVal, scraperParams] {
@ -480,7 +485,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
scraperParams.game->getPath() + "/", ""); scraperParams.game->getPath() + "/", "");
std::shared_ptr<TextComponent> labelText {std::make_shared<TextComponent>( std::shared_ptr<TextComponent> labelText {std::make_shared<TextComponent>(
label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
labelText->setSelectable(true); labelText->setSelectable(true);
labelText->setValue(filePath); labelText->setValue(filePath);
@ -505,7 +510,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
ComponentListRow row; ComponentListRow row;
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>( std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY", ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
clearText->setSelectable(true); clearText->setSelectable(true);
row.addElement(clearText, true); row.addElement(clearText, true);
row.makeAcceptInputHandler([this, s, ed] { row.makeAcceptInputHandler([this, s, ed] {
@ -532,8 +537,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
case MD_MULTILINE_STRING: case MD_MULTILINE_STRING:
default: { default: {
// MD_STRING. // MD_STRING.
ed = std::make_shared<TextComponent>( ed =
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT),
mMenuColorPrimary, ALIGN_RIGHT);
row.addElement(ed, true); row.addElement(ed, true);
auto spacer = std::make_shared<GuiComponent>(); auto spacer = std::make_shared<GuiComponent>();
@ -543,6 +549,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
bool multiLine {it->type == MD_MULTILINE_STRING}; bool multiLine {it->type == MD_MULTILINE_STRING};
@ -570,25 +577,25 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
ed->setValue(gamePath); ed->setValue(gamePath);
} }
if (gamePath == originalValue) if (gamePath == originalValue)
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
else else
ed->setColor(TEXTCOLOR_USERMARKED); ed->setColor(mMenuColorBlue);
} }
else if (newVal == "" && else if (newVal == "" &&
(currentKey == "developer" || currentKey == "publisher" || (currentKey == "developer" || currentKey == "publisher" ||
currentKey == "genre" || currentKey == "players")) { currentKey == "genre" || currentKey == "players")) {
ed->setValue("unknown"); ed->setValue("unknown");
if (originalValue == "unknown") if (originalValue == "unknown")
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
else else
ed->setColor(TEXTCOLOR_USERMARKED); ed->setColor(mMenuColorBlue);
} }
else { else {
ed->setValue(newVal); ed->setValue(newVal);
if (newVal == originalValue) if (newVal == originalValue)
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(mMenuColorPrimary);
else 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}); mGrid.setEntry(mButtons, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1});
// Resize + center. // Resize + center.
@ -905,7 +912,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result)
offset = 0; offset = 0;
// Update the list with the scraped metadata values. // 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) if (mMetaDataDecl.at(i).key == "collectionsortname" && !mIsCustomCollection)
offset = 1; offset = 1;
@ -919,9 +926,9 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result)
if (mEditors.at(i)->getValue() != metadata->get(key)) { if (mEditors.at(i)->getValue() != metadata->get(key)) {
if (key == "rating") if (key == "rating")
mEditors.at(i)->setOriginalColor(ICONCOLOR_SCRAPERMARKED); mEditors.at(i)->setOriginalColor(mMenuColorRed);
else else
mEditors.at(i)->setColor(TEXTCOLOR_SCRAPERMARKED); mEditors.at(i)->setColor(mMenuColorRed);
} }
// Save all the keys that should be scraped. // Save all the keys that should be scraped.
if (mMetaDataDecl.at(i + offset).shouldScrape) if (mMetaDataDecl.at(i + offset).shouldScrape)

View file

@ -35,18 +35,18 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue<FileData*>& gameQueue)
mGame = nullptr; mGame = nullptr;
// Header. // Header.
mTitle = std::make_shared<TextComponent>("MIXIMAGE OFFLINE GENERATOR", mTitle = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); "MIXIMAGE OFFLINE GENERATOR", Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER);
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {6, 1}); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {6, 1});
mStatus = std::make_shared<TextComponent>("NOT STARTED", Font::get(FONT_SIZE_MEDIUM), mStatus = std::make_shared<TextComponent>("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}); mGrid.setEntry(mStatus, glm::ivec2 {0, 1}, false, true, glm::ivec2 {6, 1});
mGameCounter = std::make_shared<TextComponent>( mGameCounter = std::make_shared<TextComponent>(
std::to_string(mGamesProcessed) + " OF " + std::to_string(mTotalGames) + std::to_string(mGamesProcessed) + " OF " + std::to_string(mTotalGames) +
(mTotalGames == 1 ? " GAME " : " GAMES ") + "PROCESSED", (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}); mGrid.setEntry(mGameCounter, glm::ivec2 {0, 2}, false, true, glm::ivec2 {6, 1});
// Spacer row with top border. // Spacer row with top border.
@ -59,54 +59,56 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue<FileData*>& gameQueue)
// Generated label. // Generated label.
mGeneratedLbl = std::make_shared<TextComponent>("Generated:", Font::get(FONT_SIZE_SMALL), mGeneratedLbl = std::make_shared<TextComponent>("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}); mGrid.setEntry(mGeneratedLbl, glm::ivec2 {1, 4}, false, true, glm::ivec2 {1, 1});
// Generated value/counter. // Generated value/counter.
mGeneratedVal = std::make_shared<TextComponent>( mGeneratedVal =
std::to_string(mGamesProcessed), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); std::make_shared<TextComponent>(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}); mGrid.setEntry(mGeneratedVal, glm::ivec2 {2, 4}, false, true, glm::ivec2 {1, 1});
// Overwritten label. // Overwritten label.
mOverwrittenLbl = std::make_shared<TextComponent>("Overwritten:", Font::get(FONT_SIZE_SMALL), mOverwrittenLbl = std::make_shared<TextComponent>("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}); mGrid.setEntry(mOverwrittenLbl, glm::ivec2 {1, 5}, false, true, glm::ivec2 {1, 1});
// Overwritten value/counter. // Overwritten value/counter.
mOverwrittenVal = std::make_shared<TextComponent>( mOverwrittenVal = std::make_shared<TextComponent>(std::to_string(mImagesOverwritten),
std::to_string(mImagesOverwritten), Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); Font::get(FONT_SIZE_SMALL),
mMenuColorSecondary, ALIGN_LEFT);
mGrid.setEntry(mOverwrittenVal, glm::ivec2 {2, 5}, false, true, glm::ivec2 {1, 1}); mGrid.setEntry(mOverwrittenVal, glm::ivec2 {2, 5}, false, true, glm::ivec2 {1, 1});
// Skipping label. // Skipping label.
const std::string skipLabel {mRenderer->getIsVerticalOrientation() ? "Skipped:" : const std::string skipLabel {mRenderer->getIsVerticalOrientation() ? "Skipped:" :
"Skipped (existing):"}; "Skipped (existing):"};
mSkippedLbl = std::make_shared<TextComponent>(skipLabel, Font::get(FONT_SIZE_SMALL), 0x888888FF, mSkippedLbl = std::make_shared<TextComponent>(skipLabel, Font::get(FONT_SIZE_SMALL),
ALIGN_LEFT); mMenuColorSecondary, ALIGN_LEFT);
mGrid.setEntry(mSkippedLbl, glm::ivec2 {1, 6}, false, true, glm::ivec2 {1, 1}); mGrid.setEntry(mSkippedLbl, glm::ivec2 {1, 6}, false, true, glm::ivec2 {1, 1});
// Skipping value/counter. // Skipping value/counter.
mSkippedVal = std::make_shared<TextComponent>( mSkippedVal = std::make_shared<TextComponent>(
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}); mGrid.setEntry(mSkippedVal, glm::ivec2 {2, 6}, false, true, glm::ivec2 {1, 1});
// Failed label. // Failed label.
mFailedLbl = std::make_shared<TextComponent>("Failed:", Font::get(FONT_SIZE_SMALL), 0x888888FF, mFailedLbl = std::make_shared<TextComponent>("Failed:", Font::get(FONT_SIZE_SMALL),
ALIGN_LEFT); mMenuColorSecondary, ALIGN_LEFT);
mGrid.setEntry(mFailedLbl, glm::ivec2 {1, 7}, false, true, glm::ivec2 {1, 1}); mGrid.setEntry(mFailedLbl, glm::ivec2 {1, 7}, false, true, glm::ivec2 {1, 1});
// Failed value/counter. // Failed value/counter.
mFailedVal = std::make_shared<TextComponent>( mFailedVal = std::make_shared<TextComponent>(
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}); mGrid.setEntry(mFailedVal, glm::ivec2 {2, 7}, false, true, glm::ivec2 {1, 1});
// Processing label. // Processing label.
mProcessingLbl = std::make_shared<TextComponent>("Processing: ", Font::get(FONT_SIZE_SMALL), mProcessingLbl = std::make_shared<TextComponent>("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}); mGrid.setEntry(mProcessingLbl, glm::ivec2 {3, 4}, false, true, glm::ivec2 {1, 1});
// Processing value. // Processing value.
mProcessingVal = mProcessingVal = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL),
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); mMenuColorSecondary, ALIGN_LEFT);
mGrid.setEntry(mProcessingVal, glm::ivec2 {4, 4}, false, true, glm::ivec2 {1, 1}); mGrid.setEntry(mProcessingVal, glm::ivec2 {4, 4}, false, true, glm::ivec2 {1, 1});
// Spacer row. // Spacer row.
@ -115,12 +117,12 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue<FileData*>& gameQueue)
// Last error message label. // Last error message label.
mLastErrorLbl = std::make_shared<TextComponent>( mLastErrorLbl = std::make_shared<TextComponent>(
"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}); mGrid.setEntry(mLastErrorLbl, glm::ivec2 {1, 9}, false, true, glm::ivec2 {4, 1});
// Last error message value. // Last error message value.
mLastErrorVal = mLastErrorVal = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL),
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_LEFT); mMenuColorSecondary, ALIGN_LEFT);
mGrid.setEntry(mLastErrorVal, glm::ivec2 {1, 10}, false, true, glm::ivec2 {4, 1}); mGrid.setEntry(mLastErrorVal, glm::ivec2 {1, 10}, false, true, glm::ivec2 {4, 1});
// Right spacer. // Right spacer.
@ -172,7 +174,7 @@ GuiOfflineGenerator::GuiOfflineGenerator(const std::queue<FileData*>& gameQueue)
}); });
buttons.push_back(mCloseButton); buttons.push_back(mCloseButton);
mButtonGrid = makeButtonGrid(buttons); mButtonGrid = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 12}, true, false, glm::ivec2 {6, 1}); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 12}, true, false, glm::ivec2 {6, 1});

View file

@ -113,11 +113,11 @@ GuiScraperMenu::GuiScraperMenu(std::string title)
} }
mMenu.addWithLabel("SCRAPE THESE SYSTEMS", mSystems); mMenu.addWithLabel("SCRAPE THESE SYSTEMS", mSystems);
addEntry("ACCOUNT SETTINGS", 0x777777FF, true, [this] { addEntry("ACCOUNT SETTINGS", mMenuColorPrimary, true, [this] {
// Open the account options menu. // Open the account options menu.
openAccountOptions(); 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 // 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 // settings so that the specific options supported by the respective scrapers
// can be enabled or disabled. // can be enabled or disabled.
@ -125,11 +125,11 @@ GuiScraperMenu::GuiScraperMenu(std::string title)
mMenu.save(); mMenu.save();
openContentOptions(); openContentOptions();
}); });
addEntry("MIXIMAGE SETTINGS", 0x777777FF, true, [this] { addEntry("MIXIMAGE SETTINGS", mMenuColorPrimary, true, [this] {
// Open the miximage options menu. // Open the miximage options menu.
openMiximageOptions(); 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 // 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 // settings so that the specific options supported by the respective scrapers
// can be enabled or disabled. // can be enabled or disabled.
@ -168,8 +168,8 @@ void GuiScraperMenu::openAccountOptions()
auto s = new GuiSettings("ACCOUNT SETTINGS"); auto s = new GuiSettings("ACCOUNT SETTINGS");
// ScreenScraper username. // ScreenScraper username.
auto scraperUsernameScreenScraper = auto scraperUsernameScreenScraper = std::make_shared<TextComponent>(
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); "", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_RIGHT);
s->addEditableTextComponent("SCREENSCRAPER USERNAME", scraperUsernameScreenScraper, s->addEditableTextComponent("SCREENSCRAPER USERNAME", scraperUsernameScreenScraper,
Settings::getInstance()->getString("ScraperUsernameScreenScraper")); Settings::getInstance()->getString("ScraperUsernameScreenScraper"));
s->addSaveFunc([scraperUsernameScreenScraper, s] { s->addSaveFunc([scraperUsernameScreenScraper, s] {
@ -182,8 +182,8 @@ void GuiScraperMenu::openAccountOptions()
}); });
// ScreenScraper password. // ScreenScraper password.
auto scraperPasswordScreenScraper = auto scraperPasswordScreenScraper = std::make_shared<TextComponent>(
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); "", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary, ALIGN_RIGHT);
std::string passwordMasked; std::string passwordMasked;
if (Settings::getInstance()->getString("ScraperPasswordScreenScraper") != "") { if (Settings::getInstance()->getString("ScraperPasswordScreenScraper") != "") {
passwordMasked = "********"; passwordMasked = "********";
@ -631,9 +631,9 @@ void GuiScraperMenu::openMiximageOptions()
offlineGeneratorRow.elements.clear(); offlineGeneratorRow.elements.clear();
offlineGeneratorRow.addElement(std::make_shared<TextComponent>("OFFLINE GENERATOR", offlineGeneratorRow.addElement(std::make_shared<TextComponent>("OFFLINE GENERATOR",
Font::get(FONT_SIZE_MEDIUM), Font::get(FONT_SIZE_MEDIUM),
0x777777FF), mMenuColorPrimary),
true); true);
offlineGeneratorRow.addElement(makeArrow(), false); offlineGeneratorRow.addElement(mMenu.makeArrow(), false);
offlineGeneratorRow.makeAcceptInputHandler( offlineGeneratorRow.makeAcceptInputHandler(
std::bind(&GuiScraperMenu::openOfflineGenerator, this, s)); std::bind(&GuiScraperMenu::openOfflineGenerator, this, s));
s->addRow(offlineGeneratorRow); s->addRow(offlineGeneratorRow);
@ -1198,7 +1198,7 @@ void GuiScraperMenu::addEntry(const std::string& name,
row.addElement(std::make_shared<TextComponent>(name, font, color), true); row.addElement(std::make_shared<TextComponent>(name, font, color), true);
if (add_arrow) { if (add_arrow) {
std::shared_ptr<ImageComponent> bracket {makeArrow()}; std::shared_ptr<ImageComponent> bracket {mMenu.makeArrow()};
row.addElement(bracket, false); row.addElement(bracket, false);
} }

View file

@ -45,15 +45,15 @@ GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches
// Set up grid. // Set up grid.
mTitle = std::make_shared<TextComponent>("SCRAPING IN PROGRESS", Font::get(FONT_SIZE_LARGE), mTitle = std::make_shared<TextComponent>("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}); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
mSystem = std::make_shared<TextComponent>("SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, mSystem = std::make_shared<TextComponent>("SYSTEM", Font::get(FONT_SIZE_MEDIUM),
ALIGN_CENTER); mMenuColorPrimary, ALIGN_CENTER);
mGrid.setEntry(mSystem, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1}); mGrid.setEntry(mSystem, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1});
mSubtitle = std::make_shared<TextComponent>("subtitle text", Font::get(FONT_SIZE_SMALL), mSubtitle = std::make_shared<TextComponent>("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}); mGrid.setEntry(mSubtitle, glm::ivec2 {0, 3}, false, true, glm::ivec2 {2, 1});
if (mApproveResults && !Settings::getInstance()->getBool("ScraperSemiautomatic")) if (mApproveResults && !Settings::getInstance()->getBool("ScraperSemiautomatic"))
@ -144,7 +144,7 @@ GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches
buttons.push_back(std::make_shared<ButtonComponent>("STOP", "stop", buttons.push_back(std::make_shared<ButtonComponent>("STOP", "stop",
std::bind(&GuiScraperMulti::finish, this))); 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}); 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 // Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is

View file

@ -59,8 +59,8 @@ GuiScraperSearch::GuiScraperSearch(SearchType type, unsigned int scrapeCount)
glm::ivec2 {1, 3}, GridFlags::BORDER_TOP | GridFlags::BORDER_BOTTOM); glm::ivec2 {1, 3}, GridFlags::BORDER_TOP | GridFlags::BORDER_BOTTOM);
// Selected result name. // Selected result name.
mResultName = mResultName = std::make_shared<TextComponent>("Result name", Font::get(FONT_SIZE_MEDIUM),
std::make_shared<TextComponent>("Result name", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); mMenuColorPrimary);
// Selected result thumbnail. // Selected result thumbnail.
mResultThumbnail = std::make_shared<ImageComponent>(); mResultThumbnail = std::make_shared<ImageComponent>();
@ -75,15 +75,15 @@ GuiScraperSearch::GuiScraperSearch(SearchType type, unsigned int scrapeCount)
else else
mDescContainer->setScrollParameters(6000.0f, 3000.0f, 0.8f); mDescContainer->setScrollParameters(6000.0f, 3000.0f, 0.8f);
mResultDesc = mResultDesc = std::make_shared<TextComponent>("Result desc", Font::get(FONT_SIZE_SMALL),
std::make_shared<TextComponent>("Result desc", Font::get(FONT_SIZE_SMALL), 0x777777FF); mMenuColorPrimary);
mDescContainer->addChild(mResultDesc.get()); mDescContainer->addChild(mResultDesc.get());
mDescContainer->setAutoScroll(true); mDescContainer->setAutoScroll(true);
// Metadata. // Metadata.
auto font = Font::get(FONT_SIZE_SMALL); // Placeholder, gets replaced in onSizeChanged(). auto font = Font::get(FONT_SIZE_SMALL); // Placeholder, gets replaced in onSizeChanged().
const unsigned int mdColor {0x777777FF}; const unsigned int mdColor {mMenuColorPrimary};
const unsigned int mdLblColor {0x666666FF}; const unsigned int mdLblColor {mMenuColorTertiary};
mMD_Rating = std::make_shared<RatingComponent>(false, true); mMD_Rating = std::make_shared<RatingComponent>(false, true);
mMD_ReleaseDate = std::make_shared<DateTimeEditComponent>(); mMD_ReleaseDate = std::make_shared<DateTimeEditComponent>();
mMD_ReleaseDate->setColor(mdColor); mMD_ReleaseDate->setColor(mdColor);
@ -381,7 +381,7 @@ void GuiScraperSearch::onSearchDone(std::vector<ScraperSearchResult>& results)
mResultList->setLoopRows(true); mResultList->setLoopRows(true);
auto font = Font::get(FONT_SIZE_MEDIUM); auto font = Font::get(FONT_SIZE_MEDIUM);
unsigned int color {0x777777FF}; unsigned int color {mMenuColorPrimary};
if (results.empty()) { if (results.empty()) {
// Check if the scraper used is still valid. // Check if the scraper used is still valid.
if (!isValidConfiguredScraper()) { if (!isValidConfiguredScraper()) {
@ -650,7 +650,7 @@ void GuiScraperSearch::render(const glm::mat4& parentTrans)
glm::mat4 trans {parentTrans * getTransform()}; glm::mat4 trans {parentTrans * getTransform()};
renderChildren(trans); 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. // Slight adjustment upwards so the busy grid is not rendered precisely at the text edge.
trans = glm::translate( trans = glm::translate(

View file

@ -48,13 +48,13 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params,
mGameName = std::make_shared<TextComponent>( mGameName = std::make_shared<TextComponent>(
scrapeName + scrapeName +
((mSearchParams.game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""), ((mSearchParams.game->getType() == FOLDER) ? " " + ViewController::FOLDER_CHAR : ""),
Font::get(FONT_SIZE_LARGE), 0x777777FF, ALIGN_CENTER); Font::get(FONT_SIZE_LARGE), mMenuColorPrimary, ALIGN_CENTER);
mGameName->setColor(0x555555FF); mGameName->setColor(mMenuColorTitle);
mGrid.setEntry(mGameName, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); mGrid.setEntry(mGameName, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
mSystemName = mSystemName = std::make_shared<TextComponent>(
std::make_shared<TextComponent>(Utils::String::toUpper(mSearchParams.system->getFullName()), Utils::String::toUpper(mSearchParams.system->getFullName()), Font::get(FONT_SIZE_SMALL),
Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_CENTER); mMenuColorSecondary, ALIGN_CENTER);
mGrid.setEntry(mSystemName, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1}); mGrid.setEntry(mSystemName, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1});
// Row 3 is a spacer. // Row 3 is a spacer.
@ -104,7 +104,7 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params,
} }
delete this; delete this;
})); }));
mButtonGrid = makeButtonGrid(buttons); mButtonGrid = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1}); mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1});

View file

@ -82,18 +82,18 @@ GuiScreensaverOptions::GuiScreensaverOptions(const std::string& title)
ComponentListRow row; ComponentListRow row;
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("SLIDESHOW SCREENSAVER SETTINGS", row.addElement(std::make_shared<TextComponent>("SLIDESHOW SCREENSAVER SETTINGS",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
row.addElement(makeArrow(), false); row.addElement(getMenu().makeArrow(), false);
row.makeAcceptInputHandler( row.makeAcceptInputHandler(
std::bind(&GuiScreensaverOptions::openSlideshowScreensaverOptions, this)); std::bind(&GuiScreensaverOptions::openSlideshowScreensaverOptions, this));
addRow(row); addRow(row);
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("VIDEO SCREENSAVER SETTINGS", row.addElement(std::make_shared<TextComponent>("VIDEO SCREENSAVER SETTINGS",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
true); true);
row.addElement(makeArrow(), false); row.addElement(getMenu().makeArrow(), false);
row.makeAcceptInputHandler( row.makeAcceptInputHandler(
std::bind(&GuiScreensaverOptions::openVideoScreensaverOptions, this)); std::bind(&GuiScreensaverOptions::openVideoScreensaverOptions, this));
addRow(row); addRow(row);
@ -192,8 +192,8 @@ void GuiScreensaverOptions::openSlideshowScreensaverOptions()
}); });
// Custom image directory. // Custom image directory.
auto screensaverSlideshowImageDir = auto screensaverSlideshowImageDir = std::make_shared<TextComponent>(
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_RIGHT); "", Font::get(FONT_SIZE_SMALL), mMenuColorPrimary, ALIGN_RIGHT);
s->addEditableTextComponent( s->addEditableTextComponent(
"CUSTOM IMAGE DIRECTORY", screensaverSlideshowImageDir, "CUSTOM IMAGE DIRECTORY", screensaverSlideshowImageDir,
Settings::getInstance()->getString("ScreensaverSlideshowImageDir"), Settings::getInstance()->getString("ScreensaverSlideshowImageDir"),

View file

@ -176,18 +176,18 @@ void GuiSettings::addEditableTextComponent(const std::string label,
row.elements.clear(); row.elements.clear();
auto lbl = std::make_shared<TextComponent>(Utils::String::toUpper(label), auto lbl = std::make_shared<TextComponent>(Utils::String::toUpper(label),
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
row.addElement(lbl, true); row.addElement(lbl, true);
row.addElement(ed, true); row.addElement(ed, true);
auto spacer = std::make_shared<GuiComponent>(); auto spacer = std::make_shared<GuiComponent>();
spacer->setSize(Renderer::getScreenWidth() * 0.005f, 0); spacer->setSize(Renderer::getScreenWidth() * 0.005f, 0.0f);
row.addElement(spacer, false); row.addElement(spacer, false);
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false); row.addElement(bracket, false);
// OK callback (apply new value to ed). // OK callback (apply new value to ed).

View file

@ -40,7 +40,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
// Set up main grid. // Set up main grid.
mTitle = std::make_shared<TextComponent>("THEME DOWNLOADER", Font::get(FONT_SIZE_LARGE), mTitle = std::make_shared<TextComponent>("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}, mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2},
GridFlags::BORDER_BOTTOM); GridFlags::BORDER_BOTTOM);
@ -51,46 +51,46 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
glm::ivec2 {1, 5}); glm::ivec2 {1, 5});
mVariantsLabel = mVariantsLabel =
std::make_shared<TextComponent>("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); std::make_shared<TextComponent>("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT);
mCenterGrid->setEntry(mVariantsLabel, glm::ivec2 {1, 0}, false, true, glm::ivec2 {1, 1}); mCenterGrid->setEntry(mVariantsLabel, glm::ivec2 {1, 0}, false, true, glm::ivec2 {1, 1});
mColorSchemesLabel = mColorSchemesLabel =
std::make_shared<TextComponent>("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); std::make_shared<TextComponent>("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT);
mCenterGrid->setEntry(mColorSchemesLabel, glm::ivec2 {1, 1}, false, true, glm::ivec2 {1, 1}); mCenterGrid->setEntry(mColorSchemesLabel, glm::ivec2 {1, 1}, false, true, glm::ivec2 {1, 1});
mAspectRatiosLabel = mAspectRatiosLabel =
std::make_shared<TextComponent>("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); std::make_shared<TextComponent>("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT);
mCenterGrid->setEntry(mAspectRatiosLabel, glm::ivec2 {3, 0}, false, true, glm::ivec2 {1, 1}); mCenterGrid->setEntry(mAspectRatiosLabel, glm::ivec2 {3, 0}, false, true, glm::ivec2 {1, 1});
mFutureUseLabel = mFutureUseLabel =
std::make_shared<TextComponent>("", Font::get(fontSizeSmall), 0x555555FF, ALIGN_LEFT); std::make_shared<TextComponent>("", Font::get(fontSizeSmall), mMenuColorTitle, ALIGN_LEFT);
mCenterGrid->setEntry(mFutureUseLabel, glm::ivec2 {3, 1}, false, true, glm::ivec2 {1, 1}); mCenterGrid->setEntry(mFutureUseLabel, glm::ivec2 {3, 1}, false, true, glm::ivec2 {1, 1});
mCenterGrid->setEntry(std::make_shared<GuiComponent>(), glm::ivec2 {5, 0}, false, false, mCenterGrid->setEntry(std::make_shared<GuiComponent>(), glm::ivec2 {5, 0}, false, false,
glm::ivec2 {1, 5}); glm::ivec2 {1, 5});
mVariantCount = std::make_shared<TextComponent>("", Font::get(fontSizeSmall, FONT_PATH_LIGHT), mVariantCount = std::make_shared<TextComponent>("", 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}); mCenterGrid->setEntry(mVariantCount, glm::ivec2 {2, 0}, false, true, glm::ivec2 {1, 1});
mColorSchemesCount = std::make_shared<TextComponent>( mColorSchemesCount = std::make_shared<TextComponent>(
"", 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}); mCenterGrid->setEntry(mColorSchemesCount, glm::ivec2 {2, 1}, false, true, glm::ivec2 {1, 1});
mAspectRatiosCount = std::make_shared<TextComponent>( mAspectRatiosCount = std::make_shared<TextComponent>(
"", 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}); mCenterGrid->setEntry(mAspectRatiosCount, glm::ivec2 {4, 0}, false, true, glm::ivec2 {1, 1});
mFutureUseCount = std::make_shared<TextComponent>("", Font::get(fontSizeSmall, FONT_PATH_LIGHT), mFutureUseCount = std::make_shared<TextComponent>("", 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}); mCenterGrid->setEntry(mFutureUseCount, glm::ivec2 {4, 1}, false, true, glm::ivec2 {1, 1});
mDownloadStatus = std::make_shared<TextComponent>("", Font::get(fontSizeSmall, FONT_PATH_BOLD), mDownloadStatus = std::make_shared<TextComponent>("", 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}); mCenterGrid->setEntry(mDownloadStatus, glm::ivec2 {1, 2}, false, true, glm::ivec2 {2, 1});
mLocalChanges = std::make_shared<TextComponent>("", Font::get(fontSizeSmall, FONT_PATH_BOLD), mLocalChanges = std::make_shared<TextComponent>("", 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}); mCenterGrid->setEntry(mLocalChanges, glm::ivec2 {3, 2}, false, true, glm::ivec2 {2, 1});
mScreenshot = std::make_shared<ImageComponent>(); mScreenshot = std::make_shared<ImageComponent>();
@ -98,7 +98,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
mCenterGrid->setEntry(mScreenshot, glm::ivec2 {1, 3}, false, true, glm::ivec2 {4, 1}); mCenterGrid->setEntry(mScreenshot, glm::ivec2 {1, 3}, false, true, glm::ivec2 {4, 1});
mAuthor = std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MINI * 0.9f, FONT_PATH_LIGHT), mAuthor = std::make_shared<TextComponent>("", 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}); mCenterGrid->setEntry(mAuthor, glm::ivec2 {1, 4}, false, true, glm::ivec2 {4, 1});
mList = std::make_shared<ComponentList>(); mList = std::make_shared<ComponentList>();
@ -124,7 +124,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
std::vector<std::shared_ptr<ButtonComponent>> buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
buttons.push_back(std::make_shared<ButtonComponent>("CLOSE", "CLOSE", [&] { delete this; })); buttons.push_back(std::make_shared<ButtonComponent>("CLOSE", "CLOSE", [&] { delete this; }));
mButtons = makeButtonGrid(buttons); mButtons = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mButtons, glm::ivec2 {0, 3}, true, false, glm::ivec2 {2, 1}, mGrid.setEntry(mButtons, glm::ivec2 {0, 3}, true, false, glm::ivec2 {2, 1},
GridFlags::BORDER_TOP); GridFlags::BORDER_TOP);
@ -689,8 +689,8 @@ void GuiThemeDownloader::populateGUI()
themeName.append(" ").append(ViewController::EXCLAMATION_CHAR); themeName.append(" ").append(ViewController::EXCLAMATION_CHAR);
ComponentListRow row; ComponentListRow row;
std::shared_ptr<TextComponent> themeNameElement { std::shared_ptr<TextComponent> themeNameElement {std::make_shared<TextComponent>(
std::make_shared<TextComponent>(themeName, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)}; themeName, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
ThemeGUIEntry guiEntry; ThemeGUIEntry guiEntry;
guiEntry.themeName = themeNameElement; guiEntry.themeName = themeNameElement;
@ -861,31 +861,31 @@ void GuiThemeDownloader::updateInfoPane()
if (mThemeSets[mList->getCursorId()].isCloned) { if (mThemeSets[mList->getCursorId()].isCloned) {
mDownloadStatus->setText(ViewController::TICKMARK_CHAR + " INSTALLED"); mDownloadStatus->setText(ViewController::TICKMARK_CHAR + " INSTALLED");
mDownloadStatus->setColor(0x449944FF); mDownloadStatus->setColor(mMenuColorGreen);
} }
else if (mThemeSets[mList->getCursorId()].invalidRepository || else if (mThemeSets[mList->getCursorId()].invalidRepository ||
mThemeSets[mList->getCursorId()].manuallyDownloaded) { mThemeSets[mList->getCursorId()].manuallyDownloaded) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " MANUAL DOWNLOAD"); mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " MANUAL DOWNLOAD");
mDownloadStatus->setColor(0x992222FF); mDownloadStatus->setColor(mMenuColorRed);
} }
else if (mThemeSets[mList->getCursorId()].corruptRepository) { else if (mThemeSets[mList->getCursorId()].corruptRepository) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " CORRUPT"); mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " CORRUPT");
mDownloadStatus->setColor(0x992222FF); mDownloadStatus->setColor(mMenuColorRed);
} }
else if (mThemeSets[mList->getCursorId()].shallowRepository) { else if (mThemeSets[mList->getCursorId()].shallowRepository) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " SHALLOW"); mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " SHALLOW");
mDownloadStatus->setColor(0x992222FF); mDownloadStatus->setColor(mMenuColorRed);
} }
else { else {
if (mThemeSets[mList->getCursorId()].newEntry) if (mThemeSets[mList->getCursorId()].newEntry)
mDownloadStatus->setText("NOT INSTALLED (NEW)"); mDownloadStatus->setText("NOT INSTALLED (NEW)");
else else
mDownloadStatus->setText("NOT INSTALLED"); mDownloadStatus->setText("NOT INSTALLED");
mDownloadStatus->setColor(0x999999FF); mDownloadStatus->setColor(mMenuColorSecondary);
} }
if (mThemeSets[mList->getCursorId()].hasLocalChanges) { if (mThemeSets[mList->getCursorId()].hasLocalChanges) {
mLocalChanges->setText(ViewController::EXCLAMATION_CHAR + " LOCAL CHANGES"); mLocalChanges->setText(ViewController::EXCLAMATION_CHAR + " LOCAL CHANGES");
mLocalChanges->setColor(0x992222FF); mLocalChanges->setColor(mMenuColorRed);
} }
else { else {
mLocalChanges->setText(""); mLocalChanges->setText("");
@ -1036,8 +1036,8 @@ void GuiThemeDownloader::render(const glm::mat4& parentTrans)
if (mGrayRectangleCoords.size() == 4) { if (mGrayRectangleCoords.size() == 4) {
mRenderer->setMatrix(parentTrans * getTransform()); mRenderer->setMatrix(parentTrans * getTransform());
mRenderer->drawRect(mGrayRectangleCoords[0], mGrayRectangleCoords[1], mRenderer->drawRect(mGrayRectangleCoords[0], mGrayRectangleCoords[1],
mGrayRectangleCoords[2], mGrayRectangleCoords[3], 0x00000009, mGrayRectangleCoords[2], mGrayRectangleCoords[3], mMenuColorPanelDimmed,
0x00000009); mMenuColorPanelDimmed);
} }
if (mFetching) if (mFetching)

View file

@ -721,7 +721,7 @@ int main(int argc, char* argv[])
renderer = Renderer::getInstance(); renderer = Renderer::getInstance();
window = Window::getInstance(); window = Window::getInstance();
ViewController::getInstance(); ViewController::getInstance()->setMenuColors();
CollectionSystemsManager::getInstance(); CollectionSystemsManager::getInstance();
Screensaver screensaver; Screensaver screensaver;
MediaViewer mediaViewer; MediaViewer mediaViewer;

View file

@ -59,6 +59,86 @@ ViewController* ViewController::getInstance()
return &instance; 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() void ViewController::invalidSystemsFileDialog()
{ {
std::string errorMessage = "COULDN'T PARSE THE SYSTEMS CONFIGURATION FILE. " std::string errorMessage = "COULDN'T PARSE THE SYSTEMS CONFIGURATION FILE. "

View file

@ -33,6 +33,7 @@ public:
static ViewController* getInstance(); static ViewController* getInstance();
// These functions are called from main(). // These functions are called from main().
void setMenuColors();
void invalidSystemsFileDialog(); void invalidSystemsFileDialog();
void noGamesDialog(); void noGamesDialog();
void invalidAlternativeEmulatorDialog(); void invalidAlternativeEmulatorDialog();

View file

@ -17,14 +17,6 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#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 #define DISABLED_OPACITY 0.314f
class Animation; class Animation;
@ -355,6 +347,44 @@ protected:
unsigned int mColorChangedValue; unsigned int mColorChangedValue;
unsigned int mComponentThemeFlags; 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::vec3 mPosition;
glm::vec2 mOrigin; glm::vec2 mOrigin;
glm::vec2 mRotationOrigin; glm::vec2 mRotationOrigin;

View file

@ -160,6 +160,7 @@ void Settings::setDefaults()
mStringMap["QuickSystemSelect"] = {"leftrightshoulders", "leftrightshoulders"}; mStringMap["QuickSystemSelect"] = {"leftrightshoulders", "leftrightshoulders"};
mStringMap["StartupSystem"] = {"", ""}; mStringMap["StartupSystem"] = {"", ""};
mStringMap["DefaultSortOrder"] = {"filename, ascending", "filename, ascending"}; mStringMap["DefaultSortOrder"] = {"filename, ascending", "filename, ascending"};
mStringMap["MenuColorScheme"] = {"light", "light"};
mStringMap["MenuOpeningEffect"] = {"scale-up", "scale-up"}; mStringMap["MenuOpeningEffect"] = {"scale-up", "scale-up"};
mStringMap["LaunchScreenDuration"] = {"normal", "normal"}; mStringMap["LaunchScreenDuration"] = {"normal", "normal"};
mStringMap["UIMode"] = {"full", "full"}; mStringMap["UIMode"] = {"full", "full"};

View file

@ -135,12 +135,12 @@ bool Window::init()
mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f, mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f,
(mRenderer->getScreenHeight() - mSplash->getSize().y) / 2.0f * 0.6f); (mRenderer->getScreenHeight() - mSplash->getSize().y) / 2.0f * 0.6f);
mSplashTextScanning = std::unique_ptr<TextCache>(mDefaultFonts.at(1)->buildTextCache( mSplashTextScanning = std::unique_ptr<TextCache>(
"Searching for games...", 0.0f, 0.0f, DEFAULT_TEXTCOLOR)); mDefaultFonts.at(1)->buildTextCache("Searching for games...", 0.0f, 0.0f, 0x777777FF));
mSplashTextPopulating = std::unique_ptr<TextCache>( mSplashTextPopulating = std::unique_ptr<TextCache>(
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<TextCache>( mSplashTextReloading = std::unique_ptr<TextCache>(
mDefaultFonts.at(1)->buildTextCache("Reloading...", 0.0f, 0.0f, DEFAULT_TEXTCOLOR)); mDefaultFonts.at(1)->buildTextCache("Reloading...", 0.0f, 0.0f, 0x777777FF));
mSplashTextPositions.x = mSplashTextPositions.x =
(mRenderer->getScreenWidth() - mSplashTextScanning->metrics.size.x) / 2.0f; (mRenderer->getScreenWidth() - mSplashTextScanning->metrics.size.x) / 2.0f;
@ -161,7 +161,7 @@ bool Window::init()
progressBarRect.barPosX = progressBarRect.barPosX =
(mRenderer->getScreenWidth() / 2.0f) - (progressBarRect.barWidth / 2.0f); (mRenderer->getScreenWidth() / 2.0f) - (progressBarRect.barWidth / 2.0f);
progressBarRect.barPosY = mSplashTextPositions.y + (progressBarRect.barHeight * 2.0f); progressBarRect.barPosY = mSplashTextPositions.y + (progressBarRect.barHeight * 2.0f);
progressBarRect.color = DEFAULT_TEXTCOLOR; progressBarRect.color = 0x777777FF;
mProgressBarRectangles.emplace_back(progressBarRect); mProgressBarRectangles.emplace_back(progressBarRect);
const float borderThickness {std::ceil(2.0f * mRenderer->getScreenResolutionModifier())}; const float borderThickness {std::ceil(2.0f * mRenderer->getScreenResolutionModifier())};
@ -528,7 +528,10 @@ void Window::render()
// clang-format on // clang-format on
// Also dim the background slightly. // 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 | mRenderer->shaderPostprocessing(Renderer::Shader::CORE |
Renderer::Shader::BLUR_HORIZONTAL | Renderer::Shader::BLUR_HORIZONTAL |

View file

@ -34,6 +34,7 @@ void AnimatedImageComponent::load(const AnimationDef* def)
auto img = std::unique_ptr<ImageComponent>(new ImageComponent); auto img = std::unique_ptr<ImageComponent>(new ImageComponent);
img->setResize(mSize); img->setResize(mSize);
img->setImage(std::string(def->frames[i].path), false); img->setImage(std::string(def->frames[i].path), false);
img->setColorShift(def->color);
mFrames.push_back(ImageFrame(std::move(img), def->frames[i].time)); mFrames.push_back(ImageFrame(std::move(img), def->frames[i].time));
} }

View file

@ -21,6 +21,7 @@ struct AnimationFrame {
struct AnimationDef { struct AnimationDef {
AnimationFrame* frames; AnimationFrame* frames;
size_t frameCount; size_t frameCount;
unsigned int color;
bool loop; bool loop;
}; };

View file

@ -11,22 +11,13 @@
#include "components/AnimatedImageComponent.h" #include "components/AnimatedImageComponent.h"
#include "components/ImageComponent.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() BusyComponent::BusyComponent()
: mBackground {":/graphics/frame.png"} : mBackground {":/graphics/frame.png"}
, mGrid {glm::ivec2 {5, 3}} , mGrid {glm::ivec2 {5, 3}}
{ {
mAnimation = std::make_shared<AnimatedImageComponent>(); mAnimation = std::make_shared<AnimatedImageComponent>();
mText = std::make_shared<TextComponent>("WORKING...", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); mText = std::make_shared<TextComponent>("WORKING...", Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary);
// Col 0 = animation, col 1 = spacer, col 2 = text. // Col 0 = animation, col 1 = spacer, col 2 = text.
mGrid.setEntry(mAnimation, glm::ivec2 {1, 1}, false, true); 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), mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3),
textHeight + (2.0f * Renderer::getScreenResolutionModifier())}, textHeight + (2.0f * Renderer::getScreenResolutionModifier())},
mAnimation->getPosition(), glm::vec2 {0.0f, 0.0f}); 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() void BusyComponent::reset()

View file

@ -24,10 +24,10 @@ ButtonComponent::ButtonComponent(const std::string& text,
, mFocused {false} , mFocused {false}
, mEnabled {true} , mEnabled {true}
, mFlatStyle {flatStyle} , mFlatStyle {flatStyle}
, mTextColorFocused {0xFFFFFFFF} , mTextColorFocused {mMenuColorButtonTextFocused}
, mTextColorUnfocused {0x777777FF} , mTextColorUnfocused {mMenuColorButtonTextUnfocused}
, mFlatColorFocused {0x878787FF} , mFlatColorFocused {mMenuColorButtonFlatFocused}
, mFlatColorUnfocused {0x60606025} , mFlatColorUnfocused {mMenuColorButtonFlatUnfocused}
{ {
mBox.setSharpCorners(true); mBox.setSharpCorners(true);
@ -172,12 +172,10 @@ void ButtonComponent::updateImage()
{ {
if (!mEnabled || !mPressedFunc) { if (!mEnabled || !mPressedFunc) {
mBox.setImagePath(":/graphics/button_filled.svg"); mBox.setImagePath(":/graphics/button_filled.svg");
mBox.setCenterColor(0x770000FF); mBox.setFrameColor(0x770000FF);
mBox.setEdgeColor(0x770000FF);
return; return;
} }
mBox.setCenterColor(0xFFFFFFFF); mBox.setFrameColor(mMenuColorButtonFocused);
mBox.setEdgeColor(0xFFFFFFFF);
mBox.setImagePath(mFocused ? ":/graphics/button_filled.svg" : ":/graphics/button.svg"); mBox.setImagePath(mFocused ? ":/graphics/button_filled.svg" : ":/graphics/button.svg");
} }

View file

@ -432,7 +432,7 @@ void ComponentGrid::render(const glm::mat4& parentTrans)
for (size_t i = 0; i < mSeparators.size(); ++i) { for (size_t i = 0; i < mSeparators.size(); ++i) {
mRenderer->setMatrix(trans); mRenderer->setMatrix(trans);
mRenderer->drawRect(mSeparators[i][0], mSeparators[i][1], mSeparators[i][2], mRenderer->drawRect(mSeparators[i][0], mSeparators[i][1], mSeparators[i][2],
mSeparators[i][3], 0xC6C7C6FF, 0xC6C7C6FF); mSeparators[i][3], mMenuColorSeparators, mMenuColorSeparators);
} }
} }

View file

@ -311,6 +311,15 @@ void ComponentList::render(const glm::mat4& parentTrans)
trans = glm::translate(trans, glm::vec3 {0.0f, -mCameraOffset, 0.0f}); trans = glm::translate(trans, glm::vec3 {0.0f, -mCameraOffset, 0.0f});
glm::mat4 loopTrans {trans}; 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. // Draw our entries.
std::vector<GuiComponent*> drawAfterCursor; std::vector<GuiComponent*> drawAfterCursor;
@ -362,9 +371,9 @@ void ComponentList::render(const glm::mat4& parentTrans)
} }
else { else {
if (isTextComponent) if (isTextComponent)
it->component->setColor(DEFAULT_INVERTED_TEXTCOLOR); it->component->setColor(mMenuColorPrimary);
else else
it->component->setColorShift(DEFAULT_INVERTED_IMAGECOLOR); it->component->setColorShift(mMenuColorPrimary);
renderLoopFunc(); renderLoopFunc();
// Revert to the original color after rendering. // Revert to the original color after rendering.
if (isTextComponent) if (isTextComponent)
@ -386,13 +395,13 @@ void ComponentList::render(const glm::mat4& parentTrans)
// Custom rendering. // Custom rendering.
mRenderer->setMatrix(trans); mRenderer->setMatrix(trans);
// Draw selector bar. // Draw selector bar if we're using the light color scheme.
if (mFocused) { if (mFocused && !darkColorScheme) {
const float selectedRowHeight {getRowHeight(mEntries.at(mCursor).data)}; const float selectedRowHeight {getRowHeight(mEntries.at(mCursor).data)};
if (mOpacity == 1.0f) { if (mOpacity == 1.0f) {
mRenderer->drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight, 0xFFFFFFFF, mRenderer->drawRect(0.0f, mSelectorBarOffset, mSize.x, selectedRowHeight,
0xFFFFFFFF, false, mOpacity, mDimming, mMenuColorSelector, mMenuColorSelector, false, mOpacity, mDimming,
Renderer::BlendFactor::ONE_MINUS_DST_COLOR, Renderer::BlendFactor::ONE_MINUS_DST_COLOR,
Renderer::BlendFactor::ZERO); Renderer::BlendFactor::ZERO);
@ -413,12 +422,12 @@ void ComponentList::render(const glm::mat4& parentTrans)
float y {0.0f}; float y {0.0f};
for (unsigned int i {0}; i < mEntries.size(); ++i) { for (unsigned int i {0}; i < mEntries.size(); ++i) {
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenResolutionModifier(), 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); y += getRowHeight(mEntries.at(i).data);
} }
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenResolutionModifier(), mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenResolutionModifier(),
0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming); mMenuColorSeparators, mMenuColorSeparators, false, mOpacity, mDimming);
mRenderer->popClipRect(); mRenderer->popClipRect();
} }

View file

@ -23,7 +23,7 @@ DateTimeEditComponent::DateTimeEditComponent(bool alignRight, DisplayMode dispMo
, mKeyRepeatDir {0} , mKeyRepeatDir {0}
, mKeyRepeatTimer {0} , mKeyRepeatTimer {0}
, mRelativeUpdateAccumulator {0} , mRelativeUpdateAccumulator {0}
, mColor {0x777777FF} , mColor {mMenuColorPrimary}
, mFont {Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)} , mFont {Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)}
, mAlignRight {alignRight} , mAlignRight {alignRight}
, mUppercase {false} , mUppercase {false}
@ -201,7 +201,7 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans)
if (mEditIndex >= 0 && static_cast<unsigned int>(mEditIndex) < mCursorBoxes.size()) if (mEditIndex >= 0 && static_cast<unsigned int>(mEditIndex) < mCursorBoxes.size())
mRenderer->drawRect(mCursorBoxes[mEditIndex][0], mCursorBoxes[mEditIndex][1], mRenderer->drawRect(mCursorBoxes[mEditIndex][0], mCursorBoxes[mEditIndex][1],
mCursorBoxes[mEditIndex][2], mCursorBoxes[mEditIndex][3], mCursorBoxes[mEditIndex][2], mCursorBoxes[mEditIndex][3],
0x00000022, 0x00000022); mMenuColorDateTimeEditMarker, mMenuColorDateTimeEditMarker);
} }
} }
} }

View file

@ -32,7 +32,7 @@ MenuComponent::MenuComponent(std::string title, const std::shared_ptr<Font>& tit
// Set up title. // Set up title.
mTitle = std::make_shared<TextComponent>(); mTitle = std::make_shared<TextComponent>();
mTitle->setHorizontalAlignment(ALIGN_CENTER); mTitle->setHorizontalAlignment(ALIGN_CENTER);
mTitle->setColor(0x555555FF); mTitle->setColor(mMenuColorTitle);
setTitle(title, titleFont); setTitle(title, titleFont);
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2}); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
@ -165,7 +165,7 @@ void MenuComponent::updateGrid()
} }
} }
std::shared_ptr<ComponentGrid> makeButtonGrid( std::shared_ptr<ComponentGrid> MenuComponent::makeButtonGrid(
const std::vector<std::shared_ptr<ButtonComponent>>& buttons) const std::vector<std::shared_ptr<ButtonComponent>>& buttons)
{ {
std::shared_ptr<ComponentGrid> buttonGrid { std::shared_ptr<ComponentGrid> buttonGrid {
@ -190,10 +190,11 @@ std::shared_ptr<ComponentGrid> makeButtonGrid(
return buttonGrid; return buttonGrid;
} }
std::shared_ptr<ImageComponent> makeArrow() std::shared_ptr<ImageComponent> MenuComponent::makeArrow()
{ {
auto bracket = std::make_shared<ImageComponent>(); auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()); bracket->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
bracket->setImage(":/graphics/arrow.svg"); bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
return bracket; return bracket;
} }

View file

@ -9,8 +9,10 @@
#ifndef ES_CORE_COMPONENTS_MENU_COMPONENT_H #ifndef ES_CORE_COMPONENTS_MENU_COMPONENT_H
#define ES_CORE_COMPONENTS_MENU_COMPONENT_H #define ES_CORE_COMPONENTS_MENU_COMPONENT_H
#include "components/ButtonComponent.h"
#include "components/ComponentGrid.h" #include "components/ComponentGrid.h"
#include "components/ComponentList.h" #include "components/ComponentList.h"
#include "components/ImageComponent.h"
#include "components/NinePatchComponent.h" #include "components/NinePatchComponent.h"
#include "components/ScrollIndicatorComponent.h" #include "components/ScrollIndicatorComponent.h"
#include "components/TextComponent.h" #include "components/TextComponent.h"
@ -18,13 +20,6 @@
#include <cmath> #include <cmath>
class ButtonComponent;
class ImageComponent;
std::shared_ptr<ComponentGrid> makeButtonGrid(
const std::vector<std::shared_ptr<ButtonComponent>>& buttons);
std::shared_ptr<ImageComponent> makeArrow();
class MenuComponent : public GuiComponent class MenuComponent : public GuiComponent
{ {
public: public:
@ -51,7 +46,8 @@ public:
{ {
ComponentListRow row; ComponentListRow row;
row.addElement(std::make_shared<TextComponent>(Utils::String::toUpper(label), row.addElement(std::make_shared<TextComponent>(Utils::String::toUpper(label),
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary),
true); true);
row.addElement(comp, false, invert_when_selected); row.addElement(comp, false, invert_when_selected);
addRow(row, setCursorHere); addRow(row, setCursorHere);
@ -63,6 +59,11 @@ public:
const std::string& helpText, const std::string& helpText,
const std::function<void()>& callback); const std::function<void()>& callback);
static std::shared_ptr<ComponentGrid> makeButtonGrid(
const std::vector<std::shared_ptr<ButtonComponent>>& buttons);
std::shared_ptr<ImageComponent> makeArrow();
void setTitle(std::string title, const std::shared_ptr<Font>& font); void setTitle(std::string title, const std::shared_ptr<Font>& font);
std::shared_ptr<ComponentList> getList() { return mList; } std::shared_ptr<ComponentList> getList() { return mList; }

View file

@ -13,34 +13,24 @@
#include "resources/Font.h" #include "resources/Font.h"
#include "resources/TextureResource.h" #include "resources/TextureResource.h"
NinePatchComponent::NinePatchComponent(const std::string& path, NinePatchComponent::NinePatchComponent(const std::string& path)
unsigned int edgeColor,
unsigned int centerColor)
: mRenderer {Renderer::getInstance()} : mRenderer {Renderer::getInstance()}
, mVertices {nullptr}
, mPath {path} , mPath {path}
, mCornerSize {16.0f, 16.0f} , mCornerSize {16.0f, 16.0f}
, mSharpCorners {false} , mSharpCorners {false}
, mEdgeColor {edgeColor} , mFrameColor {mMenuColorFrame}
, mCenterColor {centerColor}
{ {
if (!mPath.empty()) if (!mPath.empty())
buildVertices(); buildVertices();
} }
NinePatchComponent::~NinePatchComponent()
{
if (mVertices != nullptr)
delete[] mVertices;
}
void NinePatchComponent::updateColors() void NinePatchComponent::updateColors()
{ {
for (int i = 0; i < 6 * 9; ++i) if (mVertices == nullptr)
mVertices[i].color = mEdgeColor; return;
for (int i = 6 * 4; i < 6; ++i) for (int i {0}; i < 6 * 9; ++i)
mVertices[(6 * 4) + i].color = mCenterColor; (*mVertices)[i].color = mFrameColor;
} }
void NinePatchComponent::buildVertices() void NinePatchComponent::buildVertices()
@ -48,9 +38,7 @@ void NinePatchComponent::buildVertices()
if (mSize.x == 0.0f || mSize.y == 0.0f) if (mSize.x == 0.0f || mSize.y == 0.0f)
return; return;
if (mVertices != nullptr) mVertices.reset();
delete[] mVertices;
glm::vec2 relCornerSize {0.0f, 0.0f}; glm::vec2 relCornerSize {0.0f, 0.0f};
// Don't scale the rasterized version of the frame as it would look bad. // 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); mTexture->rasterizeAt(texSize.x, texSize.y);
if (mTexture->getSize() == glm::ivec2 {}) { if (mTexture->getSize() == glm::ivec2 {0, 0}) {
mVertices = nullptr; LOG(LogError) << "NinePatchComponent has no texture";
LOG(LogWarning) << "NinePatchComponent has no texture";
return; return;
} }
mVertices = new Renderer::Vertex[6 * 9]; mVertices = std::make_unique<std::vector<Renderer::Vertex>>(6 * 9);
const float imgSizeX[3] {relCornerSize.x, mSize.x - relCornerSize.x * 2.0f, relCornerSize.x}; 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}; 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]}; const float texPosY[3] {1.0f, 1.0f + texSizeY[0], 1.0f + texSizeY[0] + texSizeY[1]};
// clang-format on // 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 sliceX {slice % 3};
const int sliceY {slice / 3}; const int sliceY {slice / 3};
const glm::vec2 imgPos {imgPosX[sliceX], imgPosY[sliceY]}; const glm::vec2 imgPos {imgPosX[sliceX], imgPosY[sliceY]};
@ -104,19 +91,19 @@ void NinePatchComponent::buildVertices()
const glm::vec2 texSizeSlice {texSizeX[sliceX], texSizeY[sliceY]}; const glm::vec2 texSizeSlice {texSizeX[sliceX], texSizeY[sliceY]};
// clang-format off // clang-format off
mVertices[v + 1] = {{imgPos.x , imgPos.y }, {texPos.x, texPos.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 + 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 + 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 + 4] = {{imgPos.x + imgSize.x, imgPos.y + imgSize.y}, {texPos.x + texSizeSlice.x, texPos.y + texSizeSlice.y}, 0};
// clang-format on // clang-format on
// Round vertices. // Round vertices.
for (int i = 1; i < 5; ++i) for (int i {1}; i < 5; ++i)
mVertices[v + i].position = glm::round(mVertices[v + i].position); (*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. // Make duplicates of first and last vertex so this can be rendered as a triangle strip.
mVertices[v + 0] = mVertices[v + 1]; (*mVertices)[v + 0] = (*mVertices)[v + 1];
mVertices[v + 5] = mVertices[v + 4]; (*mVertices)[v + 5] = (*mVertices)[v + 4];
v += 6; v += 6;
} }
@ -133,10 +120,10 @@ void NinePatchComponent::render(const glm::mat4& parentTrans)
if (mTexture && mVertices != nullptr) { if (mTexture && mVertices != nullptr) {
mRenderer->setMatrix(trans); mRenderer->setMatrix(trans);
mVertices->opacity = mOpacity; (*mVertices)[0].opacity = mOpacity;
mVertices->shaderFlags = Renderer::ShaderFlags::PREMULTIPLIED; (*mVertices)[0].shaderFlags = Renderer::ShaderFlags::PREMULTIPLIED;
mTexture->bind(); mTexture->bind();
mRenderer->drawTriangleStrips(&mVertices[0], 6 * 9); mRenderer->drawTriangleStrips(&mVertices->at(0), 6 * 9);
} }
renderChildren(trans); renderChildren(trans);
@ -159,14 +146,8 @@ void NinePatchComponent::setImagePath(const std::string& path)
buildVertices(); buildVertices();
} }
void NinePatchComponent::setEdgeColor(unsigned int edgeColor) void NinePatchComponent::setFrameColor(unsigned int frameColor)
{ {
mEdgeColor = edgeColor; mFrameColor = frameColor;
updateColors();
}
void NinePatchComponent::setCenterColor(unsigned int centerColor)
{
mCenterColor = centerColor;
updateColors(); updateColors();
} }

View file

@ -29,10 +29,7 @@ class TextureResource;
class NinePatchComponent : public GuiComponent class NinePatchComponent : public GuiComponent
{ {
public: public:
NinePatchComponent(const std::string& path = "", NinePatchComponent(const std::string& path = "");
unsigned int edgeColor = 0xFFFFFFFF,
unsigned int centerColor = 0xFFFFFFFF);
virtual ~NinePatchComponent();
void render(const glm::mat4& parentTrans) override; void render(const glm::mat4& parentTrans) override;
@ -42,10 +39,7 @@ public:
glm::vec2 padding = {-32.0f, -32.0f}); glm::vec2 padding = {-32.0f, -32.0f});
void setImagePath(const std::string& path); void setImagePath(const std::string& path);
// Apply a color shift to the "edge" parts of the ninepatch. void setFrameColor(unsigned int frameColor);
void setEdgeColor(unsigned int edgeColor);
// Apply a color shift to the "center" part of the ninepatch.
void setCenterColor(unsigned int centerColor);
const glm::vec2& getCornerSize() const { return mCornerSize; } const glm::vec2& getCornerSize() const { return mCornerSize; }
void setCornerSize(const glm::vec2& size) void setCornerSize(const glm::vec2& size)
@ -60,13 +54,12 @@ private:
void updateColors(); void updateColors();
Renderer* mRenderer; Renderer* mRenderer;
Renderer::Vertex* mVertices; std::unique_ptr<std::vector<Renderer::Vertex>> mVertices;
std::string mPath; std::string mPath;
glm::vec2 mCornerSize; glm::vec2 mCornerSize;
bool mSharpCorners; bool mSharpCorners;
unsigned int mEdgeColor; unsigned int mFrameColor;
unsigned int mCenterColor;
std::shared_ptr<TextureResource> mTexture; std::shared_ptr<TextureResource> mTexture;
}; };

View file

@ -45,7 +45,7 @@ public:
{ {
auto font {Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)}; auto font {Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)};
mText.setFont(font); mText.setFont(font);
mText.setColor(0x777777FF); mText.setColor(mMenuColorPrimary);
mText.setHorizontalAlignment(ALIGN_CENTER); mText.setHorizontalAlignment(ALIGN_CENTER);
addChild(&mText); addChild(&mText);
@ -54,14 +54,17 @@ public:
if (mMultiSelect) { if (mMultiSelect) {
mRightArrow.setImage(":/graphics/arrow.svg"); mRightArrow.setImage(":/graphics/arrow.svg");
mRightArrow.setColorShift(mMenuColorPrimary);
addChild(&mRightArrow); addChild(&mRightArrow);
} }
else { else {
mLeftArrow.setImage(":/graphics/option_arrow.svg"); mLeftArrow.setImage(":/graphics/option_arrow.svg");
mLeftArrow.setColorShift(mMenuColorPrimary);
mLeftArrow.setFlipX(true); mLeftArrow.setFlipX(true);
addChild(&mLeftArrow); addChild(&mLeftArrow);
mRightArrow.setImage(":/graphics/option_arrow.svg"); mRightArrow.setImage(":/graphics/option_arrow.svg");
mRightArrow.setColorShift(mMenuColorPrimary);
addChild(&mRightArrow); addChild(&mRightArrow);
} }
@ -431,7 +434,7 @@ private:
for (auto it = mParent->mEntries.begin(); it != mParent->mEntries.end(); ++it) { for (auto it = mParent->mEntries.begin(); it != mParent->mEntries.end(); ++it) {
row.elements.clear(); row.elements.clear();
auto textComponent = std::make_shared<TextComponent>( auto textComponent = std::make_shared<TextComponent>(
Utils::String::toUpper(it->name), font, 0x777777FF); Utils::String::toUpper(it->name), font, mMenuColorPrimary);
row.addElement(textComponent, true); row.addElement(textComponent, true);
if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) { if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) {
@ -446,6 +449,7 @@ private:
auto checkbox = std::make_shared<ImageComponent>(); auto checkbox = std::make_shared<ImageComponent>();
checkbox->setResize(0, font->getLetterHeight()); checkbox->setResize(0, font->getLetterHeight());
checkbox->setImage(it->selected ? CHECKED_PATH : UNCHECKED_PATH); checkbox->setImage(it->selected ? CHECKED_PATH : UNCHECKED_PATH);
checkbox->setColorShift(mMenuColorPrimary);
row.addElement(checkbox, false); row.addElement(checkbox, false);
if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected)

View file

@ -17,8 +17,8 @@ RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation)
: mRenderer {Renderer::getInstance()} : mRenderer {Renderer::getInstance()}
, mValue {0.5f} , mValue {0.5f}
, mImageRatio {1.0f} , mImageRatio {1.0f}
, mColorOriginalValue {DEFAULT_COLORSHIFT} , mColorOriginalValue {mMenuColorPrimary}
, mColorChangedValue {DEFAULT_COLORSHIFT} , mColorChangedValue {mMenuColorPrimary}
, mColorizeChanges {colorizeChanges} , mColorizeChanges {colorizeChanges}
, mOverlay {true} , mOverlay {true}
{ {
@ -29,11 +29,13 @@ RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation)
mIconFilled.setTileSize(mSize.y, mSize.y); mIconFilled.setTileSize(mSize.y, mSize.y);
mIconFilled.setDynamic(false); mIconFilled.setDynamic(false);
mIconFilled.setLinearInterpolation(linearInterpolation); mIconFilled.setLinearInterpolation(linearInterpolation);
mIconFilled.setColorShift(mMenuColorPrimary);
mIconUnfilled.setResize(mSize, false); mIconUnfilled.setResize(mSize, false);
mIconUnfilled.setTileSize(mSize.y, mSize.y); mIconUnfilled.setTileSize(mSize.y, mSize.y);
mIconUnfilled.setDynamic(false); mIconUnfilled.setDynamic(false);
mIconUnfilled.setLinearInterpolation(linearInterpolation); mIconUnfilled.setLinearInterpolation(linearInterpolation);
mIconUnfilled.setColorShift(mMenuColorPrimary);
mIconFilled.setImage(std::string(":/graphics/star_filled.svg"), true); mIconFilled.setImage(std::string(":/graphics/star_filled.svg"), true);
mIconUnfilled.setImage(std::string(":/graphics/star_unfilled.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 // This should only happen if an external scraper has been used or if the file has
// been manually edited. // been manually edited.
if (mColorizeChanges && mValue != stof(value)) { if (mColorizeChanges && mValue != stof(value)) {
mOriginalValue = ICONCOLOR_USERMARKED; mOriginalValue = mMenuColorBlue;
mIconFilled.setColorShift(0x449944FF); mIconFilled.setColorShift(0x449944FF);
} }
@ -267,6 +269,10 @@ void RatingComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
mIconFilled.setColorShift(elem->get<unsigned int>("color")); mIconFilled.setColorShift(elem->get<unsigned int>("color"));
mIconUnfilled.setColorShift(elem->get<unsigned int>("color")); mIconUnfilled.setColorShift(elem->get<unsigned int>("color"));
} }
else {
mIconFilled.setColorShift(0xFFFFFFFF);
mIconFilled.setColorShift(0xFFFFFFFF);
}
} }
} }

View file

@ -34,6 +34,8 @@ public:
void onSizeChanged() override; void onSizeChanged() override;
void setDimming(float dimming) 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 setOriginalColor(unsigned int color) override { mColorOriginalValue = color; }
void setChangedColor(unsigned int color) override { mColorChangedValue = color; } void setChangedColor(unsigned int color) override { mColorChangedValue = color; }

View file

@ -11,10 +11,11 @@
#define FADE_IN_TIME 90.0f #define FADE_IN_TIME 90.0f
#include "GuiComponent.h"
#include "animations/LambdaAnimation.h" #include "animations/LambdaAnimation.h"
#include "components/ComponentList.h" #include "components/ComponentList.h"
class ScrollIndicatorComponent class ScrollIndicatorComponent : public GuiComponent
{ {
public: public:
ScrollIndicatorComponent(std::shared_ptr<ComponentList> componentList, ScrollIndicatorComponent(std::shared_ptr<ComponentList> componentList,
@ -27,6 +28,9 @@ public:
scrollUp->setImage(":/graphics/scroll_up.svg"); scrollUp->setImage(":/graphics/scroll_up.svg");
scrollDown->setImage(":/graphics/scroll_down.svg"); scrollDown->setImage(":/graphics/scroll_down.svg");
scrollUp->setColorShift(mMenuColorScrollIndicators);
scrollDown->setColorShift(mMenuColorScrollIndicators);
scrollUp->setOpacity(0.0f); scrollUp->setOpacity(0.0f);
scrollDown->setOpacity(0.0f); scrollDown->setOpacity(0.0f);

View file

@ -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.setResize(0.0f, std::round(mSize.y * 0.7f));
mKnob.setOrigin(0.5f, 0.0f); mKnob.setOrigin(0.5f, 0.0f);
mKnob.setImage(":/graphics/slider_knob.svg"); mKnob.setImage(":/graphics/slider_knob.svg");
mKnob.setColorShift(mMenuColorSlider);
mKnobDisabled.setResize(0.0f, std::round(mSize.y * 0.7f)); mKnobDisabled.setResize(0.0f, std::round(mSize.y * 0.7f));
mKnobDisabled.setOrigin(0.5f, 0.0f); 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) bool SliderComponent::input(InputConfig* config, Input input)
@ -106,9 +108,10 @@ void SliderComponent::render(const glm::mat4& parentTrans)
if (mTextCache) if (mTextCache)
mFont->renderTextCache(mTextCache.get()); mFont->renderTextCache(mTextCache.get());
mRenderer->drawRect(mKnob.getSize().x / 2.0f, mBarPosY, width, mBarHeight, mRenderer->drawRect(
0x77777700 | static_cast<unsigned int>(mOpacity * 255.0f), mKnob.getSize().x / 2.0f, mBarPosY, width, mBarHeight,
0x77777700 | static_cast<unsigned int>(mOpacity * 255.0f)); (mMenuColorSlider & 0xFFFFFF00) | static_cast<unsigned int>(mOpacity * 255.0f),
(mMenuColorSlider & 0xFFFFFF00) | static_cast<unsigned int>(mOpacity * 255.0f));
if (mOpacity > DISABLED_OPACITY) if (mOpacity > DISABLED_OPACITY)
mKnob.render(trans); mKnob.render(trans);
@ -156,7 +159,7 @@ void SliderComponent::onValueChanged()
glm::vec2 textSize {mFont->sizeText(max)}; glm::vec2 textSize {mFont->sizeText(max)};
mTextCache = std::shared_ptr<TextCache>(mFont->buildTextCache( mTextCache = std::shared_ptr<TextCache>(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. mTextCache->metrics.size.x = textSize.x; // Fudge the width.
} }

View file

@ -13,11 +13,12 @@
SwitchComponent::SwitchComponent(bool state) SwitchComponent::SwitchComponent(bool state)
: mState {state} : mState {state}
, mOriginalValue {state} , mOriginalValue {state}
, mColorOriginalValue {DEFAULT_COLORSHIFT} , mColorOriginalValue {mMenuColorPrimary}
, mColorChangedValue {DEFAULT_COLORSHIFT} , mColorChangedValue {mMenuColorPrimary}
{ {
mImage.setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()); mImage.setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
mImage.setImage(":/graphics/off.svg"); mImage.setImage(":/graphics/off.svg");
mImage.setColorShift(mMenuColorPrimary);
mSize = mImage.getSize(); mSize = mImage.getSize();
} }
@ -43,7 +44,13 @@ bool SwitchComponent::input(InputConfig* config, Input input)
void SwitchComponent::render(const glm::mat4& parentTrans) void SwitchComponent::render(const glm::mat4& parentTrans)
{ {
glm::mat4 trans {parentTrans * getTransform()}; 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.render(trans);
mImage.setOpacity(imageOpacity);
renderChildren(trans); renderChildren(trans);
} }

View file

@ -12,7 +12,6 @@
#include "GuiComponent.h" #include "GuiComponent.h"
#include "components/ImageComponent.h" #include "components/ImageComponent.h"
// A simple "on/off" switch.
class SwitchComponent : public GuiComponent class SwitchComponent : public GuiComponent
{ {
public: public:

View file

@ -288,9 +288,8 @@ void TextComponent::onTextChanged()
return; return;
} }
if (!mFont || text.empty() || mSize.x < 0.0f) { if (!mFont || text.empty() || mSize.x < 0.0f)
return; return;
}
float lineHeight {0.0f}; float lineHeight {0.0f};
const bool isScrollable {mParent && mParent->isScrollable()}; const bool isScrollable {mParent && mParent->isScrollable()};

View file

@ -41,6 +41,7 @@ void TextEditComponent::onFocusGained()
{ {
mFocused = true; mFocused = true;
mBox.setImagePath(":/graphics/textinput_focused.svg"); mBox.setImagePath(":/graphics/textinput_focused.svg");
mBox.setFrameColor(mMenuColorTextInputFrameFocused);
startEditing(); startEditing();
} }
@ -48,6 +49,7 @@ void TextEditComponent::onFocusLost()
{ {
mFocused = false; mFocused = false;
mBox.setImagePath(":/graphics/textinput.svg"); mBox.setImagePath(":/graphics/textinput.svg");
mBox.setFrameColor(mMenuColorTextInputFrameUnfocused);
} }
void TextEditComponent::onSizeChanged() void TextEditComponent::onSizeChanged()
@ -270,7 +272,8 @@ void TextEditComponent::onTextChanged()
mWrappedText = mWrappedText =
(isMultiline() ? mFont->wrapText(mText, getTextAreaSize().x, 0.0f, 1.5f, true) : mText); (isMultiline() ? mFont->wrapText(mText, getTextAreaSize().x, 0.0f, 1.5f, true) : mText);
mTextCache = std::unique_ptr<TextCache>(mFont->buildTextCache( mTextCache = std::unique_ptr<TextCache>(mFont->buildTextCache(
mWrappedText, 0.0f, 0.0f, 0x77777700 | static_cast<unsigned char>(mOpacity * 255.0f))); mWrappedText, 0.0f, 0.0f,
mMenuColorKeyboardText | static_cast<unsigned char>(mOpacity * 255.0f)));
if (mCursor > static_cast<int>(mText.length())) if (mCursor > static_cast<int>(mText.length()))
mCursor = static_cast<int>(mText.length()); mCursor = static_cast<int>(mText.length());
@ -334,13 +337,13 @@ void TextEditComponent::render(const glm::mat4& parentTrans)
if (!mEditing) { if (!mEditing) {
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f, mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight, 2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight,
0xC7C7C7FF, 0xC7C7C7FF); mMenuColorKeyboardCursorUnfocused, mMenuColorKeyboardCursorUnfocused);
} }
if (mEditing && mBlinkTime < BLINKTIME / 2) { if (mEditing && mBlinkTime < BLINKTIME / 2) {
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f, mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight, 2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight,
0x777777FF, 0x777777FF); mMenuColorKeyboardCursorFocused, mMenuColorKeyboardCursorFocused);
} }
} }

View file

@ -34,8 +34,9 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun,
addChild(&mGrid); addChild(&mGrid);
// Title. // Title.
mTitle = std::make_shared<TextComponent>(firstRun ? "WELCOME" : "CONFIGURE INPUT DEVICE", mTitle =
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); std::make_shared<TextComponent>(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}, mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {1, 1},
GridFlags::BORDER_BOTTOM); GridFlags::BORDER_BOTTOM);
@ -52,26 +53,26 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun,
deviceInfo << " (ONLY ACCEPTING INPUT FROM FIRST CONTROLLER)"; deviceInfo << " (ONLY ACCEPTING INPUT FROM FIRST CONTROLLER)";
mDeviceInfo = std::make_shared<TextComponent>(deviceInfo.str(), Font::get(FONT_SIZE_SMALL), mDeviceInfo = std::make_shared<TextComponent>(deviceInfo.str(), Font::get(FONT_SIZE_SMALL),
0x999999FF, ALIGN_CENTER); mMenuColorSecondary, ALIGN_CENTER);
mGrid.setEntry(mDeviceInfo, glm::ivec2 {0, 1}, false, true); mGrid.setEntry(mDeviceInfo, glm::ivec2 {0, 1}, false, true);
// Message. // Message.
if (numDevices > 0) { if (numDevices > 0) {
mMsg1 = std::make_shared<TextComponent>( mMsg1 = std::make_shared<TextComponent>(
"HOLD A BUTTON ON YOUR GAMEPAD OR KEYBOARD TO CONFIGURE IT", Font::get(FONT_SIZE_SMALL), "HOLD A BUTTON ON YOUR GAMEPAD OR KEYBOARD TO CONFIGURE IT", Font::get(FONT_SIZE_SMALL),
0x777777FF, ALIGN_CENTER); mMenuColorPrimary, ALIGN_CENTER);
} }
else { else {
mMsg1 = mMsg1 = std::make_shared<TextComponent>("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT",
std::make_shared<TextComponent>("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT", Font::get(FONT_SIZE_SMALL), mMenuColorPrimary,
Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER); ALIGN_CENTER);
} }
mGrid.setEntry(mMsg1, glm::ivec2 {0, 2}, false, true); 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)" : const std::string msg2str {firstRun ? "PRESS ESC TO SKIP (OR F4 TO QUIT AT ANY TIME)" :
"PRESS ESC TO CANCEL"}; "PRESS ESC TO CANCEL"};
mMsg2 = std::make_shared<TextComponent>(msg2str, Font::get(FONT_SIZE_SMALL), 0x777777FF, mMsg2 = std::make_shared<TextComponent>(msg2str, Font::get(FONT_SIZE_SMALL), mMenuColorPrimary,
ALIGN_CENTER); ALIGN_CENTER);
mGrid.setEntry(mMsg2, glm::ivec2 {0, 3}, false, true); mGrid.setEntry(mMsg2, glm::ivec2 {0, 3}, false, true);
@ -156,7 +157,8 @@ void GuiDetectDevice::update(int deltaTime)
mHoldTime -= deltaTime; mHoldTime -= deltaTime;
// Fade in device name. // Fade in device name.
const float t {std::fabs((static_cast<float>(mHoldTime) / HOLD_TIME) - 1.0f)}; const float t {std::fabs((static_cast<float>(mHoldTime) / HOLD_TIME) - 1.0f)};
mDeviceHeld->setColor(0x44444400 | static_cast<unsigned char>(t * 255.0f)); mDeviceHeld->setColor(mMenuColorDetectDeviceHeld |
static_cast<unsigned char>(t * 255.0f));
if (mHoldTime <= 0) { if (mHoldTime <= 0) {
// A device was selected. // A device was selected.
mWindow->pushGui(new GuiInputConfig(mHoldingConfig, true, mDoneCallback)); mWindow->pushGui(new GuiInputConfig(mHoldingConfig, true, mDoneCallback));

View file

@ -25,8 +25,8 @@ GuiInfoPopup::GuiInfoPopup(std::string message, int duration)
float maxWidth {Renderer::getScreenWidth() * 0.9f}; float maxWidth {Renderer::getScreenWidth() * 0.9f};
float maxHeight {Renderer::getScreenHeight() * 0.2f}; float maxHeight {Renderer::getScreenHeight() * 0.2f};
std::shared_ptr<TextComponent> s { std::shared_ptr<TextComponent> s {std::make_shared<TextComponent>(
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MINI), 0x444444FF, ALIGN_CENTER)}; "", 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. // We do this to force the text container to resize and return the actual expected popup size.
s->setSize(0.0f, 0.0f); s->setSize(0.0f, 0.0f);
@ -115,7 +115,7 @@ bool GuiInfoPopup::updateState()
mGrid->setOpacity(mAlpha); mGrid->setOpacity(mAlpha);
// Apply fade-in effect to popup frame. // Apply fade-in effect to popup frame.
mFrame->setEdgeColor(0xFFFFFF00 | static_cast<unsigned char>(mAlpha * 255.0f)); mFrame->setFrameColor((mMenuColorFrame & 0xFFFFFF00) |
mFrame->setCenterColor(0xFFFFFF00 | static_cast<unsigned char>(mAlpha * 255.0f)); static_cast<unsigned char>(mAlpha * 255.0f));
return true; return true;
} }

View file

@ -53,8 +53,8 @@ GuiInputConfig::GuiInputConfig(InputConfig* target,
// 0 is a spacer row. // 0 is a spacer row.
mGrid.setEntry(std::make_shared<GuiComponent>(), glm::ivec2 {0, 0}, false); mGrid.setEntry(std::make_shared<GuiComponent>(), glm::ivec2 {0, 0}, false);
mTitle = std::make_shared<TextComponent>("CONFIGURING", Font::get(FONT_SIZE_LARGE), 0x555555FF, mTitle = std::make_shared<TextComponent>("CONFIGURING", Font::get(FONT_SIZE_LARGE),
ALIGN_CENTER); mMenuColorTitle, ALIGN_CENTER);
mGrid.setEntry(mTitle, glm::ivec2 {0, 1}, false, true); mGrid.setEntry(mTitle, glm::ivec2 {0, 1}, false, true);
std::stringstream ss; std::stringstream ss;
@ -64,12 +64,14 @@ GuiInputConfig::GuiInputConfig(InputConfig* target,
ss << "CEC"; ss << "CEC";
else else
ss << "GAMEPAD " << (target->getDeviceId() + 1) << " (" << target->getDeviceName() << ")"; ss << "GAMEPAD " << (target->getDeviceId() + 1) << " (" << target->getDeviceName() << ")";
mSubtitle1 = std::make_shared<TextComponent>( mSubtitle1 = std::make_shared<TextComponent>(Utils::String::toUpper(ss.str()),
Utils::String::toUpper(ss.str()), Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary,
ALIGN_CENTER);
mGrid.setEntry(mSubtitle1, glm::ivec2 {0, 2}, false, true); mGrid.setEntry(mSubtitle1, glm::ivec2 {0, 2}, false, true);
mSubtitle2 = std::make_shared<TextComponent>( mSubtitle2 = std::make_shared<TextComponent>("HOLD ANY BUTTON 1 SECOND TO SKIP",
"HOLD ANY BUTTON 1 SECOND TO SKIP", Font::get(FONT_SIZE_SMALL), 0x999999FF, ALIGN_CENTER); Font::get(FONT_SIZE_SMALL), mMenuColorSecondary,
ALIGN_CENTER);
// The opacity will be set to visible for any row that is skippable. // The opacity will be set to visible for any row that is skippable.
mSubtitle2->setOpacity(0.0f); mSubtitle2->setOpacity(0.0f);
@ -86,7 +88,7 @@ GuiInputConfig::GuiInputConfig(InputConfig* target,
auto icon = std::make_shared<ImageComponent>(); auto icon = std::make_shared<ImageComponent>();
icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 1.25f); icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 1.25f);
icon->setImage(sGuiInputConfigList[i].icon); icon->setImage(sGuiInputConfigList[i].icon);
icon->setColorShift(0x777777FF); icon->setColorShift(mMenuColorPrimary);
row.addElement(icon, false); row.addElement(icon, false);
// Spacer between icon and text. // Spacer between icon and text.
@ -95,11 +97,12 @@ GuiInputConfig::GuiInputConfig(InputConfig* target,
row.addElement(spacer, false); row.addElement(spacer, false);
auto text = std::make_shared<TextComponent>(sGuiInputConfigList[i].dispName, auto text = std::make_shared<TextComponent>(sGuiInputConfigList[i].dispName,
Font::get(FONT_SIZE_MEDIUM), 0x777777FF); Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
row.addElement(text, true); row.addElement(text, true);
auto mapping = std::make_shared<TextComponent>( auto mapping = std::make_shared<TextComponent>("-NOT DEFINED-",
"-NOT DEFINED-", Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), 0x999999FF, ALIGN_RIGHT); Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT),
mMenuColorSecondary, ALIGN_RIGHT);
setNotDefined(mapping); // Overrides the text and color set above. setNotDefined(mapping); // Overrides the text and color set above.
row.addElement(mapping, true); row.addElement(mapping, true);
mMappings.push_back(mapping); mMappings.push_back(mapping);
@ -179,7 +182,7 @@ GuiInputConfig::GuiInputConfig(InputConfig* target,
buttons.push_back( buttons.push_back(
std::make_shared<ButtonComponent>("OK", "ok", [okFunction] { okFunction(); })); std::make_shared<ButtonComponent>("OK", "ok", [okFunction] { okFunction(); }));
mButtonGrid = makeButtonGrid(buttons); mButtonGrid = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 6}, true, false); 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 // 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; std::stringstream ss;
ss << "HOLD FOR " << HOLD_TO_SKIP_MS / 1000 - curSec << "S TO SKIP"; ss << "HOLD FOR " << HOLD_TO_SKIP_MS / 1000 - curSec << "S TO SKIP";
text->setText(ss.str()); text->setText(ss.str());
text->setColor(0x777777FF); text->setColor(mMenuColorPrimary);
} }
} }
} }
@ -342,25 +345,25 @@ void GuiInputConfig::rowDone()
void GuiInputConfig::error(const std::shared_ptr<TextComponent>& text, const std::string& /*msg*/) void GuiInputConfig::error(const std::shared_ptr<TextComponent>& text, const std::string& /*msg*/)
{ {
text->setText("ALREADY TAKEN"); text->setText("ALREADY TAKEN");
text->setColor(0x656565FF); text->setColor(mMenuColorPrimary);
} }
void GuiInputConfig::setPress(const std::shared_ptr<TextComponent>& text) void GuiInputConfig::setPress(const std::shared_ptr<TextComponent>& text)
{ {
text->setText("PRESS ANYTHING"); text->setText("PRESS ANYTHING");
text->setColor(0x656565FF); text->setColor(mMenuColorPrimary);
} }
void GuiInputConfig::setNotDefined(const std::shared_ptr<TextComponent>& text) void GuiInputConfig::setNotDefined(const std::shared_ptr<TextComponent>& text)
{ {
text->setText("-NOT DEFINED-"); text->setText("-NOT DEFINED-");
text->setColor(0x999999FF); text->setColor(mMenuColorSecondary);
} }
void GuiInputConfig::setAssignedTo(const std::shared_ptr<TextComponent>& text, Input input) void GuiInputConfig::setAssignedTo(const std::shared_ptr<TextComponent>& text, Input input)
{ {
text->setText(Utils::String::toUpper(input.string())); text->setText(Utils::String::toUpper(input.string()));
text->setColor(0x777777FF); text->setColor(mMenuColorPrimary);
} }
bool GuiInputConfig::assign(Input input, int inputId) bool GuiInputConfig::assign(Input input, int inputId)

View file

@ -46,7 +46,7 @@ GuiMsgBox::GuiMsgBox(const HelpStyle& helpstyle,
const float minWidth { const float minWidth {
floorf(glm::clamp(0.30f * aspectValue, 0.10f, 0.50f) * mRenderer->getScreenWidth())}; floorf(glm::clamp(0.30f * aspectValue, 0.10f, 0.50f) * mRenderer->getScreenWidth())};
mMsg = std::make_shared<TextComponent>(text, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, mMsg = std::make_shared<TextComponent>(text, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary,
ALIGN_CENTER); ALIGN_CENTER);
mGrid.setEntry(mMsg, glm::ivec2 {0, 0}, false, false); mGrid.setEntry(mMsg, glm::ivec2 {0, 0}, false, false);
@ -75,7 +75,7 @@ GuiMsgBox::GuiMsgBox(const HelpStyle& helpstyle,
} }
// Put the buttons into a ComponentGrid. // 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}, mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 1}, true, false, glm::ivec2 {1, 1},
GridFlags::BORDER_TOP); GridFlags::BORDER_TOP);

View file

@ -114,8 +114,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
addChild(&mBackground); addChild(&mBackground);
addChild(&mGrid); addChild(&mGrid);
mTitle = std::make_shared<TextComponent>(Utils::String::toUpper(title), mTitle = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); Utils::String::toUpper(title), Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER);
std::vector<std::vector<std::string>> kbLayout; std::vector<std::vector<std::string>> kbLayout;
@ -143,11 +143,11 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
if (mComplexMode) { if (mComplexMode) {
mInfoString = std::make_shared<TextComponent>(infoString, Font::get(FONT_SIZE_MEDIUM), mInfoString = std::make_shared<TextComponent>(infoString, Font::get(FONT_SIZE_MEDIUM),
0x555555FF, ALIGN_CENTER); mMenuColorTitle, ALIGN_CENTER);
mGrid.setEntry(mInfoString, glm::ivec2 {0, yPos}, false, true); mGrid.setEntry(mInfoString, glm::ivec2 {0, yPos}, false, true);
mDefaultValue = std::make_shared<TextComponent>(defaultValue, Font::get(FONT_SIZE_SMALL), mDefaultValue = std::make_shared<TextComponent>(defaultValue, Font::get(FONT_SIZE_SMALL),
0x555555FF, ALIGN_CENTER); mMenuColorTitle, ALIGN_CENTER);
mGrid.setEntry(mDefaultValue, glm::ivec2 {0, yPos + 1}, false, true); mGrid.setEntry(mDefaultValue, glm::ivec2 {0, yPos + 1}, false, true);
yPos += 2; yPos += 2;
} }
@ -585,12 +585,12 @@ void GuiTextEditKeyboardPopup::shiftKeys()
mShift = !mShift; mShift = !mShift;
if (mShift) { if (mShift) {
mShiftButton->setFlatColorFocused(0xF26767FF); mShiftButton->setFlatColorFocused(mMenuColorKeyboardModifier);
mShiftButton->setFlatColorUnfocused(0xF26767FF); mShiftButton->setFlatColorUnfocused(mMenuColorKeyboardModifier);
} }
else { else {
mShiftButton->setFlatColorFocused(0x878787FF); mShiftButton->setFlatColorFocused(mMenuColorButtonFlatFocused);
mShiftButton->setFlatColorUnfocused(0x60606025); mShiftButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused);
} }
if (mAlt && mShift) { if (mAlt && mShift) {
@ -618,12 +618,12 @@ void GuiTextEditKeyboardPopup::altKeys()
mAlt = !mAlt; mAlt = !mAlt;
if (mAlt) { if (mAlt) {
mAltButton->setFlatColorFocused(0xF26767FF); mAltButton->setFlatColorFocused(mMenuColorKeyboardModifier);
mAltButton->setFlatColorUnfocused(0xF26767FF); mAltButton->setFlatColorUnfocused(mMenuColorKeyboardModifier);
} }
else { else {
mAltButton->setFlatColorFocused(0x878787FF); mAltButton->setFlatColorFocused(mMenuColorButtonFlatFocused);
mAltButton->setFlatColorUnfocused(0x60606025); mAltButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused);
} }
if (mShift && mAlt) { if (mShift && mAlt) {

View file

@ -45,14 +45,14 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
addChild(&mBackground); addChild(&mBackground);
addChild(&mGrid); addChild(&mGrid);
mTitle = std::make_shared<TextComponent>(Utils::String::toUpper(title), mTitle = std::make_shared<TextComponent>(
Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); Utils::String::toUpper(title), Font::get(FONT_SIZE_MEDIUM), mMenuColorTitle, ALIGN_CENTER);
if (mComplexMode) { if (mComplexMode) {
mInfoString = std::make_shared<TextComponent>(infoString, Font::get(FONT_SIZE_SMALL), mInfoString = std::make_shared<TextComponent>(infoString, Font::get(FONT_SIZE_SMALL),
0x555555FF, ALIGN_CENTER); mMenuColorTitle, ALIGN_CENTER);
mDefaultValue = std::make_shared<TextComponent>(defaultValue, Font::get(FONT_SIZE_SMALL), mDefaultValue = std::make_shared<TextComponent>(defaultValue, Font::get(FONT_SIZE_SMALL),
0x555555FF, ALIGN_CENTER); mMenuColorTitle, ALIGN_CENTER);
} }
mText = std::make_shared<TextEditComponent>(); mText = std::make_shared<TextEditComponent>();
@ -79,7 +79,7 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
buttons.push_back( buttons.push_back(
std::make_shared<ButtonComponent>("CANCEL", "discard changes", [this] { delete this; })); std::make_shared<ButtonComponent>("CANCEL", "discard changes", [this] { delete this; }));
mButtonGrid = makeButtonGrid(buttons); mButtonGrid = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true); mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true);

View file

@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="36" height="64" version="1.1" viewBox="0 0 36 64" xmlns="http://www.w3.org/2000/svg"> <svg
<path d="m2 2 l32 30 l-32 30" fill="none" stroke="#777" stroke-linejoin="round" stroke-linecap="round" stroke-width="4"/> width="36"
</svg> height="64"
version="1.1"
viewBox="0 0 36 64"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path
d="m2 2 l32 30 l-32 30"
fill="none"
stroke="#777"
stroke-linejoin="round"
stroke-linecap="round"
stroke-width="4"
id="path2"
style="stroke:#ffffff;stroke-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 473 B

View file

@ -1,7 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777"/> width="64"
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> height="64"
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> version="1.1"
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> viewBox="0 0 64 64"
id="svg10"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<rect
style="fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3"
width="28.759064"
height="28.759064"
x="0"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6"
width="28.759064"
height="28.759064"
x="35.240936"
y="35.240936"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0"
width="28.759064"
height="28.759064"
x="35.240936"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0-6"
width="28.759064"
height="28.759064"
x="0"
y="35.240936"
rx="3.10761"
ry="3.10761" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 482 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,7 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> width="64"
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777"/> height="64"
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> version="1.1"
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> viewBox="0 0 64 64"
id="svg10"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<rect
style="fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3"
width="28.759064"
height="28.759064"
x="35.240936"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6"
width="28.759064"
height="28.759064"
x="35.240936"
y="35.240936"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0"
width="28.759064"
height="28.759064"
x="0"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0-6"
width="28.759064"
height="28.759064"
x="0"
y="35.240936"
rx="3.10761"
ry="3.10761" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 482 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,7 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> width="64"
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> height="64"
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> version="1.1"
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777"/> viewBox="0 0 64 64"
id="svg10"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<rect
style="fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3"
width="28.759064"
height="28.759064"
x="35.240936"
y="35.240936"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6"
width="28.759064"
height="28.759064"
x="0"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0"
width="28.759064"
height="28.759064"
x="35.240936"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0-6"
width="28.759064"
height="28.759064"
x="0"
y="35.240936"
rx="3.10761"
ry="3.10761" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 482 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,7 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> width="64"
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> height="64"
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777"/> version="1.1"
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/> viewBox="0 0 64 64"
id="svg10"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<rect
style="fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3"
width="28.759064"
height="28.759064"
x="0"
y="35.240936"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6"
width="28.759064"
height="28.759064"
x="35.240936"
y="35.240936"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0"
width="28.759064"
height="28.759064"
x="35.240936"
y="0"
rx="3.10761"
ry="3.10761" />
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1.23416;stroke-linecap:square;paint-order:markers stroke fill;stop-color:#000000"
id="rect899-7-0-3-6-0-6"
width="28.759064"
height="28.759064"
x="0"
y="0"
rx="3.10761"
ry="3.10761" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <svg
width="48"
height="48"
version="1.1"
viewBox="0 0 48 48"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path <path
style="fill:none;fill-opacity:1;stroke:#777777;stroke-width:1.90893817;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" 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"/> 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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 801 B

View file

@ -1,9 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <svg
width="48"
height="48"
version="1.1"
viewBox="0 0 48 48"
id="svg6"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<path <path
style="fill:#777777;fill-opacity:1;stroke:#777777;stroke-width:1.90893817;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" style="fill:#777777;fill-opacity:1;stroke:#777777;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.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"/> 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" />
<path <path
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" 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"
style="fill:#777777;fill-opacity:1;stroke:#777777;stroke-width:1.90893817;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" /> 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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,8 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
width="64"
height="64"
version="1.1"
viewBox="0 0 64 64"
id="svg6"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<path <path
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"/> 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" />
<path <path
d="m 55.554591,20.997725 c 0,-0.759826 -0.30393,-1.519651 -0.851005,-2.066726 l -4.133451,-4.133451 c -0.547073,-0.547074 -1.3069,-0.851005 -2.066725,-0.851005 -0.759825,0 -1.519651,0.303931 -2.066726,0.851005 l -19.93782,19.968215 -8.935548,-8.96594 c -0.547075,-0.547075 -1.306901,-0.851005 -2.066726,-0.851005 -0.759825,0 -1.519652,0.30393 -2.066725,0.851005 l -4.1334513,4.13345 c -0.5470748,0.547075 -0.8510047,1.3069 -0.8510047,2.066725 0,0.759826 0.3039299,1.519651 0.8510047,2.066725 l 11.0022733,11.002274 4.133451,4.133451 c 0.547074,0.547075 1.306899,0.851005 2.066726,0.851005 0.759825,0 1.51965,-0.30393 2.066725,-0.851005 L 32.69904,45.068997 54.703586,23.064451 c 0.547075,-0.547075 0.851005,-1.306901 0.851005,-2.066726 z" d="m 55.554591,20.997725 c 0,-0.759826 -0.30393,-1.519651 -0.851005,-2.066726 l -4.133451,-4.133451 c -0.547073,-0.547074 -1.3069,-0.851005 -2.066725,-0.851005 -0.759825,0 -1.519651,0.303931 -2.066726,0.851005 l -19.93782,19.968215 -8.935548,-8.96594 c -0.547075,-0.547075 -1.306901,-0.851005 -2.066726,-0.851005 -0.759825,0 -1.519652,0.30393 -2.066725,0.851005 l -4.1334513,4.13345 c -0.5470748,0.547075 -0.8510047,1.3069 -0.8510047,2.066725 0,0.759826 0.3039299,1.519651 0.8510047,2.066725 l 11.0022733,11.002274 4.133451,4.133451 c 0.547074,0.547075 1.306899,0.851005 2.066726,0.851005 0.759825,0 1.51965,-0.30393 2.066725,-0.851005 L 32.69904,45.068997 54.703586,23.064451 c 0.547075,-0.547075 0.851005,-1.306901 0.851005,-2.066726 z"
style="fill:#777777;stroke:none;stroke-width:1.36160743"/> style="fill:#ffffff;stroke:none;stroke-width:1.36160743;fill-opacity:1"
id="path4" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<path 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"/> width="64"
height="64"
version="1.1"
viewBox="0 0 64 64"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path
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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 535 B

View file

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <svg
width="48"
height="48"
version="1.1"
viewBox="0 0 48 48"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path <path
style="fill:#efefef;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" 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"/> 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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 726 B

View file

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="43.916" height="21.959" version="1.1" viewBox="0 0 43.916 21.959" xmlns="http://www.w3.org/2000/svg"> <svg
width="43.916"
height="21.959"
version="1.1"
viewBox="0 0 43.916 21.959"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path <path
style="fill:#b3b3b3;fill-opacity:1;stroke-width:0.74354357" 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"/> 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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="43.916" height="21.959" version="1.1" viewBox="0 0 43.916 21.959" xmlns="http://www.w3.org/2000/svg"> <svg
width="43.916"
height="21.959"
version="1.1"
viewBox="0 0 43.916 21.959"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path <path
d="m 10.491337,21.7795 h 22.933327 c 5.532673,0 10.033336,-4.84457 10.033336,-10.8 0,-5.9554292 -4.500663,-10.80000018 -10.033337,-10.80000018 H 10.491337 c -5.5326701,0 -10.03333682,4.84457098 -10.03333682,10.80000018 0,5.95543 4.50066672,10.8 10.03333682,10.8 z M 33.424664,3.2652139 c 3.9517,0 7.166673,3.4606284 7.166673,7.7142861 0,4.253657 -3.214973,7.714287 -7.166673,7.714287 -3.9517,0 -7.166663,-3.46063 -7.166663,-7.714287 0,-4.2536577 3.214963,-7.7142861 7.166663,-7.7142861 z" d="m 10.491337,21.7795 h 22.933327 c 5.532673,0 10.033336,-4.84457 10.033336,-10.8 0,-5.9554292 -4.500663,-10.80000018 -10.033337,-10.80000018 H 10.491337 c -5.5326701,0 -10.03333682,4.84457098 -10.03333682,10.80000018 0,5.95543 4.50066672,10.8 10.03333682,10.8 z M 33.424664,3.2652139 c 3.9517,0 7.166673,3.4606284 7.166673,7.7142861 0,4.253657 -3.214973,7.714287 -7.166673,7.714287 -3.9517,0 -7.166663,-3.46063 -7.166663,-7.714287 0,-4.2536577 3.214963,-7.7142861 7.166663,-7.7142861 z"
style="fill:#808080;fill-opacity:1;stroke-width:0.74354357"/> style="fill:#ffffff;fill-opacity:1;stroke-width:0.74354357"
id="path2" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 859 B

View file

@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="36" height="64" version="1.1" viewBox="0 0 36 64" xmlns="http://www.w3.org/2000/svg"> <svg
<path d="m2 2 l32 30 l-32 30 z" fill="none" stroke="#777" stroke-linejoin="round" stroke-width="4"/> width="36"
</svg> height="64"
version="1.1"
viewBox="0 0 36 64"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path
d="m2 2 l32 30 l-32 30 z"
fill="none"
stroke="#777"
stroke-linejoin="round"
stroke-width="4"
id="path2"
style="stroke:#ffffff;stroke-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 447 B

View file

@ -26,9 +26,9 @@
<path <path
d="M 25.554061,13.731199 14.000019,25.828097 2.4459392,13.731199" d="M 25.554061,13.731199 14.000019,25.828097 2.4459392,13.731199"
id="path2-6-9-4-0-3" id="path2-6-9-4-0-3"
style="fill:none;stroke:#878787;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" />
<path <path
d="M 25.554061,2.1944304 14.000021,14.291328 2.4459392,2.1944304" d="M 25.554061,2.1944304 14.000021,14.291328 2.4459392,2.1944304"
id="path2-6-9-4-0-3-0" id="path2-6-9-4-0-3-0"
style="fill:none;stroke:#878787;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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -26,9 +26,9 @@
<path <path
d="M 2.4459395,14.268801 13.999981,2.1719027 25.55406,14.268801" d="M 2.4459395,14.268801 13.999981,2.1719027 25.55406,14.268801"
id="path2-6-9-4-0-3" id="path2-6-9-4-0-3"
style="fill:none;stroke:#878787;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" />
<path <path
d="M 2.4459391,25.80557 13.99998,13.708672 25.554061,25.80557" d="M 2.4459391,25.80557 13.99998,13.708672 25.554061,25.80557"
id="path2-6-9-4-0-3-0" id="path2-6-9-4-0-3-0"
style="fill:none;stroke:#878787;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" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,4 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> <svg
<circle cx="32" cy="32" r="32" fill="#777"/> width="64"
height="64"
version="1.1"
viewBox="0 0 64 64"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<circle
cx="32"
cy="32"
r="32"
fill="#777"
id="circle2"
style="fill:#ffffff;fill-opacity:1" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 384 B

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
version="1.1"
viewBox="0 0 64 64"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<circle
cx="32"
cy="32"
r="32"
fill="#777"
id="circle2"
style="fill:#c9c9c9;fill-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 384 B

View file

@ -15,5 +15,6 @@
stroke="#777777" stroke="#777777"
stroke-linejoin="round" stroke-linejoin="round"
stroke-width="4" stroke-width="4"
id="path2" /> id="path2"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;fill-rule:nonzero" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -15,5 +15,6 @@
stroke="#777777" stroke="#777777"
stroke-linejoin="round" stroke-linejoin="round"
stroke-width="4" stroke-width="4"
id="path2" /> id="path2"
style="stroke:#fefefe;stroke-opacity:1" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 1,020 B