Mark duplicate hotkeys

This commit is contained in:
Benjamin Brandmeier
2022-12-18 13:34:06 +01:00
committed by Eugene
parent bc243a2741
commit 72bc58332d
7 changed files with 77 additions and 28 deletions

View File

@@ -3,6 +3,11 @@ export interface HotkeyDescription {
name: string
}
export interface Hotkey {
strokes: string[] | string; // may be a sequence of strokes
isDuplicate: boolean;
}
/**
* Extend to provide your own hotkeys. A corresponding [[ConfigProvider]]
* must also provide the `hotkeys.foo` config options with the default values

View File

@@ -256,6 +256,11 @@ multi-hotkey-input {
}
}
.item:has(.duplicate) {
background-color: theme-color('danger');
border: 1px solid theme-color('danger');
}
.add {
color: #777;
padding: 4px 10px 0;
@@ -265,6 +270,11 @@ multi-hotkey-input {
&:hover { background: darken($body-bg2, 5%); }
&:active { background: darken($body-bg2, 15%); }
}
.add:has(.duplicate), .item:has(.duplicate) .body, .item:has(.duplicate) .remove {
&:hover { background: darken(theme-color('danger'), 5%); }
&:active { background: darken(theme-color('danger'), 15%); }
}
}
hotkey-input-modal {

View File

@@ -162,6 +162,11 @@ multi-hotkey-input {
}
}
.item:has(.duplicate) {
background-color: theme-color('danger');
border: 1px solid theme-color('danger');
}
.add {
color: #777;
padding: 4px 10px 0;
@@ -171,6 +176,11 @@ multi-hotkey-input {
&:hover { background: darken($body-bg2, 5%); }
&:active { background: darken($body-bg2, 15%); }
}
.add:has(.duplicate), .item:has(.duplicate) .body, .item:has(.duplicate) .remove {
&:hover { background: darken(theme-color('danger'), 5%); }
&:active { background: darken(theme-color('danger'), 15%); }
}
}
hotkey-input-modal {