Browse Source

Propagate config changes to view.

Now, the controller's `initialize` function is called every time the
user's preferences are changed. This was done so that it could re-orient
the service bar every time the configuration is changed, but could be
extended down the line for other configuration options.
pull/1622/head
Kevin Tran 7 years ago
parent
commit
41783e4931
  1. 7
      app/view/main/MainController.js
  2. 2
      electron/main.js

7
app/view/main/MainController.js

@ -7,9 +7,10 @@ Ext.define('Rambox.view.main.MainController', {
const config = ipc.sendSync('getConfig'); const config = ipc.sendSync('getConfig');
if ( config.left_tabbar === true ) { if ( config.left_tabbar === true ) {
const mainView = Ext.cq1('app-main'); tabPanel.setTabPosition('left');
mainView.setTabPosition('left'); tabPanel.setTabRotation(0);
mainView.setTabRotation(0); } else {
tabPanel.setTabPosition('top');
} }
} }

2
electron/main.js

@ -318,6 +318,8 @@ ipcMain.on('setConfig', function(event, values) {
// systemtray_indicator // systemtray_indicator
updateBadge(mainWindow.getTitle()); updateBadge(mainWindow.getTitle());
mainWindow.webContents.executeJavaScript('(function(a){if(a)a.controller.initialize(a);})(Ext.cq1("app-main"))');
switch ( values.window_display_behavior ) { switch ( values.window_display_behavior ) {
case 'show_taskbar': case 'show_taskbar':
mainWindow.setSkipTaskbar(false); mainWindow.setSkipTaskbar(false);

Loading…
Cancel
Save