Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Introducing a handler for settings (about:preferences) that change. T…
Browse files Browse the repository at this point in the history
…his first handler will show/hide the application menu.
  • Loading branch information
bsclifton authored and bbondy committed May 11, 2016
1 parent c2826f1 commit 61b820b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions js/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ const filterOutNonRecents = debounce(() => {
emitChanges()
}, 60 * 1000)

function handleChangeSettingAction (settingKey, settingValue) {
switch (settingKey) {
case settings.AUTO_HIDE_MENU_BAR:
BrowserWindow.getAllWindows().forEach(function (wnd) {
wnd.setAutoHideMenuBar(settingValue)
wnd.setMenuBarVisibility(!settingValue)
})
break
default:
}
}

const handleAppAction = (action) => {
switch (action.actionType) {
case AppConstants.APP_SET_STATE:
Expand Down Expand Up @@ -393,6 +405,7 @@ const handleAppAction = (action) => {
break
case AppConstants.APP_CHANGE_SETTING:
appState = appState.setIn(['settings', action.key], action.value)
handleChangeSettingAction(action.key, action.value)
break
case AppConstants.APP_CHANGE_SITE_SETTING:
let propertyName = action.temporary ? 'temporarySiteSettings' : 'siteSettings'
Expand Down

0 comments on commit 61b820b

Please sign in to comment.