-
+
+
{
this.props.titleMode
- ?
- {this.props.hostValue}
- {this.props.hostValue && this.titleValue ? ' | ' : ''}
- {this.titleValue}
-
- :
{ this.urlInput = node }} />
+ ? this.titleBar
+ : this.input
+ }
+ {
+ this.props.titleMode
+ ? null
+ : this.legend
}
-
{
this.props.showDisplayTime
- ?
{this.loadTime}
+ ? this.loadTimer
: null
}
{
- !this.props.showNoScriptInfo
- ? null
- :
-
-
+ this.props.showNoScriptInfo
+ ? this.noScriptInfo
+ : null
}
{
- this.props.showUrlBarSuggestions
- ?
- : null
- }
+ this.props.showUrlBarSuggestions
+ ?
+ : null
+ }
}
}
const styles = StyleSheet.create({
- noScriptContainer: {
+ urlbarForm: {
display: 'flex',
- padding: '5px',
- marginRight: '-8px',
- WebkitAppRegion: 'drag'
- },
- noScriptButton: {
- WebkitAppRegion: 'no-drag',
- backgroundImage: `url(${iconNoScript})`,
- width: '14px',
- height: '14px',
- border: '0px'
+ flexGrow: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: globalStyles.navigationBar.urlbarForm.height,
+ padding: '0 3px',
+ background: '#fff',
+
+ // Overwrite wildcard on https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L698-L700
+ WebkitAppRegion: 'drag !important',
+
+ // PR #6485
+ position: 'relative',
+
+ // Fixes #4298
+ width: 0,
+
+ // allow the navigator to shrink
+ minWidth: 0
},
urlbarForm_wide: {
// cf: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L682-L684
maxWidth: '100%'
+ },
+
+ urlbarForm_titleMode: {
+ background: 'none'
+ },
+
+ urlbarForm_notTitleMode: {
+ background: globalStyles.color.navigationBarBackgroundActive,
+ borderRadius: globalStyles.radius.borderRadiusURL,
+ borderTopLeftRadius: 0,
+ borderBottomLeftRadius: 0,
+ boxShadow: 'inset 0 0 0 1px rgba(187, 187, 187, 1.0)',
+ color: globalStyles.color.chromeText
+ },
+
+ urlbarForm_noScriptDisabled: {
+ paddingRight: '10px'
+ },
+
+ // ref: navigationBar__buttonContainer_addPublisherButtonContainer on publisherToggle.js
+ urlbarForm_isPublisherButtonEnabled: {
+ borderTopRightRadius: 0,
+ borderBottomRightRadius: 0
+ },
+
+ titleBar: {
+ display: 'inline-block',
+ color: globalStyles.color.chromeText,
+ fontSize: globalStyles.spacing.defaultFontSize,
+ maxWidth: '100%',
+ overflowX: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap'
+ },
+
+ titleBar__host: {
+ fontWeight: 600
+ },
+
+ input: {
+ background: '#fff',
+ border: 'none',
+ boxSizing: 'border-box',
+ color: '#333',
+ letterSpacing: '-0.125px',
+ cursor: 'text',
+ display: 'flex',
+ flexGrow: 1,
+ fontSize: '13.5px',
+ fontWeight: 'normal',
+ outline: 'none',
+ textOverflow: 'ellipsis',
+
+ // allow the navigator to shrink
+ minWidth: 0,
+
+ // Disable window dragging so that selecting text is possible.
+ WebkitAppRegion: 'no-drag'
+ },
+
+ input_windows: {
+ fontWeight: 500,
+ lineHeight: 1.4,
+ margin: 0, // #5624
+ top: 0, // #5624
+ width: '100%'
+ },
+
+ legend: {
+ ':before': {
+ display: 'none',
+ content: '" "',
+ position: 'absolute',
+ borderRadius: '0 4px 4px 0',
+ color: '#333',
+ boxShadow: `inset 0 0 0 1px ${globalStyles.color.urlBarOutline}, inset 0 0 0 3px ${globalStyles.color.focusUrlbarOutline}`,
+ outline: 'none',
+ top: 0,
+ bottom: 0,
+ right: 0,
+ left: 0,
+ zIndex: globalStyles.zindex.zindexNavigationBar
+ }
+ },
+
+ legend_isFocused: {
+ ':before': {
+ display: 'block'
+ }
+ },
+
+ legend_isPublisherButtonEnabled: {
+ ':before': {
+ borderRadius: 0
+ }
+ },
+
+ loadTime: {
+ color: globalStyles.color.loadTimeColor,
+ fontSize: '12px'
+ },
+
+ loadTime_onFocus: {
+ display: 'none'
+ },
+
+ noScript__button: {
+ background: `url(${iconNoScript}) center no-repeat`,
+ width: '15px',
+ height: '15px',
+ WebkitAppRegion: 'no-drag'
}
})
diff --git a/app/renderer/components/navigation/urlBarIcon.js b/app/renderer/components/navigation/urlBarIcon.js
index 1fd6fcaaaca..6e2cae98d3a 100644
--- a/app/renderer/components/navigation/urlBarIcon.js
+++ b/app/renderer/components/navigation/urlBarIcon.js
@@ -25,6 +25,9 @@ const frameStateUtil = require('../../../../js/state/frameStateUtil')
const {isSourceAboutUrl} = require('../../../../js/lib/appUrlUtil')
const {isPotentialPhishingUrl} = require('../../../../js/lib/urlutil')
+const {StyleSheet, css} = require('aphrodite/no-important')
+const globalStyles = require('../styles/global')
+
const searchIconSize = 16
class UrlBarIcon extends React.Component {
@@ -34,26 +37,6 @@ class UrlBarIcon extends React.Component {
this.onDragStart = this.onDragStart.bind(this)
}
- get iconCssClasses () {
- if (this.props.isPotentialPhishingUrl) {
- return ['fa-exclamation-triangle', 'insecure-color']
- } else if (this.isSearch) {
- return ['fa-search']
- } else if (this.props.isAboutPage && !this.props.titleMode) {
- return ['fa-list']
- } else if (this.props.isHTTPPage && !this.props.active) {
- if (this.props.isSecure === true) {
- return ['fa-lock']
- } else if (this.props.isSecure === false || this.props.isSecure === 2) {
- return ['fa-unlock', 'insecure-color']
- } else if (this.props.isSecure === 1) {
- return ['fa-unlock']
- }
- }
-
- return []
- }
-
/**
* search icon:
* - does not show when in title mode
@@ -62,29 +45,54 @@ class UrlBarIcon extends React.Component {
*/
get isSearch () {
const showSearch = this.props.isSearching && !this.props.titleMode
-
const defaultToSearch = (!this.props.isHTTPPage || this.props.active) &&
!this.props.titleMode &&
!this.props.isAboutPage
-
return showSearch || defaultToSearch
}
+ get isAboutPage () {
+ return isSourceAboutUrl(this.props.location) &&
+ this.props.location !== 'about:newtab'
+ }
+
+ get iconCssClasses () {
+ if (isPotentialPhishingUrl(this.props.location)) {
+ return [globalStyles.appIcons.exclamationTriangle, css(styles.urlbarIcon_large, styles.urlbarIcon_siteInsecureColor)]
+ } else if (this.isSearch) {
+ return [globalStyles.appIcons.search]
+ } else if (this.isAboutPage && !this.props.titleMode) {
+ return [globalStyles.appIcons.list]
+ } else if (this.props.isHTTPPage && !this.props.active) {
+ // NOTE: EV style not approved yet; see discussion at https://github.com/brave/browser-laptop/issues/791
+ if (this.props.isSecure === true) {
+ return [globalStyles.appIcons.lock, css(styles.urlbarIcon_large)]
+ } else if (this.props.isSecure === false || this.props.isSecure === 2) {
+ return [globalStyles.appIcons.unlock, css(styles.urlbarIcon_large, styles.urlbarIcon_siteInsecureColor, styles.urlbarIcon_insecure)]
+ } else if (this.props.isSecure === 1) {
+ return [globalStyles.appIcons.unlock, css(styles.urlbarIcon_large, styles.urlbarIcon_insecure)]
+ }
+ }
+ return []
+ }
+
get iconClasses () {
if (this.props.activateSearchEngine) {
- return cx({
- urlbarIcon: true
- })
+ return null
}
+ // Move fa-list (not fa-search) icon on about pages 1px down
+ // ref: urlbarIcon_relative
+ const relativeIcon = this.isAboutPage && !this.isSearch
+
const iconClasses = {
- urlbarIcon: true,
- fa: true
+ [css(styles.urlbarIcon, this.props.titleMode && styles.urlbarIcon_titleMode, this.isSearch && styles.urlbarIcon_isSearch, relativeIcon && styles.urlbarIcon_relative)]: true
}
this.iconCssClasses.forEach((iconClass) => {
iconClasses[iconClass] = true
})
+
return cx(iconClasses)
}
@@ -97,7 +105,8 @@ class UrlBarIcon extends React.Component {
backgroundImage: `url(${this.props.searchSelectImage})`,
backgroundSize: searchIconSize,
width: searchIconSize,
- height: searchIconSize
+ height: searchIconSize,
+ WebkitAppRegion: 'no-drag'
}
}
@@ -148,6 +157,7 @@ class UrlBarIcon extends React.Component {
render () {
// allow click and drag (unless tab is showing a message box)
const props = {}
+
if (!this.props.activeTabShowingMessageBox) {
props.draggable = true
props.onClick = this.onClick
@@ -155,11 +165,65 @@ class UrlBarIcon extends React.Component {
}
return
}
}
+const styles = StyleSheet.create({
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L893-L896
+ urlbarIcon: {
+ color: globalStyles.color.siteSecureColor,
+ fontSize: '12px',
+ backgroundRepeat: 'no-repeat',
+ backgroundPosition: 'center',
+
+ // Disable window dragging so that dragging the favicon is possible.
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L704-L707
+ WebkitAppRegion: 'no-drag'
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L801-L805
+ urlbarIcon_titleMode: {
+ display: 'inline-block',
+ opacity: 0.5,
+ minWidth: 0
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L809
+ // Unlock icon has this value if the title mode is enabled or not.
+ urlbarIcon_insecure: {
+ opacity: 1
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L900-L906
+ // about:newtab
+ urlbarIcon_isSearch: {
+
+ // 50% of #5a5a5a
+ color: 'rgba(90, 90, 90, .5)'
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L908-L913
+ urlbarIcon_large: {
+
+ // Refactor iconClasses to remove !important
+ fontSize: '16px !important'
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L897-L898
+ urlbarIcon_relative: {
+ position: 'relative',
+ bottom: '-1px'
+ },
+
+ // ref: https://github.com/brave/browser-laptop/blob/b161b37cf5e9f59be64855ebbc5d04816bfc537b/less/navigationBar.less#L915-L917
+ urlbarIcon_siteInsecureColor: {
+ color: globalStyles.color.siteInsecureColor
+ }
+})
+
module.exports = ReduxComponent.connect(UrlBarIcon)
diff --git a/app/renderer/components/navigation/windowCaptionButtons.js b/app/renderer/components/navigation/windowCaptionButtons.js
index 8ea4abbeffe..3f75112e042 100644
--- a/app/renderer/components/navigation/windowCaptionButtons.js
+++ b/app/renderer/components/navigation/windowCaptionButtons.js
@@ -50,7 +50,7 @@ class WindowCaptionButtons extends ImmutableComponent {
}
onDoubleClick (e) {
- if (!e.target.className.includes('navigatorWrapper')) {
+ if (!e.target.className.includes('navigationBarWrapper')) {
return
}
this.onMaximizeClick(e)
diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js
index 0ffa4b810fa..896000a0494 100644
--- a/app/renderer/components/styles/commonStyles.js
+++ b/app/renderer/components/styles/commonStyles.js
@@ -198,6 +198,41 @@ const styles = StyleSheet.create({
isCommonForm: {
fontSize: globalStyles.fontSize.flyoutDialog,
width: '100%'
+ },
+
+ // #9283
+ // Create 25x25 squares and place the buttons at the center of each container
+ // Used for bookmarkButtonContainer, PublisherToggle, noScriptInfo, and UrlBarIcon.
+ rectangleContainer: {
+ boxSizing: 'border-box',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: globalStyles.navigationBar.urlbarForm.height,
+ width: globalStyles.navigationBar.urlbarForm.height,
+ minHeight: globalStyles.navigationBar.urlbarForm.height,
+ minWidth: globalStyles.navigationBar.urlbarForm.height,
+ WebkitAppRegion: 'no-drag'
+ },
+
+ // Add border to the bookmark button and publisher button only
+ rectangleContainer_outsideOfurlbarForm: {
+ border: `1px solid ${globalStyles.color.urlBarOutline}`,
+ borderRadius: globalStyles.radius.borderRadiusURL
+ },
+
+ navbarButtonContainer: {
+ // Used for stopButton, reloadButton, and homeButton on navigationBar.js
+ // and backButton and forwardButton on navigator.js
+ display: 'inline-block',
+ borderRadius: globalStyles.radius.borderRadiusNavigationButton,
+ height: globalStyles.navigationBar.urlbarForm.height,
+ marginRight: globalStyles.navigationBar.navigationButtonContainer.marginRight,
+
+ ':hover': {
+ background: '#fff',
+ boxShadow: '0px 1px 5px 0px rgba(0, 0, 0, 0.15)'
+ }
}
})
diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js
index c2b3b241321..ef348b2d9ad 100644
--- a/app/renderer/components/styles/global.js
+++ b/app/renderer/components/styles/global.js
@@ -52,7 +52,8 @@ const globalStyles = {
chromeSecondary: '#d3d3d3',
chromeTertiary: '#c7c7c7',
chromeText: '#555555',
- navigationBarBackground: 'white',
+ navigationBarBackground: '#f7f7f7',
+ navigationBarBackgroundActive: '#fff',
chromeControlsBackground: '#bbb',
chromeControlsBackground2: 'white',
tabsToolbarBorderColor: '#bbb',
@@ -105,6 +106,7 @@ const globalStyles = {
notificationBottomBorderColor: '#ff5500',
almostInvisible: 'rgba(255,255,255,0.01)',
urlBarOutline: '#bbb',
+ focusUrlbarOutline: 'rgba(55, 169, 253, 0.4)',
alphaWhite: 'rgba(255,255,255,0.8)'
},
filter: {
@@ -113,6 +115,7 @@ const globalStyles = {
},
radius: {
borderRadius: '4px',
+ borderRadiusNavigationButton: '2px',
borderRadiusTabs: '4px',
borderRadiusURL: '4px',
borderRadiusUIbox: '8px',
@@ -122,7 +125,6 @@ const globalStyles = {
carotRadius: '8px'
},
spacing: {
- navigatorHeight: '48px',
defaultSpacing: '12px',
defaultFontSize: '13px',
contextMenuFontSize: '14px',
@@ -134,8 +136,6 @@ const globalStyles = {
switchNubTopMargin: '2px',
switchNubLeftMargin: '2px',
switchNubRightMargin: '2px',
- buttonHeight: '25px',
- buttonWidth: '25px',
navbarHeight: '36px',
downloadsBarHeight: '60px',
tabsToolbarHeight: '26px',
@@ -227,6 +227,7 @@ const globalStyles = {
flyoutDialog: '13px',
prefsPanelHeading: '23px'
},
+
appIcons: {
clipboard: 'fa fa-clipboard',
closeTab: 'fa fa-times-circle',
@@ -242,8 +243,14 @@ const globalStyles = {
moreInfo: 'fa fa-info-circle',
angleDoubleRight: 'fa fa-angle-double-right',
findPrev: 'fa fa-caret-up',
- findNext: 'fa fa-caret-down'
+ findNext: 'fa fa-caret-down',
+ exclamationTriangle: 'fa fa-exclamation-triangle',
+ search: 'fa fa-search',
+ list: 'fa fa-list',
+ lock: 'fa fa-lock',
+ unlock: 'fa fa-unlock'
},
+
animations: {
subtleShowUp: {
opacity: 0,
@@ -314,13 +321,27 @@ const globalStyles = {
background: '#ccc'
}
}
+ },
+
+ navigationBar: {
+
+ urlbarForm: {
+ height: '25px'
+ },
+
+ navigationButtonContainer: {
+ marginRight: '6px',
+
+ // cf: topLevelStartButtonContainer on navigator.js
+ // globalStyles.navigationBar.urlbarForm.height + 2px
+ width: 'calc(25px + 2px)'
+ }
}
}
globalStyles.color.chromeBorderColor = globalStyles.color.chromePrimary
globalStyles.color.chromeControlsWarningBackground = globalStyles.color.chromePrimary
globalStyles.color.audioColor = globalStyles.color.highlightBlue
-globalStyles.color.focusUrlbarOutline = globalStyles.color.highlightBlue
globalStyles.color.siteSecureColor = globalStyles.color.buttonColor
globalStyles.color.loadTimeColor = globalStyles.color.highlightBlue
globalStyles.color.activeTabDefaultColor = globalStyles.color.chromePrimary
diff --git a/less/button.less b/less/button.less
index 2a5c73dcde1..b0b07907e3a 100644
--- a/less/button.less
+++ b/less/button.less
@@ -17,12 +17,6 @@
white-space: nowrap;
}
-span.buttonSeparator {
- width: 1px;
- border-left: 1px solid #e2e2e2;
- margin: 4px 3px 4px 3px;
-}
-
.menuButton {
background-color: @buttonColor;
display: inline-block;
diff --git a/less/forms.less b/less/forms.less
index 90233334c4c..3067f017e0a 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -63,7 +63,7 @@ select {
text-overflow: ellipsis;
}
-#navigator {
+#navigationBar {
.urlBarSuggestions {
.flyoutDialog;
color: @chromeText;
diff --git a/less/navigationBar.less b/less/navigationBar.less
index 0f7078ad48e..6fb85dec939 100644
--- a/less/navigationBar.less
+++ b/less/navigationBar.less
@@ -16,14 +16,9 @@
// (macOS) We need to keep a padding left to avoid overlapping
// with the window buttons to close/maximize/minimize the window.
-.platform--darwin .navigatorWrapper .backforward {
- margin-left: @navbarLeftMarginDarwin;
+.platform--darwin .navigatorWrapper .topLevelStartButtons {
- &.fullscreen {
- margin-left: 0;
- }
-
- // Since we want to keep the navigator centered, we need to calculate the
+ // Since we want to keep the navigationBar centered, we need to calculate the
// difference between the width of the left box and the width of the right box.
@centerOffset: @navbarLeftMarginDarwin + 2 * (@navbarButtonWidth + @navbarButtonSpacing) // width area on the left
- (@navbarBraveButtonWidth + 2 * @navbarButtonSpacing);
@@ -36,23 +31,6 @@
box-sizing: border-box;
}
- .backforward {
- padding-left: 5px;
- }
-
- #navigator {
- .urlbarForm {
- input {
- font-weight: 500;
- line-height: 1.4;
- margin: 0; // #5624
- top: 0; // #5624
- }
- }
- }
-
- #urlInput { width: 100%; }
-
// changes to ensure window can be as small as 480px wide
// and still be useable and have the caption buttons intact
@media (max-width: @breakpointExtensionButtonPadding) {
@@ -357,7 +335,7 @@
}
// Styles had to be reworked to properly position the new caption buttons for Windows
-.navbarCaptionButtonContainer {
+.navigator {
display: flex;
//border-bottom: 1px solid #bbb;
@@ -365,15 +343,6 @@
-webkit-app-region: drag;
}
}
-.navbarMenubarFlexContainer {
- display: flex;
- flex: 1;
- flex-direction: column;
- box-sizing: border-box;
- position: relative;
- overflow: visible;
- white-space: nowrap;
-}
// Window Caption Buttons (for use w/ slim titlebar)
.windowCaptionButtons {
@@ -443,51 +412,26 @@
}
// Here I grouped the rules to keep the layout of the top bar consistent.
-// The tricky part is to keep the title in `#navigator` centered when the
+// The tricky part is to keep the title in `#navigationBar` centered when the
// box on its left has different size than the one on the right.
// This is achieved by the local variable `@centerOffset`.
.navigatorWrapper {
- // Since we want to keep the navigator centered, we need to calculate the
+ // Since we want to keep the navigationBar centered, we need to calculate the
// difference between the width of the left box and the width of the right box.
@centerOffset: 2 * (@navbarButtonWidth + @navbarButtonSpacing) // width area on the left
- (@navbarBraveButtonWidth + 2 * @navbarButtonSpacing);
@rightMargin: @navbarLeftMarginDarwin / 2;
- display: flex;
-
- // Buttons on the left
- .backforward {
- display: flex;
-
- .backButton,
- .forwardButton {
- width: 100%;
- height: 100%;
- margin: 0;
- }
-
- .backButton {
- background: url('../img/toolbar/back_btn.svg') center no-repeat;
- background-size: 14px 14px;
- }
-
- .forwardButton {
- background: url('../img/toolbar/forward_btn.svg') center no-repeat;
- background-size: 14px 14px;
- }
- }
-
// Navigation bar at the center
- #navigator {
- display: flex;
- flex-grow: 1;
- min-width: 0%; // allow the navigator to shrink
- max-width: 900px;
- margin-right: @rightMargin;
-
+ #navigationBar {
&.titleMode {
padding-right: @centerOffset;
+
+ @media (max-width: @breakpointNarrowViewport) {
+ transition: padding @transitionDuration ease-in-out;
+ padding-right: 0;
+ }
}
@media (max-width: @breakpointNarrowViewport) {
@@ -497,40 +441,10 @@
@media (max-width: @breakpointNarrowViewport) {
width: 100%;
}
-
- &.titleMode {
- @media (max-width: @breakpointNarrowViewport) {
- transition: padding @transitionDuration ease-in-out;
- padding-right: 0;
- }
- }
}
// Buttons on the right
.topLevelEndButtons {
- display: flex;
- flex-direction: row;
- margin-left: 3px;
- position: relative;
-
- .braveMenu {
- width: @navbarBraveButtonWidth;
- margin-right: @navbarButtonSpacing;
- -webkit-app-region: no-drag;
- user-select: none;
-
- &.braveShieldsDown {
- -webkit-filter: grayscale(100%);
- }
-
- &.braveShieldsDisabled {
- -webkit-filter: grayscale(100%);
- opacity: 0.4;
- }
- &.leftOfCaptionButton {
- margin-right: 3px;
- }
- }
@media (max-width: @breakpointWideViewport) {
.extraDragArea {
@@ -542,383 +456,27 @@
}
}
-.navigationButton {
- background-color: @buttonColor;
- display: inline-block;
- width: 100%;
- height: 100%;
- margin: 0 7px 0 0;
-}
-
-.navigationButtonContainer {
- border-radius: @borderRadius;
- height: 24px;
- width: 26px;
- margin-left: -3px;
- margin-right: 6px;
-
- &.nav {
- margin-left: 4px;
- margin-right: 1px;
- width: 34px;
- }
-
- &:last-child {
- margin-right: 8px;
- }
-
- &:not(.disabled):hover {
- background: white;
- box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.15);
- }
-}
-
-#navigator {
- .stopButton,
- .reloadButton,
- .homeButton {
- margin: 0;
- padding: 0;
- width: 100%;
- height: 100%;
- }
-
- .stopButton {
- background: url('../img/toolbar/stoploading_btn.svg') center no-repeat;
- background-size: 11px 11px;
- }
-
- .reloadButton {
- background: url('../img/toolbar/reload_btn.svg') center no-repeat;
- background-size: 13px 13px;
- }
-
- .homeButton {
- background: url('../img/toolbar/home_btn.svg') center no-repeat;
- background-size: 16px 16px;
- }
-}
-
-.navigatorWrapper {
- justify-content: space-between;
- align-items: center;
- margin-top: @navbarMenubarMargin;
- box-sizing: border-box;
-
- /**
- * Left buttons
- */
- .backforward {
- display: flex;
- z-index: @zindexNavigationBar;
- transition: margin @transitionDuration ease-in-out;
-
- button {
- user-select: none;
- color: @buttonColor;
- cursor: default;
- border-radius: 4px;
- font-weight: 300;
- opacity: 0.2;
-
- &:not([disabled]) {
- opacity: 0.85;
- -webkit-app-region: no-drag;
- }
- }
- }
-}
-
-@urlbarFormHeight: 25px;
-
.urlbarForm {
- position: relative; // PR #6485
- width: 0; // Fixes #4298
- align-items: center;
- justify-content: center;
- height: @urlbarFormHeight;
- padding: 0 10px 0 3px;
- display: flex;
- flex-grow: 1;
- min-width: 0%; // allow the navigator to shrink
-
*:not(legend) {
z-index: @zindexUrlbarNotLegend;
}
- legend:before {
- content: ' ';
- position: absolute;
- border-radius: 0 4px 4px 0;
- color: #333;
- box-shadow: inset 0 0 0 1px @urlBarOutline, inset 0 0 0 3px @focusUrlbarOutline;
- outline: none;
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- z-index: @zindexNavigationBar;
- display: none;
- }
-
- input:focus + legend:before {
- display: block;
- }
-
- #navigator:not(.titleMode) & {
- border-radius: @borderRadiusURL;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- box-shadow: inset 0 0 0 1px rgba(187, 187, 187, 1.0);
- color: @chromeText;
-
- // #4922
- // TODO: replace this value with a CSS variable to add a dark UI.
- background: #fff;
- }
-
@media (max-width: @breakpointNarrowViewport) {
max-width: 80%;
}
}
-#navigator {
- font-size: 20px;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- padding: 0;
- position: relative;
- user-select: none;
- z-index: @zindexNavigationBar;
+#navigationBar {
// #6253 #6680
> * {
-webkit-app-region: no-drag;
}
- form {
- -webkit-app-region: drag;
- // Disable window dragging so that selecting text and dragging the favicon is possible.
- input, .urlbarIcon {
- -webkit-app-region: no-drag;
- }
- }
-
- .endButtons {
- display: flex;
- }
-
&:not(.titleMode) {
> * {
animation: fadeIn .6s;
z-index: @zindexNavigationBarElements;
}
-
- .urlbarForm {
- &.noBorderRadius {
- border-radius: 0;
-
- legend:before {
- border-radius: 0;
- }
- }
- }
-
- // Create 25x25 squares and place the buttons at the center of each container
- .bookmarkButtonContainer,
- .addPublisherButtonContainer {
- border: 1px solid @urlBarOutline;
- border-radius: @borderRadiusURL;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- height: @urlbarFormHeight;
- width: @urlbarFormHeight;
- min-height: @urlbarFormHeight;
- min-width: @urlbarFormHeight;
- -webkit-app-region: no-drag;
- }
-
- .bookmarkButtonContainer {
- border-right: none;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-
- .bookmarkButton {
- background: url('../img/toolbar/bookmark_btn.svg') center no-repeat;
- -webkit-mask-repeat: no-repeat;
- background-size: 14px 14px;
- margin: 0;
- height: 0;
- width: @urlbarFormHeight; // #6704
- height: @urlbarFormHeight; // #6704
-
- &.removeBookmarkButton {
- background: url('../img/toolbar/bookmark_marked.svg') center no-repeat;
- background-size: 14px 14px;
- }
- }
- }
- }
-
- &.titleMode {
- &:extend(#navigator:not(.titleMode).urlbarForm);
- animation: fadeIn 1.2s;
- background: none;
- // border-radius: @borderRadiusURL;
- // box-shadow: inset 0 0 0 1px rgba(187, 187, 187, 1.0);
-
- .urlbarForm {
- background: none;
- }
-
- input {
- display: none;
- }
- #titleBar {
- display: inline-block;
- color: @chromeText;
- font-size: 13px;
- max-width: 100%;
- overflow-x: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-left: 2px;
-
- strong {
- font-weight: 600;
- }
- }
-
- .endButtons {
- display: none;
- }
-
- .urlbarIcon {
- display: inline-block;
- opacity: 0.5;
- position: relative;
- left: 2px;
- min-width: 0;
-
- &.insecure-color {
- color: @siteInsecureColor;
- opacity: 1.0;
- }
- }
-
- .bookmarkButton {
- &:not(.removeBookmarkButton) {
- display: none;
- }
- }
- }
-
- #titleBar {
- display: none;
- text-overflow: ellipsis;
- }
-
- .urlbarForm {
- .loadTime {
- color: @loadTimeColor;
- font-size: 12px;
- text-align: right;
- cursor: default;
-
- &.onFocus {
- display: none;
- }
- }
-
- /* Disable selection of button text */
- > span {
- user-select: none;
- }
-
- input {
- border: none;
- box-sizing: border-box;
- color: #333;
- letter-spacing: -0.125px;
- cursor: text;
- flex-grow: 1;
- font-size: 13.5px;
- font-weight: normal;
- outline: none;
- text-overflow: ellipsis;
- min-width: 0%; // allow the navigator to shrink
-
- // #4922: make the whole .urlbarForm clickable
- height: @urlbarFormHeight;
- background: transparent;
-
- &.private {
- background: @privateTabBackground;
- color: @chromeText;
- }
-
- &:focus {
- margin-right: 3px;
- }
- }
-
- // Create 25x25 square and place .urlbarIcon at the center of it
- .urlbarIconContainer {
- display: flex;
- align-items: center;
- justify-content: center;
- height: @urlbarFormHeight;
- width: @urlbarFormHeight;
- min-height: @urlbarFormHeight;
- min-width: @urlbarFormHeight;
-
- .urlbarIcon {
- color: @siteSecureColor;
- font-size: 12px;
- background-repeat: no-repeat;
- background-position: center;
- position: relative;
- bottom: -1px;
-
- // about:newtab
- &.fa-search {
- position: relative;
- bottom: 0;
- // 50% of #5a5a5a
- color: rgba(90, 90, 90, 0.5);
- }
-
- &.fa-lock,
- &.fa-unlock,
- &.fa-exclamation-triangle {
- font-size: 16px;
- bottom: 0;
- }
-
- &.insecure-color {
- color: @siteInsecureColor;
- }
-
- &.extendedValidation {
- color: @siteEVColor;
- }
- }
- }
- }
-}
-
-.topLevelEndButtons .braveMenu {
- background-image: -webkit-image-set(url(../app/extensions/brave/img/braveBtn.png) 1x,
- url(../app/extensions/brave/img/braveBtn2x.png) 2x,
- url(../app/extensions/brave/img/braveBtn3x.png) 3x);
- background-repeat: no-repeat;
- height: 24px;
-
- &:hover {
- background-image: -webkit-image-set(url(../app/extensions/brave/img/braveBtn_hover.png) 1x,
- url(../app/extensions/brave/img/braveBtn2x_hover.png) 2x,
- url(../app/extensions/brave/img/braveBtn3x_hover.png) 3x);
}
}
diff --git a/less/variables.less b/less/variables.less
index 92b32854536..213c7f1bcda 100644
--- a/less/variables.less
+++ b/less/variables.less
@@ -8,7 +8,6 @@
@highlightBlue: #37A9FD;
@borderRadius: 2px;
@borderRadiusTabs: 0;
-@borderRadiusURL: 4px;
@borderRadiusUIbox: 8px;
@borderRadiusModal: 8px;
@bigBorderRadius: 14px;
@@ -25,6 +24,7 @@
@tabsBackground: #ddd;
@tabsBackgroundInactive: #ddd;
@tabsToolbarBorderColor: #bbb;
+@navigationBarBackground: @chromeSecondary;
@chromeBorderColor: @chromePrimary;
@chromeControlsBackground: #bbb;
@chromeControlsWarningBackground: @chromePrimary;
@@ -35,18 +35,13 @@
@menuSelectionColor: #2F7AFB;
@errorTextColor: #999;
-@navigatorHeight: 48px;
@defaultSpacing: 12px;
@progressBarColor: #3498DB;
@defaultFontSize: 13px;
@contextMenuFontSize: 14px;
@settingItemSubtextFontSize: 0.95rem;
@audioColor: @highlightBlue;
-@focusUrlbarOutline: rgba(55, 169, 253, 0.4);
-@siteSecureColor: @buttonColor;
@siteInsecureColor: #C63626;
-@siteEVColor: green;
-@loadTimeColor: @highlightBlue;
@activeTabDefaultColor: @chromePrimary;
@buttonColor: #5a5a5a;
@braveOrange: rgb(255, 85, 0);
diff --git a/test/bravery-components/braveryPanelTest.js b/test/bravery-components/braveryPanelTest.js
index 1c0ad6d93e1..1206d9607dc 100644
--- a/test/bravery-components/braveryPanelTest.js
+++ b/test/bravery-components/braveryPanelTest.js
@@ -56,7 +56,7 @@ describe('Bravery Panel', function () {
.tabByIndex(0)
.loadUrl(url)
.windowByUrl(Brave.browserWindowUrl)
- .waitForTextValue('[data-test-id="lionBadge"]', '2')
+ .waitForTextValue('[data-test-id="counterBraveMenu"]', '2')
})
})
describe('Tracking Protection stats', function () {
diff --git a/test/lib/selectors.js b/test/lib/selectors.js
index 0b429493afa..7f798c945fd 100644
--- a/test/lib/selectors.js
+++ b/test/lib/selectors.js
@@ -2,25 +2,25 @@ module.exports = {
minimizeButton: '.min-btn',
maximizeButton: '.max-btn',
closeButton: '.close-btn',
- urlInput: '#urlInput',
+ urlInput: '[data-test-id="urlInput"]',
activeWebview: '.frameWrapper.isActive webview',
activeTab: '[data-test-active-tab]',
activeTabTitle: '[data-test-active-tab] [data-test-id="tabTitle"]',
activeTabFavicon: '[data-test-active-tab] [data-test-favicon]',
pinnedTabsTabs: '.pinnedTabs [data-test-id="tab"]',
tabsTabs: '.tabs [data-test-id="tab"]',
- navigator: '#navigator',
- navigatorLoadTime: '#navigator .loadTime',
+ navigator: '[data-test-id="navigationBar"]',
+ navigatorLoadTime: '[data-test-id="loadTime"]',
newFrameButton: '.tabs .newFrameButton',
tabPage: '.tabPage',
tabPage1: '[data-tab-page="0"]',
tabPage2: '[data-tab-page="1"]',
closeTab: '[data-test-id="closeTabIcon"]',
- urlbarIcon: '[data-test-id="urlBarIcon"]',
+ urlbarIcon: '[data-test-id="urlbarIcon"]',
urlBarSuggestions: '.urlBarSuggestions',
titleBar: '#titleBar',
- navigatorBookmarked: '#navigator .removeBookmarkButton',
- navigatorNotBookmarked: '#navigator .bookmarkButton',
+ navigatorBookmarked: '[data-test-id="bookmarked"]',
+ navigatorNotBookmarked: '[data-test-id="notBookmarked"]',
bookmarksToolbar: '[data-test-id="bookmarksToolbar"]',
bookmarkNameInput: '[data-test-id="bookmarkNameInput"]',
bookmarkLocationInput: '[data-test-id="bookmarkLocationInput"]',
@@ -35,8 +35,8 @@ module.exports = {
findBarNextButton: '[data-test-id="findBarNextButton"]',
findBarPrevButton: '[data-test-id="findBarPrevButton"]',
findBarClearButton: '.findClear',
- braveMenu: '.braveMenu:not(.braveShieldsDisabled)',
- braveMenuDisabled: '.braveMenu.braveShieldsDisabled',
+ braveMenu: '[data-test-id="braveMenu"]',
+ braveMenuDisabled: '[data-test-id="braveMenuDisabled"]',
// braveryPanelTest.js
braveryPanel: '[data-test-id="braveryPanel"]',
@@ -62,9 +62,9 @@ module.exports = {
noScriptAllowTempButton: '[data-l10n-id="allowScriptsTemp"]',
noScriptAllowOnceButton: '[data-l10n-id="allowScriptsOnce"]',
noScriptAllowButton: '[data-l10n-id="allowScripts"]',
- backButton: '.backforward .backButton',
- forwardButton: '.backforward .forwardButton',
- reloadButton: '.reloadButton',
+ backButton: '.topLevelStartButtons .backButton',
+ forwardButton: '.topLevelStartButtons .forwardButton',
+ reloadButton: '[data-test-id="reloadButton"]',
homeButton: '[data-test-id="homeButton"]',
clearBrowsingDataButton: '[data-test-id="clearBrowsingDataButton"]',
clearBrowsingDataPanel: '[data-test-id="clearBrowsingDataPanel"]',
diff --git a/test/unit/app/renderer/components/navigation/navigatorTest.js b/test/unit/app/renderer/components/navigation/navigatorTest.js
index 93b8c9cf6ad..063dd2f36f9 100644
--- a/test/unit/app/renderer/components/navigation/navigatorTest.js
+++ b/test/unit/app/renderer/components/navigation/navigatorTest.js
@@ -175,13 +175,13 @@ describe('Navigator component unit tests', function () {
it('counter is shown by default', function () {
const wrapper = mount(
)
- assert.equal(wrapper.find('[data-test-id="lionBadge"]').length, 1)
+ assert.equal(wrapper.find('[data-test-id="counterBraveMenu"]').length, 1)
})
it('counter is not shown when disabled via settings', function () {
settingDefaultValue = false
const wrapper = mount(
)
- assert.equal(wrapper.find('[data-test-id="lionBadge"]').length, 0)
+ assert.equal(wrapper.find('[data-test-id="counterBraveMenu"]').length, 0)
})
})
})