Skip to content

Commit

Permalink
Add rnap and rcow icons
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Dec 1, 2024
1 parent 6f90c25 commit 9764fcc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ if(NOT BUILD_HYDRA_CORE AND NOT BUILD_LIBRETRO_CORE)
docs/img/rsob_icon.png docs/img/rstarstruck_icon.png docs/img/rpog_icon.png docs/img/rsyn_icon.png
docs/img/settings_icon.png docs/img/display_icon.png docs/img/speaker_icon.png
docs/img/sparkling_icon.png docs/img/battery_icon.png docs/img/sdcard_icon.png
docs/img/rnap_icon.png docs/img/rcow_icon.png
)
else()
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp)
Expand Down
Binary file added docs/img/rcow_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/rnap_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions include/frontend_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct FrontendSettings {
enum class WindowIcon : int {
Rpog = 0,
Rsyn = 1,
Rnap = 2,
Rcow = 3,
};

Theme theme = Theme::Dark;
Expand Down
7 changes: 6 additions & 1 deletion src/frontend_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ FrontendSettings::WindowIcon FrontendSettings::iconFromString(std::string inStri
std::transform(inString.begin(), inString.end(), inString.begin(), [](unsigned char c) { return std::tolower(c); });

static const std::unordered_map<std::string, WindowIcon> map = {
{"rpog", WindowIcon::Rpog}, {"rsyn", WindowIcon::Rsyn},
{"rpog", WindowIcon::Rpog},
{"rsyn", WindowIcon::Rsyn},
{"rcow", WindowIcon::Rcow},
{"rnap", WindowIcon::Rnap},
};

if (auto search = map.find(inString); search != map.end()) {
Expand All @@ -52,6 +55,8 @@ FrontendSettings::WindowIcon FrontendSettings::iconFromString(std::string inStri
const char* FrontendSettings::iconToString(WindowIcon icon) {
switch (icon) {
case WindowIcon::Rsyn: return "rsyn";
case WindowIcon::Rcow: return "rcow";
case WindowIcon::Rnap: return "rnap";

case WindowIcon::Rpog:
default: return "rpog";
Expand Down
5 changes: 5 additions & 0 deletions src/panda_qt/config_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ ConfigWindow::ConfigWindow(ConfigCallback configCallback, IconCallback iconCallb
QComboBox* iconSelect = new QComboBox();
iconSelect->addItem(tr("Happy panda"));
iconSelect->addItem(tr("Happy panda (colourful)"));
iconSelect->addItem(tr("Sleepy panda"));
iconSelect->addItem(tr("Cow panda"));
iconSelect->setCurrentIndex(static_cast<int>(config.frontendSettings.icon));

connect(iconSelect, &QComboBox::currentIndexChanged, this, [&](int index) {
config.frontendSettings.icon = static_cast<WindowIcon>(index);
setIcon(static_cast<WindowIcon>(index));
Expand Down Expand Up @@ -395,6 +398,8 @@ void ConfigWindow::setTheme(Theme theme) {
void ConfigWindow::setIcon(WindowIcon icon) {
switch (icon) {
case WindowIcon::Rsyn: updateIcon(":/docs/img/rsyn_icon.png"); break;
case WindowIcon::Rnap: updateIcon(":/docs/img/rnap_icon.png"); break;
case WindowIcon::Rcow: updateIcon(":/docs/img/rcow_icon.png"); break;

case WindowIcon::Rpog:
default: updateIcon(":/docs/img/rpog_icon.png"); break;
Expand Down

0 comments on commit 9764fcc

Please sign in to comment.