@@ -129,7 +129,9 @@ const SettingsPage = createReactClass({
|
|||||||
version: settings.version,
|
version: settings.version,
|
||||||
minimizeToTray: this.state.minimizeToTray,
|
minimizeToTray: this.state.minimizeToTray,
|
||||||
notifications: {
|
notifications: {
|
||||||
flashWindow: this.state.notifications.flashWindow
|
flashWindow: this.state.notifications.flashWindow,
|
||||||
|
bounceIcon: this.state.notifications.bounceIcon,
|
||||||
|
bounceIconType: this.state.notifications.bounceIconType
|
||||||
},
|
},
|
||||||
showUnreadBadge: this.state.showUnreadBadge,
|
showUnreadBadge: this.state.showUnreadBadge,
|
||||||
useSpellChecker: this.state.useSpellChecker,
|
useSpellChecker: this.state.useSpellChecker,
|
||||||
@@ -219,11 +221,30 @@ const SettingsPage = createReactClass({
|
|||||||
handleFlashWindow() {
|
handleFlashWindow() {
|
||||||
this.setState({
|
this.setState({
|
||||||
notifications: {
|
notifications: {
|
||||||
|
...this.state.notifications,
|
||||||
flashWindow: this.refs.flashWindow.props.checked ? 0 : 2
|
flashWindow: this.refs.flashWindow.props.checked ? 0 : 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
||||||
},
|
},
|
||||||
|
handleBounceIcon() {
|
||||||
|
this.setState({
|
||||||
|
notifications: {
|
||||||
|
...this.state.notifications,
|
||||||
|
bounceIcon: !this.refs.bounceIcon.props.checked
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
||||||
|
},
|
||||||
|
handleBounceIconType(event) {
|
||||||
|
this.setState({
|
||||||
|
notifications: {
|
||||||
|
...this.state.notifications,
|
||||||
|
bounceIconType: event.target.value
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
||||||
|
},
|
||||||
handleShowUnreadBadge() {
|
handleShowUnreadBadge() {
|
||||||
this.setState({
|
this.setState({
|
||||||
showUnreadBadge: !this.refs.showUnreadBadge.props.checked
|
showUnreadBadge: !this.refs.showUnreadBadge.props.checked
|
||||||
@@ -419,6 +440,45 @@ const SettingsPage = createReactClass({
|
|||||||
</Checkbox>);
|
</Checkbox>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
options.push(
|
||||||
|
<FormGroup>
|
||||||
|
<Checkbox
|
||||||
|
inline={true}
|
||||||
|
key='bounceIcon'
|
||||||
|
id='inputBounceIcon'
|
||||||
|
ref='bounceIcon'
|
||||||
|
checked={this.state.notifications.bounceIcon}
|
||||||
|
onChange={this.handleBounceIcon}
|
||||||
|
style={{marginRight: '10px'}}
|
||||||
|
>{'Bounce the dock icon'}
|
||||||
|
</Checkbox>
|
||||||
|
<Radio
|
||||||
|
inline={true}
|
||||||
|
name='bounceIconType'
|
||||||
|
value='informational'
|
||||||
|
disabled={!this.state.notifications.bounceIcon}
|
||||||
|
defaultChecked={this.state.notifications.bounceIconType === 'informational'}
|
||||||
|
onChange={this.handleBounceIconType}
|
||||||
|
>{'once'}</Radio>
|
||||||
|
{' '}
|
||||||
|
<Radio
|
||||||
|
inline={true}
|
||||||
|
name='bounceIconType'
|
||||||
|
value='critical'
|
||||||
|
disabled={!this.state.notifications.bounceIcon}
|
||||||
|
defaultChecked={this.state.notifications.bounceIconType === 'critical'}
|
||||||
|
onChange={this.handleBounceIconType}
|
||||||
|
>{'until I open the app'}</Radio>
|
||||||
|
<HelpBlock
|
||||||
|
style={{marginLeft: '20px'}}
|
||||||
|
>
|
||||||
|
{'If enabled, the dock icon bounces once or until the user opens the app when a new message is received.'}
|
||||||
|
</HelpBlock>
|
||||||
|
</FormGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform === 'darwin' || process.platform === 'linux') {
|
if (process.platform === 'darwin' || process.platform === 'linux') {
|
||||||
options.push(
|
options.push(
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@@ -9,7 +9,9 @@ const defaultPreferences = {
|
|||||||
trayIconTheme: 'light',
|
trayIconTheme: 'light',
|
||||||
minimizeToTray: false,
|
minimizeToTray: false,
|
||||||
notifications: {
|
notifications: {
|
||||||
flashWindow: 0
|
flashWindow: 0,
|
||||||
|
bounceIcon: 0,
|
||||||
|
bounceIconType: 'informational'
|
||||||
},
|
},
|
||||||
showUnreadBadge: true,
|
showUnreadBadge: true,
|
||||||
useSpellChecker: true,
|
useSpellChecker: true,
|
||||||
|
@@ -409,6 +409,10 @@ app.on('ready', () => {
|
|||||||
mainWindow.flashFrame(true);
|
mainWindow.flashFrame(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'darwin' && config.notifications.bounceIcon) {
|
||||||
|
app.dock.bounce(config.notifications.bounceIconType);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('update-title', (event, arg) => {
|
ipcMain.on('update-title', (event, arg) => {
|
||||||
|
Reference in New Issue
Block a user