diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 920526fcf46..81bea79bc3b 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -192,6 +192,7 @@ flashAllowAlways=Allow until {{time}} alwaysAllow=Always allow alwaysDeny=Always deny appearanceSettings=Appearance Settings +disableCustomTitlebar=Disable custom titlebar (requires browser restart) autoHideMenuBar=Hide the menu bar by default disableTitleMode=Always show the URL bar tabsSettings=Tabs Settings diff --git a/app/locale.js b/app/locale.js index 6ab7016475a..467db344949 100644 --- a/app/locale.js +++ b/app/locale.js @@ -156,6 +156,7 @@ var rendererIdentifiers = function () { 'lookupSelection', // Other identifiers 'urlCopied', + 'disableCustomTitlebar', 'autoHideMenuBar', 'unexpectedErrorWindowReload', 'updateChannel', diff --git a/js/about/preferences.js b/js/about/preferences.js index cfd19e1269a..57901d876b1 100644 --- a/js/about/preferences.js +++ b/js/about/preferences.js @@ -549,6 +549,9 @@ class GeneralTab extends ImmutableComponent {
+ { + isWindows ? : null + } { isDarwin ? null : } @@ -1337,7 +1340,8 @@ class AboutPreferences extends React.Component { }) aboutActions.changeSetting(key, value) if (key === settings.DO_NOT_TRACK || key === settings.HARDWARE_ACCELERATION_ENABLED || - key === settings.PDFJS_ENABLED || key === settings.SMOOTH_SCROLL_ENABLED) { + key === settings.PDFJS_ENABLED || key === settings.SMOOTH_SCROLL_ENABLED || + key === settings.DISABLE_CUSTOM_TITLEBAR) { ipc.send(messages.PREFS_RESTART, key, value) } if (key === settings.PAYMENTS_ENABLED) { diff --git a/js/components/main.js b/js/components/main.js index d1ac473e461..1a1e40e73d3 100644 --- a/js/components/main.js +++ b/js/components/main.js @@ -749,8 +749,8 @@ class Main extends ImmutableComponent { const braverySettings = siteSettings.activeSettings(activeSiteSettings, this.props.appState, appConfig) const loginRequiredDetail = activeFrame ? basicAuthState.getLoginRequiredDetail(this.props.appState, activeFrame.get('tabId')) : null - const menubarEnabled = isWindows - const menubarVisible = menubarEnabled && (!getSetting(settings.AUTO_HIDE_MENU) || this.props.windowState.getIn(['ui', 'menubar', 'isVisible'])) + const customTitlebarEnabled = isWindows && !getSetting(settings.DISABLE_CUSTOM_TITLEBAR) + const menubarVisible = customTitlebarEnabled && (!getSetting(settings.AUTO_HIDE_MENU) || this.props.windowState.getIn(['ui', 'menubar', 'isVisible'])) const menubarTemplate = menubarVisible ? this.props.appState.getIn(['menu', 'template']) : null const menubarSelectedLabel = this.props.windowState.getIn(['ui', 'menubar', 'selectedLabel']) @@ -856,7 +856,7 @@ class Main extends ImmutableComponent {
{ - menubarEnabled + customTitlebarEnabled ? : null } diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 455143251d1..9194733515e 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -86,6 +86,7 @@ module.exports = { 'general.show-home-button': false, 'general.useragent.value': null, // Set at runtime 'general.autohide-menu': true, + 'general.disable-custom-titlebar': false, 'search.default-search-engine': 'Google', 'search.offer-search-suggestions': false, // false by default for privacy reasons 'tabs.switch-to-new-tabs': false, diff --git a/js/constants/settings.js b/js/constants/settings.js index d586fe30ba3..ca4243e9299 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -11,6 +11,7 @@ const settings = { DEFAULT_DOWNLOAD_SAVE_PATH: 'general.downloads.default-save-path', AUTO_HIDE_MENU: 'general.autohide-menu', DISABLE_TITLE_MODE: 'general.disable-title-mode', + DISABLE_CUSTOM_TITLEBAR: 'general.disable-custom-titlebar', // Search tab DEFAULT_SEARCH_ENGINE: 'search.default-search-engine', OFFER_SEARCH_SUGGESTIONS: 'search.offer-search-suggestions', diff --git a/js/stores/appStore.js b/js/stores/appStore.js index 9a7bf025e12..1280e4a9e9c 100644 --- a/js/stores/appStore.js +++ b/js/stores/appStore.js @@ -126,6 +126,7 @@ const createWindow = (browserOpts, defaults, frameOpts, windowState) => { browserOpts.height = browserOpts.height < minHeight ? minHeight : browserOpts.height const autoHideMenuBarSetting = isDarwin || getSetting(settings.AUTO_HIDE_MENU) + const isCustomTitlebarDisabled = !isWindows || getSetting(settings.DISABLE_CUSTOM_TITLEBAR) const windowProps = { // smaller min size for "modal" windows @@ -138,7 +139,7 @@ const createWindow = (browserOpts, defaults, frameOpts, windowState) => { autoHideMenuBar: autoHideMenuBarSetting, title: appConfig.name, webPreferences: defaults.webPreferences, - frame: !isWindows + frame: isCustomTitlebarDisabled } if (process.platform === 'linux') { diff --git a/less/navigationBar.less b/less/navigationBar.less index 6ab8038a3a7..aa9939b596d 100644 --- a/less/navigationBar.less +++ b/less/navigationBar.less @@ -416,6 +416,7 @@ .menubar { display: inline-block; cursor: default; + -webkit-user-select: none; .menubarItem { color: black;