Experiment quick open Shortcuts Settings

This commit is contained in:
Lim Chee Aun 2023-11-03 22:08:44 +08:00
parent 1f039a4d73
commit dc1452ab30
2 changed files with 29 additions and 2 deletions

View file

@ -49,7 +49,24 @@ function Columns() {
}
});
return <div id="columns">{components}</div>;
return (
<div
id="columns"
onContextMenu={(e) => {
// If right-click on header, but not links or buttons
if (
e.target.closest('.deck > header') &&
!e.target.closest('a') &&
!e.target.closest('button')
) {
e.preventDefault();
states.showShortcutsSettings = true;
}
}}
>
{components}
</div>
);
}
export default Columns;

View file

@ -90,7 +90,13 @@ function Shortcuts() {
return (
<div id="shortcuts">
{snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? (
<nav class="tab-bar">
<nav
class="tab-bar"
onContextMenu={(e) => {
e.preventDefault();
states.showShortcutsSettings = true;
}}
>
<ul>
{formattedShortcuts.map(
({ id, path, title, subtitle, icon }, i) => {
@ -146,6 +152,10 @@ function Shortcuts() {
type="button"
id="shortcuts-button"
class="plain"
onContextMenu={(e) => {
e.preventDefault();
states.showShortcutsSettings = true;
}}
onTransitionStart={(e) => {
// Close menu if the button disappears
try {