diff --git a/data/widgets/keyboard_shortcuts.xml b/data/widgets/keyboard_shortcuts.xml
index d1727299f..ed4ecc991 100644
--- a/data/widgets/keyboard_shortcuts.xml
+++ b/data/widgets/keyboard_shortcuts.xml
@@ -1,13 +1,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
@@ -21,15 +30,6 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp
index 3e99250e3..b2f1d4f07 100644
--- a/src/app/commands/cmd_keyboard_shortcuts.cpp
+++ b/src/app/commands/cmd_keyboard_shortcuts.cpp
@@ -283,10 +283,10 @@ public:
KeyboardShortcutsWindow() {
setAutoRemap(false);
- section()->addItem("Menus");
- section()->addItem("Commands");
- section()->addItem("Tools");
- section()->addItem("Action Modifiers");
+ section()->addChild(new ListItem("Menus"));
+ section()->addChild(new ListItem("Commands"));
+ section()->addChild(new ListItem("Tools"));
+ section()->addChild(new ListItem("Action Modifiers"));
section()->Change.connect(Bind(&KeyboardShortcutsWindow::onSectionChange, this));
importButton()->Click.connect(Bind(&KeyboardShortcutsWindow::onImport, this));
@@ -365,11 +365,12 @@ private:
this->tools()->sortItems();
this->actions()->sortItems();
+ section()->selectIndex(0);
onSectionChange();
}
void onSectionChange() {
- int section = this->section()->getSelectedItemIndex();
+ int section = this->section()->getSelectedIndex();
menusView()->setVisible(section == 0);
commandsView()->setVisible(section == 1);