Skip to content

Commit

Permalink
Added: "Left click on active bookmarks panel" option
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Jun 3, 2021
1 parent eab78fc commit 128e3ed
Show file tree
Hide file tree
Showing 5 changed files with 23 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 @@ -4,6 +4,7 @@ import { translate } from './locales/dict.js'
export const SETTINGS_OPTIONS = {
autoHideCtxMenuOpts: [250, 500, 1000, 'none'],
navActTabsPanelLeftClickActionOpts: ['new_tab', 'none'],
navActBookmarksPanelLeftClickActionOpts: ['scroll', 'none'],
navMidClickActionOpts: ['rm_act_tab', 'rm_all', 'none'],
groupLayoutOpts: ['grid', 'list'],
scrollThroughTabsOpts: ['panel', 'global', 'none'],
Expand Down Expand Up @@ -74,6 +75,7 @@ export const DEFAULT_SETTINGS = {
navBtnCount: true,
hideEmptyPanels: true,
navActTabsPanelLeftClickAction: 'none',
navActBookmarksPanelLeftClickAction: 'none',
navMidClickAction: 'none',
navSwitchPanelsWheel: true,

Expand Down
5 changes: 5 additions & 0 deletions addon/locales/en.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export default {
'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_act_bookmarks_panel_left_click': {
message: 'Left click on active bookmarks panel',
},
'settings.nav_act_bookmarks_panel_left_click_scroll': { message: 'scroll to start/end' },
'settings.nav_act_bookmarks_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 @@ -88,6 +88,11 @@ export default {
},
'settings.nav_act_tabs_panel_left_click_new_tab': { message: 'создать вкладку' },
'settings.nav_act_tabs_panel_left_click_none': { message: 'ничего' },
'settings.nav_act_bookmarks_panel_left_click': {
message: 'Клик левой кнопкой мыши по активной панели закладок',
},
'settings.nav_act_bookmarks_panel_left_click_scroll': { message: 'проскроллить к началу/концу' },
'settings.nav_act_bookmarks_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 @@ -35,6 +35,12 @@ section
:value="$store.state.navActTabsPanelLeftClickAction"
:opts="$store.state.navActTabsPanelLeftClickActionOpts"
@input="setOpt('navActTabsPanelLeftClickAction', $event)")
SelectField(
label="settings.nav_act_bookmarks_panel_left_click"
optLabel="settings.nav_act_bookmarks_panel_left_click_"
:value="$store.state.navActBookmarksPanelLeftClickAction"
:opts="$store.state.navActBookmarksPanelLeftClickActionOpts"
@input="setOpt('navActBookmarksPanelLeftClickAction', $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 @@ -226,7 +226,11 @@ export default {
}
if (State.panelIndex !== i) return Actions.switchToPanel(i)
if (State.panels[i].bookmarks) return EventBus.$emit('scrollBookmarksToEdge')
if (State.panels[i].bookmarks) {
if (State.navActBookmarksPanelLeftClickAction === 'scroll') {
return EventBus.$emit('scrollBookmarksToEdge')
}
}
if (State.panels[i].tabs) {
if (State.navActTabsPanelLeftClickAction === 'new_tab') {
return Actions.createTabInPanel(State.panels[i])
Expand Down

0 comments on commit 128e3ed

Please sign in to comment.