Skip to content

Commit

Permalink
Added: "Left click on active tabs panel" option
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Jun 3, 2021
1 parent 981991b commit eab78fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions addon/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { translate } from './locales/dict.js'
// prettier-ignore
export const SETTINGS_OPTIONS = {
autoHideCtxMenuOpts: [250, 500, 1000, 'none'],
navActTabsPanelLeftClickActionOpts: ['new_tab', 'none'],
navMidClickActionOpts: ['rm_act_tab', 'rm_all', 'none'],
groupLayoutOpts: ['grid', 'list'],
scrollThroughTabsOpts: ['panel', 'global', 'none'],
Expand Down Expand Up @@ -72,6 +73,7 @@ export const DEFAULT_SETTINGS = {
hideSettingsBtn: false,
navBtnCount: true,
hideEmptyPanels: true,
navActTabsPanelLeftClickAction: 'none',
navMidClickAction: 'none',
navSwitchPanelsWheel: true,

Expand Down
3 changes: 3 additions & 0 deletions addon/locales/en.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
'settings.hide_add_btn': { message: 'Hide "Create panel" button' },
'settings.nav_btn_count': { message: 'Show count of tabs/bookmarks' },
'settings.hide_empty_panels': { message: 'Hide empty panels' },
'settings.nav_act_tabs_panel_left_click': { message: 'Left click on active tabs panel' },
'settings.nav_act_tabs_panel_left_click_new_tab': { message: 'create tab' },
'settings.nav_act_tabs_panel_left_click_none': { message: 'none' },
'settings.nav_mid_click': { message: 'Middle click on panel button' },
'settings.nav_mid_click_rm_act_tab': { message: 'close active tab' },
'settings.nav_mid_click_rm_all': { message: 'close tabs' },
Expand Down
5 changes: 5 additions & 0 deletions addon/locales/ru.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export default {
'settings.hide_add_btn': { message: 'Скрывать кнопку "Создать панель"' },
'settings.nav_btn_count': { message: 'Показывать количество табов/закладок' },
'settings.hide_empty_panels': { message: 'Скрывать пустые панели' },
'settings.nav_act_tabs_panel_left_click': {
message: 'Клик левой кнопкой мыши по активной панели вкладок',
},
'settings.nav_act_tabs_panel_left_click_new_tab': { message: 'создать вкладку' },
'settings.nav_act_tabs_panel_left_click_none': { message: 'ничего' },
'settings.nav_mid_click': { message: 'Клик средней кнопкой мыши по кнопке панели' },
'settings.nav_mid_click_rm_act_tab': { message: 'закрыть активную вкладку' },
'settings.nav_mid_click_rm_all': { message: 'закрыть табы' },
Expand Down
6 changes: 6 additions & 0 deletions src/page.settings/components/settings.navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ section
label="settings.hide_empty_panels"
:value="$store.state.hideEmptyPanels"
@input="setOpt('hideEmptyPanels', $event)")
SelectField(
label="settings.nav_act_tabs_panel_left_click"
optLabel="settings.nav_act_tabs_panel_left_click_"
:value="$store.state.navActTabsPanelLeftClickAction"
:opts="$store.state.navActTabsPanelLeftClickActionOpts"
@input="setOpt('navActTabsPanelLeftClickAction', $event)")
SelectField(
label="settings.nav_mid_click"
optLabel="settings.nav_mid_click_"
Expand Down
6 changes: 5 additions & 1 deletion src/sidebar/components/nav-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ export default {
if (State.panelIndex !== i) return Actions.switchToPanel(i)
if (State.panels[i].bookmarks) return EventBus.$emit('scrollBookmarksToEdge')
if (State.panels[i].tabs) return Actions.createTabInPanel(State.panels[i])
if (State.panels[i].tabs) {
if (State.navActTabsPanelLeftClickAction === 'new_tab') {
return Actions.createTabInPanel(State.panels[i])
}
}
},
/**
Expand Down

0 comments on commit eab78fc

Please sign in to comment.