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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -45,15 +45,15 @@ GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches
// Set up grid.
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});
mSystem = std::make_shared<TextComponent>("SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF,
ALIGN_CENTER);
mSystem = std::make_shared<TextComponent>("SYSTEM", Font::get(FONT_SIZE_MEDIUM),
mMenuColorPrimary, ALIGN_CENTER);
mGrid.setEntry(mSystem, glm::ivec2 {0, 2}, false, true, glm::ivec2 {2, 1});
mSubtitle = std::make_shared<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});
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",
std::bind(&GuiScraperMulti::finish, this)));
mButtonGrid = makeButtonGrid(buttons);
mButtonGrid = MenuComponent::makeButtonGrid(buttons);
mGrid.setEntry(mButtonGrid, glm::ivec2 {0, 5}, true, false, glm::ivec2 {2, 1});
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is

View file

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

View file

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

View file

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

View file

@ -176,18 +176,18 @@ void GuiSettings::addEditableTextComponent(const std::string label,
row.elements.clear();
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(ed, true);
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);
auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(glm::vec2 {0.0f, lbl->getFont()->getLetterHeight()});
bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
row.addElement(bracket, false);
// OK callback (apply new value to ed).

View file

@ -40,7 +40,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
// Set up main grid.
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},
GridFlags::BORDER_BOTTOM);
@ -51,46 +51,46 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
glm::ivec2 {1, 5});
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});
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});
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});
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(std::make_shared<GuiComponent>(), glm::ivec2 {5, 0}, false, false,
glm::ivec2 {1, 5});
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});
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});
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});
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});
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});
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});
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});
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});
mList = std::make_shared<ComponentList>();
@ -124,7 +124,7 @@ GuiThemeDownloader::GuiThemeDownloader(std::function<void()> updateCallback)
std::vector<std::shared_ptr<ButtonComponent>> buttons;
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},
GridFlags::BORDER_TOP);
@ -689,8 +689,8 @@ void GuiThemeDownloader::populateGUI()
themeName.append(" ").append(ViewController::EXCLAMATION_CHAR);
ComponentListRow row;
std::shared_ptr<TextComponent> themeNameElement {
std::make_shared<TextComponent>(themeName, Font::get(FONT_SIZE_MEDIUM), 0x777777FF)};
std::shared_ptr<TextComponent> themeNameElement {std::make_shared<TextComponent>(
themeName, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
ThemeGUIEntry guiEntry;
guiEntry.themeName = themeNameElement;
@ -861,31 +861,31 @@ void GuiThemeDownloader::updateInfoPane()
if (mThemeSets[mList->getCursorId()].isCloned) {
mDownloadStatus->setText(ViewController::TICKMARK_CHAR + " INSTALLED");
mDownloadStatus->setColor(0x449944FF);
mDownloadStatus->setColor(mMenuColorGreen);
}
else if (mThemeSets[mList->getCursorId()].invalidRepository ||
mThemeSets[mList->getCursorId()].manuallyDownloaded) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " MANUAL DOWNLOAD");
mDownloadStatus->setColor(0x992222FF);
mDownloadStatus->setColor(mMenuColorRed);
}
else if (mThemeSets[mList->getCursorId()].corruptRepository) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " CORRUPT");
mDownloadStatus->setColor(0x992222FF);
mDownloadStatus->setColor(mMenuColorRed);
}
else if (mThemeSets[mList->getCursorId()].shallowRepository) {
mDownloadStatus->setText(ViewController::CROSSEDCIRCLE_CHAR + " SHALLOW");
mDownloadStatus->setColor(0x992222FF);
mDownloadStatus->setColor(mMenuColorRed);
}
else {
if (mThemeSets[mList->getCursorId()].newEntry)
mDownloadStatus->setText("NOT INSTALLED (NEW)");
else
mDownloadStatus->setText("NOT INSTALLED");
mDownloadStatus->setColor(0x999999FF);
mDownloadStatus->setColor(mMenuColorSecondary);
}
if (mThemeSets[mList->getCursorId()].hasLocalChanges) {
mLocalChanges->setText(ViewController::EXCLAMATION_CHAR + " LOCAL CHANGES");
mLocalChanges->setColor(0x992222FF);
mLocalChanges->setColor(mMenuColorRed);
}
else {
mLocalChanges->setText("");
@ -1036,8 +1036,8 @@ void GuiThemeDownloader::render(const glm::mat4& parentTrans)
if (mGrayRectangleCoords.size() == 4) {
mRenderer->setMatrix(parentTrans * getTransform());
mRenderer->drawRect(mGrayRectangleCoords[0], mGrayRectangleCoords[1],
mGrayRectangleCoords[2], mGrayRectangleCoords[3], 0x00000009,
0x00000009);
mGrayRectangleCoords[2], mGrayRectangleCoords[3], mMenuColorPanelDimmed,
mMenuColorPanelDimmed);
}
if (mFetching)

