Skip to content

Commit

Permalink
Make kbd shortcut editor controls on the bottom accessible (#7063)
Browse files Browse the repository at this point in the history
Addresses #6937
  • Loading branch information
mkruselj authored Jun 20, 2023
1 parent 07a5947 commit 8bc504c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/surge-xt/gui/overlays/KeyBindingsOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ KeyBindingsOverlay::KeyBindingsOverlay(SurgeStorage *st, SurgeGUIEditor *ed)
};

okS->setStorage(storage);
okS->setAccessible(true);
okS->setTitle("OK");
addAndMakeVisible(*okS);

cancelS = std::make_unique<Surge::Widgets::SelfDrawButton>("Cancel");
Expand All @@ -310,23 +312,31 @@ KeyBindingsOverlay::KeyBindingsOverlay(SurgeStorage *st, SurgeGUIEditor *ed)
};

cancelS->setStorage(storage);
cancelS->setAccessible(true);
cancelS->setTitle("Cancel");
addAndMakeVisible(*cancelS);

resetAll = std::make_unique<Surge::Widgets::SelfDrawButton>("Reset All");

resetAll->onClick = [this]() { this->resetAllToDefault(); };

resetAll->setSkin(editor->currentSkin);
resetAll->setStorage(storage);
resetAll->setAccessible(true);
resetAll->onClick = [this]() { this->resetAllToDefault(); };
resetAll->setTitle("Reset all shortcuts to default");
addAndMakeVisible(*resetAll);

std::string curVKBLayout = Surge::Storage::getUserDefaultValue(
storage, Surge::Storage::VirtualKeyboardLayout, "QWERTY");

vkbLayout = std::make_unique<Surge::Widgets::SelfDrawButton>("VKB Layout: " + curVKBLayout);

vkbLayout->onClick = [this]() { this->createVKBLayoutMenu(); };

vkbLayout->setSkin(editor->currentSkin);
vkbLayout->setStorage(storage);
vkbLayout->setAccessible(true);
vkbLayout->onClick = [this]() { this->createVKBLayoutMenu(); };
vkbLayout->setTitle("Select virtual keyboard layout");
addAndMakeVisible(*vkbLayout);

bindingListBoxModel = std::make_unique<KeyBindingsListBoxModel>(this, editor);
Expand Down

0 comments on commit 8bc504c

Please sign in to comment.