feat: add runtime theme switching via Window menu (issue #339)#384
feat: add runtime theme switching via Window menu (issue #339)#384shresthbhargava wants to merge 3 commits into
Conversation
shresthbhargava
commented
May 11, 2026
- Add themeName property to AppModuleProperties (persisted in settings)
- Add CommandSwitchTheme command in commands_window
- Wire command into Window menu in mainwindow
- Read saved theme at startup in main.cpp
- Closes Query: light mode #339
- Add themeName property to AppModuleProperties (persisted in settings) - Add CommandSwitchTheme command in commands_window - Wire command into Window menu in mainwindow - Read saved theme at startup in main.cpp - Closes fougue#339
|
Thanks for this proposal. |
Thanks for the feedback. I’ll rework the implementation to move the theme selection into the Tools → Options dialog and apply the change on next application restart. |
- Remove CommandSwitchTheme window menu command - Make themeName property visible in Tools->Options dialog - Add restart-required note in themeName description - Theme preference persists via settings system automatically
|
Updated — theme setting is now in the Tools→Options dialog with a note that restart is required, similar to the language setting. |
| static constexpr std::string_view Name = "next-doc"; | ||
| }; | ||
|
|
||
|
|
There was a problem hiding this comment.
Please remove this empty line
|
|
||
| #include <cassert> | ||
|
|
||
|
|
There was a problem hiding this comment.
Please remove these empty lines
| this->addCommand<CommandLeftSidebarWidgetToggle>(this->widgetPageDocuments()->widgetLeftSideBar()); | ||
| this->addCommand<CommandMainWidgetToggleFullscreen>(); | ||
| this->addCommand<CommandSwitchMainWidgetMode>(); | ||
|
|
There was a problem hiding this comment.
Please remove this empty line
| fnAddAction(menu, CommandMainWidgetToggleFullscreen::Name); | ||
| menu->addSeparator(); | ||
| fnAddAction(menu, CommandSwitchMainWidgetMode::Name); | ||
|
|
There was a problem hiding this comment.
Please remove this empty line
| PropertyEnum<ActionOnDocumentFileChange> actionOnDocumentFileChange{ this, textId("actionOnDocumentFileChange") }; | ||
| PropertyBool linkWithDocumentSelector{ this, textId("linkWithDocumentSelector") }; | ||
| PropertyBool forceOpenGlFallbackWidget{ this, textId("forceOpenGlFallbackWidget") }; | ||
| PropertyString themeName{ this, textId("themeName") }; |
There was a problem hiding this comment.
The type should be PropertyEnumeration and the enum defined in app_module_properties.cpp or elsewhere. Have a look at how viewCubeCorner is implemented.
Being an enumeration is better than a string that requires error-prine user typing.
85391f0 to
7827fc9
Compare