View file

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

View file

@ -59,6 +59,86 @@ ViewController* ViewController::getInstance()
return &instance;
}
void ViewController::setMenuColors()
{
if (Settings::getInstance()->getString("MenuColorScheme") == "dark") {
mMenuColorFrame = 0x191919FF;
mMenuColorFrameLaunchScreen = 0x121212FF;
mMenuColorFrameBusyComponent = 0x090909FF;
mMenuColorPanelDimmed = 0x00000032;
mMenuColorTitle = 0xA6A6A6FF;
mMenuColorPrimary = 0x909090FF;
mMenuColorSecondary = 0xA3A3A3FF;
mMenuColorTertiary = 0xA0A0A0FF;
mMenuColorRed = 0xCA3E3EFF;
mMenuColorGreen = 0x449944FF;
mMenuColorBlue = 0x4757ddff;
mMenuColorSelector = 0x070707FF;
mMenuColorSeparators = 0x303030FF;
mMenuColorBusyComponent = 0x888888FF;
mMenuColorScrollIndicators = 0x929292FF;
mMenuColorPopupText = 0xBBBBBBFF;
mMenuColorButtonFocused = 0x050505FF;
mMenuColorButtonTextFocused = 0xAFAFAFFF;
mMenuColorButtonTextUnfocused = 0x878787FF;
mMenuColorButtonFlatFocused = 0x090909FF;
mMenuColorButtonFlatUnfocused = 0x242424FF;
mMenuColorKeyboardModifier = 0xC62F2FFF;
mMenuColorKeyboardCursorFocused = 0xAAAAAAFF;
mMenuColorKeyboardCursorUnfocused = 0x666666FF;
mMenuColorKeyboardText = 0x92929200;
mMenuColorTextInputFrameFocused = 0x090909FF;
mMenuColorTextInputFrameUnfocused = 0x242424FF;
mMenuColorSlider = 0xAAAAAAFF;
mMenuColorSliderKnobDisabled = 0x464646FF;
mMenuColorDateTimeEditMarker = 0xFFFFFF22;
mMenuColorDetectDeviceHeld = 0x99999900;
}
else {
mMenuColorFrame = 0xEFEFEFFF;
mMenuColorFrameLaunchScreen = 0xDFDFDFFF;
mMenuColorFrameBusyComponent = 0xFFFFFFFF;
mMenuColorPanelDimmed = 0x00000009;
mMenuColorTitle = 0x555555FF;
mMenuColorPrimary = 0x777777FF;
mMenuColorSecondary = 0x888888FF;
mMenuColorTertiary = 0x666666FF;
mMenuColorRed = 0x992222FF;
mMenuColorGreen = 0x449944FF;
mMenuColorBlue = 0x222299FF;
mMenuColorSelector = 0xFFFFFFFF;
mMenuColorSeparators = 0xC6C7C6FF;
mMenuColorBusyComponent = 0xB8B8B8FF;
mMenuColorScrollIndicators = 0x888888FF;
mMenuColorPopupText = 0x444444FF;
mMenuColorButtonFocused = 0x777777FF;
mMenuColorButtonTextFocused = 0xFFFFFFFF;
mMenuColorButtonTextUnfocused = 0x777777FF;
mMenuColorButtonFlatFocused = 0x878787FF;
mMenuColorButtonFlatUnfocused = 0xDADADAFF;
mMenuColorKeyboardModifier = 0xF26767FF;
mMenuColorKeyboardCursorFocused = 0x777777FF;
mMenuColorKeyboardCursorUnfocused = 0xC7C7C7FF;
mMenuColorKeyboardText = 0x77777700;
mMenuColorTextInputFrameFocused = 0xFFFFFFFF;
mMenuColorTextInputFrameUnfocused = 0xFFFFFFFF;
mMenuColorSlider = 0x777777FF;
mMenuColorSliderKnobDisabled = 0xC9C9C9FF;
mMenuColorDateTimeEditMarker = 0x00000022;
mMenuColorDetectDeviceHeld = 0x44444400;
}
}
void ViewController::invalidSystemsFileDialog()
{
std::string errorMessage = "COULDN'T PARSE THE SYSTEMS CONFIGURATION FILE. "

View file

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

View file

@ -17,14 +17,6 @@
#include <functional>
#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
class Animation;
@ -355,6 +347,44 @@ protected:
unsigned int mColorChangedValue;
unsigned int mComponentThemeFlags;
// Default values are for the "light" color scheme.
static inline unsigned int mMenuColorFrame {0xEFEFEFFF};
static inline unsigned int mMenuColorFrameLaunchScreen {0xDFDFDFFF};
static inline unsigned int mMenuColorFrameBusyComponent {0xFFFFFFFF};
static inline unsigned int mMenuColorPanelDimmed {0x00000009};
static inline unsigned int mMenuColorTitle {0x555555FF};
static inline unsigned int mMenuColorPrimary {0x777777FF};
static inline unsigned int mMenuColorSecondary {0x888888FF};
static inline unsigned int mMenuColorTertiary {0x666666FF};
static inline unsigned int mMenuColorRed {0x992222FF};
static inline unsigned int mMenuColorGreen {0x449944FF};
static inline unsigned int mMenuColorBlue {0x222299FF};
static inline unsigned int mMenuColorSelector {0xFFFFFFFF};
static inline unsigned int mMenuColorSeparators {0xC6C7C6FF};
static inline unsigned int mMenuColorBusyComponent {0xB8B8B8FF};
static inline unsigned int mMenuColorScrollIndicators {0x888888FF};
static inline unsigned int mMenuColorPopupText {0x444444FF};
static inline unsigned int mMenuColorButtonFocused {0x777777FF};
static inline unsigned int mMenuColorButtonTextFocused {0xFFFFFFFF};
static inline unsigned int mMenuColorButtonTextUnfocused {0x777777FF};
static inline unsigned int mMenuColorButtonFlatFocused {0x878787FF};
static inline unsigned int mMenuColorButtonFlatUnfocused {0xDADADAFF};
static inline unsigned int mMenuColorKeyboardModifier {0xF26767FF};
static inline unsigned int mMenuColorKeyboardCursorFocused {0x777777FF};
static inline unsigned int mMenuColorKeyboardCursorUnfocused {0xC7C7C7FF};
static inline unsigned int mMenuColorKeyboardText {0x77777700};
static inline unsigned int mMenuColorTextInputFrameFocused {0x777777FF};
static inline unsigned int mMenuColorTextInputFrameUnfocused {0xFFFFFFFF};
static inline unsigned int mMenuColorSlider {0x777777FF};
static inline unsigned int mMenuColorSliderKnobDisabled {0xC9C9C9FF};
static inline unsigned int mMenuColorDateTimeEditMarker {0x00000022};
static inline unsigned int mMenuColorDetectDeviceHeld {0x44444400};
glm::vec3 mPosition;
glm::vec2 mOrigin;
glm::vec2 mRotationOrigin;

View file

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

View file

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

View file

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

View file

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

View file

@ -11,22 +11,13 @@
#include "components/AnimatedImageComponent.h"
#include "components/ImageComponent.h"
// Animation definition.
AnimationFrame BUSY_ANIMATION_FRAMES[] {
{":/graphics/busy_0.svg", 300},
{":/graphics/busy_1.svg", 300},
{":/graphics/busy_2.svg", 300},
{":/graphics/busy_3.svg", 300},
};
const AnimationDef BUSY_ANIMATION_DEF = {BUSY_ANIMATION_FRAMES, 4, true};
BusyComponent::BusyComponent()
: mBackground {":/graphics/frame.png"}
, mGrid {glm::ivec2 {5, 3}}
{
mAnimation = std::make_shared<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.
mGrid.setEntry(mAnimation, glm::ivec2 {1, 1}, false, true);
@ -59,8 +50,17 @@ void BusyComponent::onSizeChanged()
mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3),
textHeight + (2.0f * Renderer::getScreenResolutionModifier())},
mAnimation->getPosition(), glm::vec2 {0.0f, 0.0f});
mBackground.setFrameColor(mMenuColorFrameBusyComponent);
mAnimation->load(&BUSY_ANIMATION_DEF);
AnimationFrame BUSY_ANIMATION_FRAMES[] {
{":/graphics/busy_0.svg", 300},
{":/graphics/busy_1.svg", 300},
{":/graphics/busy_2.svg", 300},
{":/graphics/busy_3.svg", 300},
};
const AnimationDef animationDef {BUSY_ANIMATION_FRAMES, 4, mMenuColorBusyComponent, true};
mAnimation->load(&animationDef);
}
void BusyComponent::reset()

