Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve editing of hotkeys #4628

Merged
merged 17 commits into from
May 27, 2023
Merged

Conversation

Mm2PL
Copy link
Collaborator

@Mm2PL Mm2PL commented May 12, 2023

Description

The UI will now show a simple picker on what a hotkey can do when there is such an option available.
For example HotkeyCategory::Split -> "focus" action has only 4 directions available, so it's possible to add this. However HotkeyCategory::Window -> "openTab" can have a number, so this approach does not extend to it.

Here is how the new UI looks for actions that support it:
screenshot of Edit Hotkey dialog with focus neighboring split action and a new Direction picker
For actions that don't support it, nothing will change.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/widgets/dialogs/EditHotkeyDialog.cpp Show resolved Hide resolved
src/widgets/dialogs/EditHotkeyDialog.cpp Show resolved Hide resolved
src/widgets/dialogs/EditHotkeyDialog.cpp Show resolved Hide resolved
src/controllers/hotkeys/ActionNames.hpp Outdated Show resolved Hide resolved
@Mm2PL Mm2PL requested a review from pajlada May 27, 2023 11:33
@pajlada pajlada enabled auto-merge (squash) May 27, 2023 13:21
@pajlada pajlada merged commit c7b2293 into master May 27, 2023
@pajlada pajlada deleted the feature/hotkeys_ui_improvement_stuff branch May 27, 2023 14:04
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -66,6 +47,96 @@ EditHotkeyDialog::EditHotkeyDialog(const std::shared_ptr<Hotkey> hotkey,
this->ui_->argumentsEdit->setPlainText("");
}
}
void EditHotkeyDialog::setFromHotkey(std::shared_ptr<Hotkey> hotkey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'hotkey' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
void EditHotkeyDialog::setFromHotkey(std::shared_ptr<Hotkey> hotkey)
void EditHotkeyDialog::setFromHotkey(const std::shared_ptr<Hotkey>& hotkey)

src/widgets/dialogs/EditHotkeyDialog.hpp:51:

-     void setFromHotkey(std::shared_ptr<Hotkey> hotkey);
+     void setFromHotkey(const std::shared_ptr<Hotkey>& hotkey);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants