From 790bc51c83d7d074eb91d4b6e3e19f41ad49662f Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 15 Mar 2023 17:06:52 +0100 Subject: [PATCH] added alternative theme, switchable via hotkey. this is a preparation for SDL2 supporting system theme change events (day/night) soon --- Changes.txt | 4 ++++ docs/graphics/options_misc.png | Bin 4284 -> 4772 bytes docs/index.html | 20 ++++++++++++++++++-- src/common/PKeyboardHandler.cxx | 1 + src/common/jsonDefinitions.hxx | 1 + src/emucore/Event.hxx | 2 +- src/emucore/EventHandler.cxx | 16 ++++++++++++++++ src/emucore/EventHandler.hxx | 7 ++++++- src/emucore/FrameBuffer.cxx | 8 +++++--- src/emucore/Settings.cxx | 8 +++++++- src/gui/UIDialog.cxx | 30 +++++++++++++++++++++--------- src/gui/UIDialog.hxx | 3 ++- 12 files changed, 82 insertions(+), 18 deletions(-) diff --git a/Changes.txt b/Changes.txt index fdac5948c..779db32b2 100644 --- a/Changes.txt +++ b/Changes.txt @@ -22,6 +22,8 @@ * Enhanced Game Properties dialog for multigame ROMs. + * Added 2nd UI theme and hotkey for toggling UI theme. + * Added optional type format detection based on colors used. * Added Joy2B+ controller support. @@ -34,6 +36,8 @@ * Fixed broken 7800 pause key support. + * Fixed broken mouse and Stelladaptor input for Driving Controller. + * Added user defined CPU cycle timers to debugger. * For UNIX systems: Now defaults to using system-installed libsqlite3 diff --git a/docs/graphics/options_misc.png b/docs/graphics/options_misc.png index f4ebf7ca44d5ed5ef61c9c804ce05e55f0e4e947..f8d676b2b9a5430b9dbda7c2de23a7ad2f21384d 100644 GIT binary patch literal 4772 zcmZu#c{o&k8>YpSVx%Tn%G*MjiA1uKMA1T+Gh@rxg^)tZm};yeR2rnDXcBXbF|spe z$Tr!R2vgY^CdR(^>3zTVd;6~M`{P{adG6o&o$EUH_5AMVeomz6mGeS^5`uhud_qPS z&YAJ?Z36iC_?@?G-avYyOK2N6{#$0}&+<_krN%arEv|Z(_4xR5Vt1_CZ{5h@rk5-X z+}z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t$xE~S~F7}2cci)XYyM( zFC$)CL<-aF?Kv@yTs#log+)eLzu3yOo4bBPtNdW75H-kTV4n7$)pBLY+|qnpg^73$*J2IJ=iR4ENS`XO+P|t2)qNk zvs&!cH{zx&1xDfaWd7jYuW>^cepY&!NtW8s3|IPnYH*JG1pQZ#4SWSY(?78Q< SMGk)@K(6Q*YQNINg#I0pug=Z@ diff --git a/docs/index.html b/docs/index.html index c56982542..566b056cc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2034,6 +2034,11 @@ Alt + Return Cmd + Return + + Toggle UI theme + Alt + T + Cmd + T + Exit Stella Control + Q @@ -3149,7 +3154,17 @@
-uipalette <standard|classic|light|dark>
- Use the specified palette for UI elements. + Define default palette/theme for UI elements. + + + +
-uipalette2 <standard|classic|light|dark>
+ Define alternative palette/theme for UI elements. + + + +
-altpalette <1|0>
+ Use alternative palette/theme for UI elements. @@ -3850,7 +3865,8 @@ - + + diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 2936ba99a..e66ca015d 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -836,6 +836,7 @@ PhysicalKeyboardHandler::DefaultMenuMapping = { {Event::UITabPrev, KBDK_TAB, KBDM_SHIFT | KBDM_CTRL}, {Event::UITabNext, KBDK_TAB, KBDM_CTRL}, + {Event::ToggleUIPalette, KBDK_T, MOD3}, {Event::ToggleFullScreen, KBDK_RETURN, MOD3}, #ifdef BSPF_MACOS diff --git a/src/common/jsonDefinitions.hxx b/src/common/jsonDefinitions.hxx index 642f27ec3..b3e74590f 100644 --- a/src/common/jsonDefinitions.hxx +++ b/src/common/jsonDefinitions.hxx @@ -284,6 +284,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, { {Event::UITabPrev, "UITabPrev"}, {Event::UITabNext, "UITabNext"}, {Event::UIHelp, "UIHelp"}, + {Event::ToggleUIPalette, "ToggleUIPalette" }, {Event::MouseAxisXMove, "MouseAxisXMove"}, {Event::MouseAxisYMove, "MouseAxisYMove"}, {Event::MouseAxisXValue, "MouseAxisXValue"}, diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx index 2211351ab..efa863f4d 100644 --- a/src/emucore/Event.hxx +++ b/src/emucore/Event.hxx @@ -148,7 +148,7 @@ class Event SelectHome, SelectEnd, SelectAll, Delete, DeleteLeftWord, DeleteRightWord, DeleteHome, DeleteEnd, Backspace, Cut, Copy, Paste, Undo, Redo, - AbortEdit, EndEdit, + AbortEdit, EndEdit, ToggleUIPalette, HighScoresMenuMode, // Input settings diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 904273b94..36d53a489 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -237,6 +237,14 @@ void EventHandler::set7800Mode() myIs7800 = false; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void EventHandler::toggleUIPalette() +{ + myOSystem.settings().setValue("altuipalette", !myOSystem.settings().getBool("altuipalette")); + myOSystem.frameBuffer().setUIPalette(); + myOSystem.frameBuffer().update(FrameBuffer::UpdateMode::REDRAW); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EventHandler::changeMouseControl(int direction) { @@ -529,6 +537,13 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) } return; + case Event::ToggleUIPalette: + if(pressed && !repeated) + { + toggleUIPalette(); + } + break; + case Event::ToggleFullScreen: if(pressed && !repeated) { @@ -3109,6 +3124,7 @@ EventHandler::MenuActionList EventHandler::ourMenuActionList = { { { Event::UIPrevDir, "Parent directory" }, { Event::ToggleFullScreen, "Toggle fullscreen" }, + { Event::ToggleUIPalette, "Toggle UI theme" }, { Event::Quit, "Quit" } } }; diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 9d2453278..93e64acd1 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -98,6 +98,11 @@ class EventHandler */ void set7800Mode(); + /** + Toggle between UI theme #1 and #2. + */ + void toggleUIPalette(); + /** Collects and dispatches any pending events. This method should be called regularly (at X times per second, where X is the game framerate). @@ -527,7 +532,7 @@ class EventHandler REFRESH_SIZE = 0, #endif EMUL_ACTIONLIST_SIZE = 232 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE, - MENU_ACTIONLIST_SIZE = 19 + MENU_ACTIONLIST_SIZE = 20 ; // The event(s) assigned to each combination event diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 38c18810b..9eef64bc9 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -989,11 +989,13 @@ void FrameBuffer::setTIAPalette(const PaletteArray& rgb_palette) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FrameBuffer::setUIPalette() { + const Settings& settings = myOSystem.settings(); + const string& key = settings.getBool("altuipalette") ? "uipalette2" : "uipalette"; // Set palette for UI (upper area of full palette) const UIPaletteArray& ui_palette = - (myOSystem.settings().getString("uipalette") == "classic") ? ourClassicUIPalette : - (myOSystem.settings().getString("uipalette") == "light") ? ourLightUIPalette : - (myOSystem.settings().getString("uipalette") == "dark") ? ourDarkUIPalette : + (settings.getString(key) == "classic") ? ourClassicUIPalette : + (settings.getString(key) == "light") ? ourLightUIPalette : + (settings.getString(key) == "dark") ? ourDarkUIPalette : ourStandardUIPalette; for(size_t i = 0, j = myFullPalette.size() - ui_palette.size(); diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 92ee2c2b4..307ae6a72 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -181,6 +181,8 @@ Settings::Settings() setPermanent("dbg.display", 0); #endif setPermanent("uipalette", "standard"); + setPermanent("uipalette2", "dark"); + setPermanent("altuipalette", "false"); setPermanent("hidpi", "false"); setPermanent("listdelay", "300"); setPermanent("mwheel", "4"); @@ -648,9 +650,13 @@ void Settings::usage() << " -lastrom Last played ROM, automatically selected in\n" << " launcher\n" << " -romloadcount Number of ROM to load next from multicard\n" - << " -uipalette \n" + << " -uipalette2 \n" + << " -altuipalette <0|1> Enable alternative GUI theme\n" << " -hidpi <0|1> Enable HiDPI mode\n" << " -dialogfont setToolTip("Primary theme.", Event::ToggleUIPalette, EventMode::kMenuMode); + wid.push_back(myPalette1Popup); + ypos += lineHeight + VGAP; + + myPalette2Popup = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight, + items, "Theme #2 ", lwidth); + myPalette2Popup->setToolTip("Alternative theme.", Event::ToggleUIPalette, EventMode::kMenuMode); + wid.push_back(myPalette2Popup); ypos += lineHeight + VGAP; // Dialog font @@ -128,8 +135,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent, wid.push_back(myCenter); // Delay between quick-selecting characters in ListWidget - xpos = HBORDER; ypos += lineHeight + VGAP * 4; - const int swidth = myPalettePopup->getWidth() - lwidth; + xpos = HBORDER; ypos += lineHeight + VGAP * 3; + const int swidth = myPalette1Popup->getWidth() - lwidth; myListDelaySlider = new SliderWidget(myTab, font, xpos, ypos, swidth, lineHeight, "List input delay ", 0, kListDelay, font.getStringWidth("1 second")); @@ -388,8 +395,10 @@ void UIDialog::loadConfig() myLauncherExitWidget->setState(exitlauncher); // UI palette - const string& pal = settings.getString("uipalette"); - myPalettePopup->setSelected(pal, "standard"); + const string& pal1 = settings.getString("uipalette"); + myPalette1Popup->setSelected(pal1, "standard"); + const string& pal2 = settings.getString("uipalette2"); + myPalette2Popup->setSelected(pal2, "dark"); // Dialog font const string& dialogFont = settings.getString("dialogfont"); @@ -478,7 +487,9 @@ void UIDialog::saveConfig() // UI palette settings.setValue("uipalette", - myPalettePopup->getSelectedTag().toString()); + myPalette1Popup->getSelectedTag().toString()); + settings.setValue("uipalette2", + myPalette2Popup->getSelectedTag().toString()); instance().frameBuffer().setUIPalette(); instance().frameBuffer().update(FrameBuffer::UpdateMode::REDRAW); @@ -526,7 +537,8 @@ void UIDialog::setDefaults() switch(myTab->getActiveTab()) { case 0: // Misc. options - myPalettePopup->setSelected("standard"); + myPalette1Popup->setSelected("standard"); + myPalette2Popup->setSelected("dark"); myDialogFontPopup->setSelected("medium", ""); myHidpiWidget->setState(false); myPositionPopup->setSelected("0"); diff --git a/src/gui/UIDialog.hxx b/src/gui/UIDialog.hxx index e3b7172bf..d67e24c84 100644 --- a/src/gui/UIDialog.hxx +++ b/src/gui/UIDialog.hxx @@ -66,7 +66,8 @@ class UIDialog : public Dialog, public CommandSender CheckboxWidget* myLauncherExitWidget{nullptr}; // Misc options - PopUpWidget* myPalettePopup{nullptr}; + PopUpWidget* myPalette1Popup{nullptr}; + PopUpWidget* myPalette2Popup{nullptr}; PopUpWidget* myDialogFontPopup{nullptr}; CheckboxWidget* myHidpiWidget{nullptr}; PopUpWidget* myPositionPopup{nullptr};
ItemBrief descriptionFor more information,
see Command Line
ThemeTheme to use for UI elements (see examples)-uipalette
Theme #1Default theme to use for UI elements (see examples)-uipalette
Theme #2Alternative theme to use for UI elements (see examples)-uipalette2
Dialogs fontThe font used in the dialogs-dialogfont
HiDPI modeScale the UI by a factor of two when enabled-hidpi
Dialogs positionPosition of dialogs with Stella window-dialogpos