View file

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

View file

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

View file

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

View file

@ -23,7 +23,7 @@ DateTimeEditComponent::DateTimeEditComponent(bool alignRight, DisplayMode dispMo
, mKeyRepeatDir {0}
, mKeyRepeatTimer {0}
, mRelativeUpdateAccumulator {0}
, mColor {0x777777FF}
, mColor {mMenuColorPrimary}
, mFont {Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)}
, mAlignRight {alignRight}
, mUppercase {false}
@ -201,7 +201,7 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans)
if (mEditIndex >= 0 && static_cast<unsigned int>(mEditIndex) < mCursorBoxes.size())
mRenderer->drawRect(mCursorBoxes[mEditIndex][0], mCursorBoxes[mEditIndex][1],
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.
mTitle = std::make_shared<TextComponent>();
mTitle->setHorizontalAlignment(ALIGN_CENTER);
mTitle->setColor(0x555555FF);
mTitle->setColor(mMenuColorTitle);
setTitle(title, titleFont);
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
@ -165,7 +165,7 @@ void MenuComponent::updateGrid()
}
}
std::shared_ptr<ComponentGrid> makeButtonGrid(
std::shared_ptr<ComponentGrid> MenuComponent::makeButtonGrid(
const std::vector<std::shared_ptr<ButtonComponent>>& buttons)
{
std::shared_ptr<ComponentGrid> buttonGrid {
@ -190,10 +190,11 @@ std::shared_ptr<ComponentGrid> makeButtonGrid(
return buttonGrid;
}
std::shared_ptr<ImageComponent> makeArrow()
std::shared_ptr<ImageComponent> MenuComponent::makeArrow()
{
auto bracket = std::make_shared<ImageComponent>();
bracket->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
bracket->setImage(":/graphics/arrow.svg");
bracket->setColorShift(mMenuColorPrimary);
return bracket;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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

View file

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

View file

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

View file

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

View file

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

View file

@ -34,8 +34,9 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun,
addChild(&mGrid);
// Title.
mTitle = std::make_shared<TextComponent>(firstRun ? "WELCOME" : "CONFIGURE INPUT DEVICE",
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER);
mTitle =
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},
GridFlags::BORDER_BOTTOM);
@ -52,26 +53,26 @@ GuiDetectDevice::GuiDetectDevice(bool firstRun,
deviceInfo << " (ONLY ACCEPTING INPUT FROM FIRST CONTROLLER)";
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);
// Message.
if (numDevices > 0) {
mMsg1 = std::make_shared<TextComponent>(
"HOLD A BUTTON ON YOUR GAMEPAD OR KEYBOARD TO CONFIGURE IT", Font::get(FONT_SIZE_SMALL),
0x777777FF, ALIGN_CENTER);
mMenuColorPrimary, ALIGN_CENTER);
}
else {
mMsg1 =
std::make_shared<TextComponent>("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT",
Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER);
mMsg1 = std::make_shared<TextComponent>("HOLD A BUTTON ON YOUR KEYBOARD TO CONFIGURE IT",
Font::get(FONT_SIZE_SMALL), mMenuColorPrimary,
ALIGN_CENTER);
}
mGrid.setEntry(mMsg1, glm::ivec2 {0, 2}, false, true);
const std::string msg2str {firstRun ? "PRESS ESC TO SKIP (OR F4 TO QUIT AT ANY TIME)" :
"PRESS ESC TO CANCEL"};
mMsg2 = std::make_shared<TextComponent>(msg2str, Font::get(FONT_SIZE_SMALL), 0x777777FF,
mMsg2 = std::make_shared<TextComponent>(msg2str, Font::get(FONT_SIZE_SMALL), mMenuColorPrimary,
ALIGN_CENTER);
mGrid.setEntry(mMsg2, glm::ivec2 {0, 3}, false, true);
@ -156,7 +157,8 @@ void GuiDetectDevice::update(int deltaTime)
mHoldTime -= deltaTime;
// Fade in device name.
const float t {std::fabs((static_cast<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) {
// A device was selected.
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 maxHeight {Renderer::getScreenHeight() * 0.2f};
std::shared_ptr<TextComponent> s {
std::make_shared<TextComponent>("", Font::get(FONT_SIZE_MINI), 0x444444FF, ALIGN_CENTER)};
std::shared_ptr<TextComponent> s {std::make_shared<TextComponent>(
"", Font::get(FONT_SIZE_MINI), mMenuColorPopupText, ALIGN_CENTER)};
// We do this to force the text container to resize and return the actual expected popup size.
s->setSize(0.0f, 0.0f);
@ -115,7 +115,7 @@ bool GuiInfoPopup::updateState()
mGrid->setOpacity(mAlpha);
// Apply fade-in effect to popup frame.
mFrame->setEdgeColor(0xFFFFFF00 | static_cast<unsigned char>(mAlpha * 255.0f));
mFrame->setCenterColor(0xFFFFFF00 | static_cast<unsigned char>(mAlpha * 255.0f));
mFrame->setFrameColor((mMenuColorFrame & 0xFFFFFF00) |
static_cast<unsigned char>(mAlpha * 255.0f));
return true;
}

View file

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

View file

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

View file

@ -114,8 +114,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
addChild(&mBackground);
addChild(&mGrid);
mTitle = std::make_shared<TextComponent>(Utils::String::toUpper(title),
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER);
mTitle = std::make_shared<TextComponent>(
Utils::String::toUpper(title), Font::get(FONT_SIZE_LARGE), mMenuColorTitle, ALIGN_CENTER);
std::vector<std::vector<std::string>> kbLayout;
@ -143,11 +143,11 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
if (mComplexMode) {
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);
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);
yPos += 2;
}
@ -585,12 +585,12 @@ void GuiTextEditKeyboardPopup::shiftKeys()
mShift = !mShift;
if (mShift) {
mShiftButton->setFlatColorFocused(0xF26767FF);
mShiftButton->setFlatColorUnfocused(0xF26767FF);
mShiftButton->setFlatColorFocused(mMenuColorKeyboardModifier);
mShiftButton->setFlatColorUnfocused(mMenuColorKeyboardModifier);
}
else {
mShiftButton->setFlatColorFocused(0x878787FF);
mShiftButton->setFlatColorUnfocused(0x60606025);
mShiftButton->setFlatColorFocused(mMenuColorButtonFlatFocused);
mShiftButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused);
}
if (mAlt && mShift) {
@ -618,12 +618,12 @@ void GuiTextEditKeyboardPopup::altKeys()
mAlt = !mAlt;
if (mAlt) {
mAltButton->setFlatColorFocused(0xF26767FF);
mAltButton->setFlatColorUnfocused(0xF26767FF);
mAltButton->setFlatColorFocused(mMenuColorKeyboardModifier);
mAltButton->setFlatColorUnfocused(mMenuColorKeyboardModifier);
}
else {
mAltButton->setFlatColorFocused(0x878787FF);
mAltButton->setFlatColorUnfocused(0x60606025);
mAltButton->setFlatColorFocused(mMenuColorButtonFlatFocused);
mAltButton->setFlatColorUnfocused(mMenuColorButtonFlatUnfocused);
}
if (mShift && mAlt) {

View file

@ -45,14 +45,14 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
addChild(&mBackground);
addChild(&mGrid);
mTitle = std::make_shared<TextComponent>(Utils::String::toUpper(title),
Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER);
mTitle = std::make_shared<TextComponent>(
Utils::String::toUpper(title), Font::get(FONT_SIZE_MEDIUM), mMenuColorTitle, ALIGN_CENTER);
if (mComplexMode) {
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),
0x555555FF, ALIGN_CENTER);
mMenuColorTitle, ALIGN_CENTER);
}
mText = std::make_shared<TextEditComponent>();
@ -79,7 +79,7 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
buttons.push_back(
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);

