Browse Source

Fixed bug on display/close behaviors

Fixes #909
pull/1203/head
Ramiro Saenz 8 years ago
parent
commit
86b1eee742
  1. 2
      app/view/preferences/Preferences.js
  2. 6
      app/view/preferences/PreferencesController.js
  3. 1
      electron/main.js

2
app/view/preferences/Preferences.js

@ -176,7 +176,7 @@ Ext.define('Rambox.view.preferences.Preferences',{
fields: ['value', 'label'] fields: ['value', 'label']
,data: [ ,data: [
{ 'value': 'keep_in_tray', 'label': 'Keep in tray' } { 'value': 'keep_in_tray', 'label': 'Keep in tray' }
,{ 'value': 'keep_in_tray_and_taskbar', 'label': 'Keep in tray and taskbar' } ,{ 'value': 'keep_in_tray_and_taskbar', 'label': 'Keep in tray and/or taskbar' }
,{ 'value': 'quit', 'label': 'Quit' } ,{ 'value': 'quit', 'label': 'Quit' }
] ]
}) })

6
app/view/preferences/PreferencesController.js

@ -39,6 +39,12 @@ Ext.define('Rambox.view.preferences.PreferencesController', {
// Proxy // Proxy
if ( values.proxy && (Ext.isEmpty(values.proxyHost) || Ext.isEmpty(values.proxyPort)) ) return; if ( values.proxy && (Ext.isEmpty(values.proxyHost) || Ext.isEmpty(values.proxyPort)) ) return;
// Display behaviour
if ( values.window_display_behavior === 'show_taskbar' && values.window_close_behavior === 'keep_in_tray' ) {
Ext.Msg.alert('Action required', 'You need to change the window closing behaviour because "Keep in tray" is not possible.');
return;
}
// Locale // Locale
if ( values.locale !== ipc.sendSync('getConfig').locale ) { if ( values.locale !== ipc.sendSync('getConfig').locale ) {
localStorage.setItem('locale', values.locale); localStorage.setItem('locale', values.locale);

1
electron/main.js

@ -162,6 +162,7 @@ function createWindow () {
}); });
if ( !config.get('start_minimized') && config.get('maximized') ) mainWindow.maximize(); if ( !config.get('start_minimized') && config.get('maximized') ) mainWindow.maximize();
if ( config.get('window_display_behavior') !== 'show_trayIcon' && config.get('start_minimized') ) mainWindow.minimize();
// Check if the window its outside of the view (ex: multi monitor setup) // Check if the window its outside of the view (ex: multi monitor setup)
const { positionOnScreen } = require('./utils/positionOnScreen'); const { positionOnScreen } = require('./utils/positionOnScreen');

Loading…
Cancel
Save