[education/rkward] rkward/windows: Add colorscheme action to settings menu. While at it, remove now obsolete main window statusbar action.

Thomas Friedrichsmeier null at kde.org
Tue Mar 29 18:26:46 BST 2022


Git commit caf597f207745a40f8fd530092e5d499dcd08662 by Thomas Friedrichsmeier.
Committed on 29/03/2022 at 17:26.
Pushed by tfry into branch 'master'.

Add colorscheme action to settings menu. While at it, remove now obsolete main window statusbar action.

M  +6    -0    rkward/windows/rktoplevelwindowgui.cpp
M  +2    -1    rkward/windows/rktoplevelwindowgui.rc

https://invent.kde.org/education/rkward/commit/caf597f207745a40f8fd530092e5d499dcd08662

diff --git a/rkward/windows/rktoplevelwindowgui.cpp b/rkward/windows/rktoplevelwindowgui.cpp
index 6aa4ef04..2ff0a2b9 100644
--- a/rkward/windows/rktoplevelwindowgui.cpp
+++ b/rkward/windows/rktoplevelwindowgui.cpp
@@ -25,6 +25,8 @@
 #include <kxmlguifactory.h>
 #include <kshortcutsdialog.h>
 #include <KHelpMenu>
+#include <KColorSchemeManager>
+#include <KActionMenu>
 
 #include <QWhatsThis>
 #include <QDomDocument>
@@ -102,6 +104,10 @@ RKTopLevelWindowGUI::RKTopLevelWindowGUI(KXmlGuiWindow *for_window) : QObject(fo
 	// settings
 	KStandardAction::keyBindings (this, SLOT (configureShortcuts()), actionCollection ());
 	KStandardAction::configureToolbars (this, SLOT (configureToolbars()), actionCollection ());
+	KColorSchemeManager *manager = new KColorSchemeManager(this);
+	actionCollection()->addAction(QStringLiteral("colorscheme_menu"), manager->createSchemeSelectionMenu(QString(), this));
+	QAction *a = for_window->action("options_show_statusbar");
+	if (a) a->setVisible(false);
 }
 
 RKTopLevelWindowGUI::~RKTopLevelWindowGUI () {
diff --git a/rkward/windows/rktoplevelwindowgui.rc b/rkward/windows/rktoplevelwindowgui.rc
index 05881e6a..bf0f48af 100644
--- a/rkward/windows/rktoplevelwindowgui.rc
+++ b/rkward/windows/rktoplevelwindowgui.rc
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="rkward_toplevel" version="721">
+<kpartgui name="rkward_toplevel" version="722">
 	<MenuBar>
 		<Merge/>
 		<Menu name="window"><text>&Window</text>
@@ -18,6 +18,7 @@
 			<Merge/>
 		</Menu>
 		<Menu name="settings"><text>&Settings</text>
+			<Action name="colorscheme_menu" group="configure_merge_group"/>
 			<Action name="switch_application_language" group="configure_merge_group"/>
 			<Separator group="configure_merge_group"/>
 			<Action name="options_configure_keybinding" group="configure_merge_group"/>


More information about the rkward-tracker mailing list