View file

@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="36" height="64" version="1.1" viewBox="0 0 36 64" xmlns="http://www.w3.org/2000/svg">
<path d="m2 2 l32 30 l-32 30" fill="none" stroke="#777" stroke-linejoin="round" stroke-linecap="round" stroke-width="4"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="36"
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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777"/>
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
version="1.1"
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777"/>
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
version="1.1"
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
version="1.1"
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="36" y="0" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<rect x="2" y="36" width="26" height="28" rx="3" ry="3" fill="#777777"/>
<rect x="36" y="36" width="26" height="28" rx="3" ry="3" fill="#777777" opacity="0.5"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
version="1.1"
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>

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"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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
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"
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"/>
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.90893817;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="M 4.4345762,0.95447028 H 43.565423 c 1.927979,0 3.480107,1.55212772 3.480107,3.48010702 V 43.565424 c 0,1.927979 -1.552128,3.480107 -3.480107,3.480107 H 4.4345762 c -1.9279794,0 -3.48010712,-1.552128 -3.48010712,-3.480107 V 4.4345773 c 0,-1.9279793 1.55212772,-3.48010702 3.48010712,-3.48010702 z"
id="path2" />
</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"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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
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
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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
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
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/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"/>
<?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" />
<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>

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"?>
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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
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"
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"/>
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.98800004;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="M 8.3579788,0 H 39.642021 C 44.272341,0 48,3.7276586 48,8.3579788 V 39.642021 C 48,44.272341 44.272341,48 39.642021,48 H 8.3579788 C 3.7276586,48 0,44.272341 0,39.642021 V 8.3579788 C 0,3.7276586 3.7276586,0 8.3579788,0 Z"
id="path2" />
</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"?>
<svg width="43.916" height="21.959" version="1.1" viewBox="0 0 43.916 21.959" xmlns="http://www.w3.org/2000/svg">
<?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"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<path
style="fill:#b3b3b3;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"/>
style="fill:#ffffff;fill-opacity:1;stroke-width:0.74354357"
d="M 10.491203,0.17871838 C 4.9585292,0.17871839 0.45799999,5.0240707 0.45799999,10.979499 c 0,5.95543 4.50053021,10.800782 10.03320301,10.800782 h 22.933594 c 5.53267,0 10.033203,-4.845352 10.033203,-10.800782 0,-5.9554283 -4.500533,-10.80078062 -10.033203,-10.80078062 z m 0,3.08593752 c 3.951701,0 7.166015,3.4611877 7.166015,7.7148431 0,4.253654 -3.214314,7.714844 -7.166015,7.714844 -3.9517019,0 -7.1660155,-3.46119 -7.1660155,-7.714844 0,-4.2536554 3.2143137,-7.7148431 7.1660155,-7.7148431 z m 0,1.5429688 c -3.1612188,0 -5.7343748,2.7691042 -5.7343748,6.1718743 -1e-7,3.402769 2.5731559,6.171875 5.7343748,6.171875 3.161215,0 5.732422,-2.769106 5.732422,-6.171875 0,-3.4027701 -2.571207,-6.1718743 -5.732422,-6.1718743 z"
id="path2" />
</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"?>
<svg width="43.916" height="21.959" version="1.1" viewBox="0 0 43.916 21.959" xmlns="http://www.w3.org/2000/svg">
<?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"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<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"
style="fill:#808080;fill-opacity:1;stroke-width:0.74354357"/>
style="fill:#ffffff;fill-opacity:1;stroke-width:0.74354357"
id="path2" />
</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"?>
<svg width="36" height="64" version="1.1" viewBox="0 0 36 64" xmlns="http://www.w3.org/2000/svg">
<path d="m2 2 l32 30 l-32 30 z" fill="none" stroke="#777" stroke-linejoin="round" stroke-width="4"/>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="36"
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
d="M 25.554061,13.731199 14.000019,25.828097 2.4459392,13.731199"
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
d="M 25.554061,2.1944304 14.000021,14.291328 2.4459392,2.1944304"
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>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -26,9 +26,9 @@
<path
d="M 2.4459395,14.268801 13.999981,2.1719027 25.55406,14.268801"
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
d="M 2.4459391,25.80557 13.99998,13.708672 25.554061,25.80557"
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>

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"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<circle cx="32" cy="32" r="32" fill="#777"/>
<?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:#ffffff;fill-opacity:1" />
</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-linejoin="round"
stroke-width="4"
id="path2" />
id="path2"
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-opacity:1;fill-rule:nonzero" />
</svg>

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 1 KiB

View file

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

Before

Width:  |  Height:  |  Size: 975 B

After

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