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

Commit

Permalink
Auto hide menu bar for Windows
Browse files Browse the repository at this point in the history
Auditors: @aekeus
  • Loading branch information
bbondy committed May 13, 2016
1 parent efb6712 commit 176eea6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fix for URL bar context menu selection detection. ([#1709](https://github.com/brave/browser-laptop/issues/1709))
- Fix for disabling extensions without a browser restart. ([#1707](https://github.com/brave/browser-laptop/issues/1707))
- Fix zoom indicator in hamburger menu in private tabs. ([#1706](https://github.com/brave/browser-laptop/issues/1706))
- Menu bar is now auto hidden by default unless turned on. ([#1730](https://github.com/brave/browser-laptop/issues/1730))

## [0.9.5](https://github.com/brave/browser-laptop/releases/v0.9.5dev)
- Added spell check. ([#859](https://github.com/brave/browser-laptop/issues/859))
Expand Down
2 changes: 1 addition & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class GeneralTab extends ImmutableComponent {
<SettingsList dataL10nId='appearanceSettings'>
<SettingCheckbox dataL10nId='showHomeButton' prefKey={settings.SHOW_HOME_BUTTON} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
{
isDarwin ? null : <SettingCheckbox dataL10nId='autoHideMenuBar' prefKey={settings.AUTO_HIDE_MENU_BAR} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
isDarwin ? null : <SettingCheckbox dataL10nId='autoHideMenuBar' prefKey={settings.AUTO_HIDE_MENU} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
}
</SettingsList>
</SettingsList>
Expand Down
4 changes: 2 additions & 2 deletions js/commonMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ module.exports.bookmarksToolbarMenuItem = () => {
}

module.exports.autoHideMenuBarMenuItem = () => {
const autoHideMenuBar = getSetting(settings.AUTO_HIDE_MENU_BAR)
const autoHideMenuBar = getSetting(settings.AUTO_HIDE_MENU)
return {
label: locale.translation('autoHideMenuBar'),
type: 'checkbox',
checked: autoHideMenuBar,
click: (item, focusedWindow) => {
appActions.changeSetting(settings.AUTO_HIDE_MENU_BAR, !autoHideMenuBar)
appActions.changeSetting(settings.AUTO_HIDE_MENU, !autoHideMenuBar)
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const updateHost = process.env.BRAVE_UPDATE_HOST || 'https://brave-laptop-update
const winUpdateHost = process.env.BRAVE_WIN_UPDATE_HOST || 'https://brave-download.global.ssl.fastly.net'
const crashURL = process.env.BRAVE_CRASH_URL || 'https://laptop-updates.brave.com/1/crashes'

// Windows specific configuration settings.
const autoHideMenuBar = process.platform !== 'win32'

module.exports = {
name: 'Brave',
contactUrl: 'mailto:[email protected]',
Expand Down Expand Up @@ -80,7 +77,7 @@ module.exports = {
'general.homepage': 'https://www.brave.com',
'general.show-home-button': false,
'general.useragent.value': null, // Set at runtime
'general.autohide-menubar': autoHideMenuBar,
'general.autohide-menu': true,
'search.default-search-engine': 'content/search/google.xml',
'tabs.switch-to-new-tabs': false,
'tabs.paint-tabs': true,
Expand Down
2 changes: 1 addition & 1 deletion js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const settings = {
SHOW_HOME_BUTTON: 'general.show-home-button',
USERAGENT: 'general.useragent.value',
DEFAULT_DOWNLOAD_SAVE_PATH: 'general.downloads.default-save-path',
AUTO_HIDE_MENU_BAR: 'general.autohide-menubar',
AUTO_HIDE_MENU: 'general.autohide-menu',
// Search tab
DEFAULT_SEARCH_ENGINE: 'search.default-search-engine',
// Tabs tab
Expand Down
4 changes: 2 additions & 2 deletions js/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const createWindow = (browserOpts, defaults) => {
browserOpts.width = browserOpts.width < minWidth ? minWidth : browserOpts.width
browserOpts.height = browserOpts.height < minHeight ? minHeight : browserOpts.height

const autoHideMenuBarSetting = isDarwin || getSetting(settings.AUTO_HIDE_MENU_BAR)
const autoHideMenuBarSetting = isDarwin || getSetting(settings.AUTO_HIDE_MENU)

let mainWindow = new BrowserWindow(Object.assign({
// smaller min size for "modal" windows
Expand Down Expand Up @@ -247,7 +247,7 @@ const filterOutNonRecents = debounce(() => {

function handleChangeSettingAction (settingKey, settingValue) {
switch (settingKey) {
case settings.AUTO_HIDE_MENU_BAR:
case settings.AUTO_HIDE_MENU:
BrowserWindow.getAllWindows().forEach(function (wnd) {
wnd.setAutoHideMenuBar(settingValue)
wnd.setMenuBarVisibility(!settingValue)
Expand Down

0 comments on commit 176eea6

Please sign in to comment.