diff --git a/app/view/main/Main.js b/app/view/main/Main.js index 34d9d1c3..cb6e10e4 100644 --- a/app/view/main/Main.js +++ b/app/view/main/Main.js @@ -385,5 +385,6 @@ Ext.define('Rambox.view.main.Main', { ,add: 'updatePositions' ,remove: 'updatePositions' ,childmove: 'updatePositions' + ,boxready: 'initialize' } }); diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index 916d1489..25d2e7c7 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -3,6 +3,22 @@ Ext.define('Rambox.view.main.MainController', { ,alias: 'controller.main' + ,initialize: function( tabPanel ) { + const config = ipc.sendSync('getConfig'); + + tabPanel.setTabPosition(config.tabbar_location); + tabPanel.setTabRotation(0); + + let reorderer = tabPanel.plugins.find((plugin) => plugin.ptype == "tabreorderer"); + + if ( reorderer !== undefined ) { + const names = reorderer.container.getLayout().names; + reorderer.dd.dim = names.width; + reorderer.dd.startAttr = names.beforeX; + reorderer.dd.endAttr = names.afterX; + } + } + // Make focus on webview every time the user change tabs, to enable the autofocus in websites ,onTabChange: function( tabPanel, newTab, oldTab ) { var me = this; diff --git a/app/view/preferences/Preferences.js b/app/view/preferences/Preferences.js index 436ebe77..2cf19579 100644 --- a/app/view/preferences/Preferences.js +++ b/app/view/preferences/Preferences.js @@ -146,6 +146,27 @@ Ext.define('Rambox.view.preferences.Preferences',{ ,value: config.hide_menu_bar ,hidden: process.platform === 'darwin' } + ,{ + xtype: 'combo' + ,name: 'tabbar_location' + ,fieldLabel: 'Service bar location' + ,labelAlign: 'left' + ,width: 380 + ,labelWidth: 180 + ,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' ,name: 'default_service' diff --git a/electron/main.js b/electron/main.js index d1d1620c..3fc125b8 100644 --- a/electron/main.js +++ b/electron/main.js @@ -20,6 +20,7 @@ const config = new Config({ defaults: { always_on_top: false ,hide_menu_bar: false + ,tabbar_location: 'top' ,window_display_behavior: 'taskbar_tray' ,auto_launch: !isDev ,flash_frame: true @@ -317,6 +318,8 @@ ipcMain.on('setConfig', function(event, values) { // systemtray_indicator updateBadge(mainWindow.getTitle()); + mainWindow.webContents.executeJavaScript('(function(a){if(a)a.controller.initialize(a)})(Ext.cq1("app-main"))'); + switch ( values.window_display_behavior ) { case 'show_taskbar': mainWindow.setSkipTaskbar(false);