From caf47c70512f0992ff5692cd9d2ba53aff755aa2 Mon Sep 17 00:00:00 2001 From: Kevin Tran Date: Sat, 28 Apr 2018 19:18:44 -0700 Subject: [PATCH] Allow service bar to be snapped to any side Top, left, bottom, right. --- app/view/main/MainController.js | 7 +------ app/view/preferences/Preferences.js | 23 +++++++++++++++++++---- electron/main.js | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index 38972557..ddbe6869 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -6,12 +6,7 @@ Ext.define('Rambox.view.main.MainController', { ,initialize: function( tabPanel ) { const config = ipc.sendSync('getConfig'); - if ( config.left_tabbar === true ) { - tabPanel.setTabPosition('left'); - } else { - tabPanel.setTabPosition('top'); - } - + tabPanel.setTabPosition(config.tabbar_location); tabPanel.setTabRotation(0); } diff --git a/app/view/preferences/Preferences.js b/app/view/preferences/Preferences.js index 1727e92a..2f7704eb 100644 --- a/app/view/preferences/Preferences.js +++ b/app/view/preferences/Preferences.js @@ -147,10 +147,25 @@ Ext.define('Rambox.view.preferences.Preferences',{ ,hidden: process.platform === 'darwin' } ,{ - xtype: 'checkbox' - ,name: 'left_tabbar' - ,boxLabel: 'Vertical service bar' - ,value: config.left_tabbar + xtype: 'combo' + ,name: 'tabbar_location' + ,fieldLabel: 'Service bar location' + ,labelAlign: 'left' + ,width: 380 + ,labelWidth: 105 + ,value: config.tabbar_location + ,displayField: 'label' + ,valueField: 'value' + ,editable: false + ,store: Ext.create('Ext.data.Store', { + fields: ['value', 'label'] + ,data: [ + { 'value': 'top', 'label': 'Top' } + ,{ 'value': 'left', 'label': 'Left' } + ,{ 'value': 'bottom', 'label': 'Bottom' } + ,{ 'value': 'right', 'label': 'Right' } + ] + }) } ,{ xtype: 'combo' diff --git a/electron/main.js b/electron/main.js index ecafc1d9..3fc125b8 100644 --- a/electron/main.js +++ b/electron/main.js @@ -20,7 +20,7 @@ const config = new Config({ defaults: { always_on_top: false ,hide_menu_bar: false - ,left_tabbar: false + ,tabbar_location: 'top' ,window_display_behavior: 'taskbar_tray' ,auto_launch: !isDev ,flash_frame: true