feat: Replace close shortcut options for pinned tabs with a single menulist

This commit replaces the four separate checkboxes for close shortcut options for pinned tabs with a single menulist. This makes the UI more streamlined and user-friendly, as users can now easily select from a list of available options instead of having to check or uncheck multiple boxes.

The new menulist offers the following options:

- reset-unload-switch: Resets the tab if it was changed, otherwise unloads it.
- unload-switch: Unloads the tab if it was changed, otherwise does nothing.
- reset-switch: Resets the tab if it was changed, otherwise switches to it.
- switch: Switches to the tab.
- reset: Resets the tab.
- close: Closes the tab.

This provides a more comprehensive and flexible set of options for managing pinned tabs, making the experience more intuitive and customizable.
This commit is contained in:
Kristijan Ribarić
2024-10-08 21:07:06 +02:00
parent 948cfc4034
commit 8c04cda18b
2 changed files with 18 additions and 21 deletions

View File

@@ -1020,14 +1020,14 @@ Preferences.addAll([
type: 'bool',
default: false,
},
{
id: 'zen.pinned-tab-manager.reset-pinned-tab-on-close-shortcut',
type: 'bool',
default: true,
},
{
id: 'zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url',
type: 'bool',
default: true,
},
{
id: 'zen.pinned-tab-manager.close-shortcut-behavior',
type: 'string',
default: 'switch',
},
]);

View File

@@ -75,22 +75,19 @@
data-l10n-id="zen-pinned-tab-manager-restore-pinned-tabs-to-pinned-url"
preference="zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url"/>
<label><html:h2 data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-description" />
<vbox class="indent">
<checkbox id="zenPinnedTabResetOnCloseShortcutEnable"
data-l10n-id="zen-pinned-tab-manager-reset-close-shortcut-enabled"
preference="zen.pinned-tab-manager.reset-pinned-tab-on-close-shortcut"/>
<checkbox id="zenPinnedTabUnloadOnCloseShortcutEnable"
data-l10n-id="zen-pinned-tab-manager-unload-close-shortcut-enabled"
preference="zen.pinned-tab-manager.unload-pinned-tab-on-close-shortcut"/>
<checkbox id="zenPinnedTabChangeOnCloseShortcutEnable"
data-l10n-id="zen-pinned-tab-manager-change-close-shortcut-enabled"
preference="zen.pinned-tab-manager.change-pinned-tab-on-close-shortcut"/>
<checkbox id="zenPinnedTabCloseOnCloseShortcutEnable"
data-l10n-id="zen-pinned-tab-manager-close-close-shortcut-enabled"
preference="zen.pinned-tab-manager.close-pinned-tab-on-close-shortcut"/>
</vbox>
<hbox align="center">
<label id="zenPinnedTabCloseShortcutBehaviorLabel" data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-label"/>
<menulist id="zenPinnedTabCloseShortcutBehavior" preference="zen.pinned-tab-manager.close-shortcut-behavior">
<menupopup>
<menuitem data-l10n-id="zen-pinned-tab-manager-reset-unload-switch-close-shortcut-option" value="reset-unload-switch"/>
<menuitem data-l10n-id="zen-pinned-tab-manager-unload-switch-close-shortcut-option" value="unload-switch"/>
<menuitem data-l10n-id="zen-pinned-tab-manager-reset-switch-close-shortcut-option" value="reset-switch"/>
<menuitem data-l10n-id="zen-pinned-tab-manager-switch-close-shortcut-option" value="switch"/>
<menuitem data-l10n-id="zen-pinned-tab-manager-reset-close-shortcut-option" value="reset"/>
<menuitem data-l10n-id="zen-pinned-tab-manager-close-close-shortcut-option" value="close"/>
</menupopup>
</menulist>
</hbox>
</groupbox>
</html:template>