Browse Source

Merge pull request #1622 from KTOmega/left-service-bar

Add a preference to change the docking position of the service tab bar.
pull/1655/head
Ramiro Saenz 7 years ago committed by GitHub
parent
commit
3a4c89bd65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/view/main/Main.js
  2. 16
      app/view/main/MainController.js
  3. 21
      app/view/preferences/Preferences.js
  4. 3
      electron/main.js

1
app/view/main/Main.js

@ -385,5 +385,6 @@ Ext.define('Rambox.view.main.Main', {
,add: 'updatePositions'
,remove: 'updatePositions'
,childmove: 'updatePositions'
,boxready: 'initialize'
}
});

16
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;

21
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'

3
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);

Loading…
Cancel
Save