Skip to content

Commit

Permalink
Add keyboard shortcuts for empty cards and toggle mask on image occlu…
Browse files Browse the repository at this point in the history
…sion (#3136)

* Add keyboard shortcuts for empty cards and toggle mask on image occlusion

- add shortcut for empty cards
- add shortcut for toggle mask
- set tooltips with shortcuts

use unused shortcut for empty cards

* remove unnecessary shortcut added in main.py

* change empty cards shortcut and try to fix CI error in CONTRIBUTORS

* change shortcut for empty cards for universal support
  • Loading branch information
escribapetrus committed Apr 25, 2024
1 parent b7e782c commit 074becc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Lucas Scharenbroch <lucasscharenbroch@gmail.com>
Antonio Cavallo <a.cavallo@cavallinux.eu>
Han Yeong-woo <han@yeongwoo.dev>
Jean Khawand <jk@jeankhawand.com>
Pedro Schreiber <schreiber.mmb@gmail.com>
Pedro Schreiber <schreiber.mmb@gmail.com>
Foxy_null <https://github.com/Foxy-null>
Arbyste <arbyste@outlook.com>
Vasll <github.com/vasll>
Expand Down
3 changes: 3 additions & 0 deletions qt/aqt/forms/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@
<property name="text">
<string>qt_misc_empty_cards</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+E</string>
</property>
</action>
<action name="actionCreateFiltered">
<property name="text">
Expand Down
10 changes: 9 additions & 1 deletion ts/editor/editor-toolbar/ImageOcclusionButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import DynamicallySlottable from "$lib/components/DynamicallySlottable.svelte";
import Icon from "$lib/components/Icon.svelte";
import IconButton from "$lib/components/IconButton.svelte";
import Shortcut from "$lib/components/Shortcut.svelte";
import { mdiTableRefresh, mdiViewDashboard } from "$lib/components/icons";
import {
ioImageLoadedStore,
ioMaskEditorVisible,
} from "../../routes/image-occlusion/store";
import { toggleMaskEditorKeyCombination } from "../../routes/image-occlusion/tools/shortcuts";
export let api = {};
</script>
Expand All @@ -39,10 +41,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => {
$ioMaskEditorVisible = !$ioMaskEditorVisible;
}}
tooltip={tr.editingImageOcclusionToggleMaskEditor()}
tooltip="{tr.editingImageOcclusionToggleMaskEditor()} ({toggleMaskEditorKeyCombination})"
>
<Icon icon={mdiViewDashboard} />
</IconButton>
<Shortcut
keyCombination={toggleMaskEditorKeyCombination}
on:action={() => {
$ioMaskEditorVisible = !$ioMaskEditorVisible;
}}
/>
</ButtonGroupItem>
<ButtonGroupItem>
<IconButton
Expand Down
1 change: 1 addition & 0 deletions ts/routes/image-occlusion/tools/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export const alignRightKeyCombination = "Shift+R";
export const alignTopKeyCombination = "Shift+T";
export const alignVerticalCenterKeyCombination = "Shift+V";
export const alignBottomKeyCombination = "Shift+B";
export const toggleMaskEditorKeyCombination = "Control+Shift+M";

0 comments on commit 074becc

Please sign in to comment.