This repository was archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 971
Private tab/Session tab icon needs right padding before text #6031
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
const globalStyles = { | ||
breakpoint: { | ||
breakpointWideViewport: '1000px', | ||
breakpointNarrowViewport: '600px', | ||
breakpointExtensionButtonPadding: '720px', | ||
breakpointSmallWin32: '650px', | ||
breakpointTinyWin32: '500px' | ||
}, | ||
color: { | ||
linkColor: '#0099CC', | ||
highlightBlue: '#37A9FD', | ||
privateTabBackground: '#392e54', | ||
bitcoinOrange: '#f7931a', | ||
chromePrimary: '#F3F3F3', | ||
chromeSecondary: '#d3d3d3', | ||
chromeTertiary: '#c7c7c7', | ||
chromeText: '#555555', | ||
tabsBackground: '#dddddd', | ||
navigationBarBackground: 'white', | ||
chromeControlsBackground: '#bbb', | ||
chromeControlsBackground2: 'white', | ||
toolbarBackground: '#eee', | ||
toolbarBorderColor: '#ccc', | ||
menuSelectionColor: '#2F7AFB', | ||
errorTextColor: '#999', | ||
progressBarColor: '#3498DB', | ||
siteInsecureColor: '#C63626', | ||
siteEVColor: 'green', | ||
buttonColor: '#5a5a5a', | ||
braveOrange: 'rgb(255, 80, 0)', | ||
braveLightOrange: '#FF7A1D', | ||
braveMediumOrange: 'rgb(232, 72, 0)', | ||
braveDarkOrange: '#D44600', | ||
switchBG_off: '#d3d3d3', | ||
switchBG_off_lrg: '#adadad', | ||
switchBG_dis: '#e8e8e8', | ||
switchNubColor: 'white', | ||
findbarBackground: '#F7F7F7', | ||
veryLightGray: 'rgb(250, 250, 250)', | ||
lightGray: 'rgb(236, 236, 236)', | ||
gray: 'rgb(153, 153, 153)', | ||
mediumGray: 'rgb(101, 101, 101)', | ||
darkGray: 'rgb(68, 68, 68)', | ||
white25: 'rgba(255, 255, 255, 0.25)', | ||
white50: 'rgba(255, 255, 255, 0.5)', | ||
gray25: 'rgba(116, 116, 130, 0.25)', | ||
gray50: 'rgba(116, 116, 130, 0.5)', | ||
black10: 'rgba(0, 0, 0, 0.1)', | ||
black25: 'rgba(0, 0, 0, 0.25)', | ||
black50: 'rgba(0, 0, 0, 0.5)', | ||
black75: 'rgba(0, 0, 0, 0.75)', | ||
statsYellow: '#ffc000', | ||
statsOrange: '#f39030', | ||
statsRed: '#fe521d', | ||
statsBlue: '#0796fa', | ||
statsLightGray: '#999999', | ||
defaultIconBackground: '#F7F7F7' | ||
}, | ||
radius: { | ||
borderRadius: '4px', | ||
borderRadiusTabs: '4px', | ||
borderRadiusURL: '4px', | ||
borderRadiusUIbox: '8px', | ||
bigBorderRadius: '14px', | ||
switchRadius: '10px', | ||
carotRadius: '8px' | ||
}, | ||
spacing: { | ||
navigatorHeight: '48px', | ||
defaultSpacing: '12px', | ||
defaultFontSize: '13px', | ||
contextMenuFontSize: '14px', | ||
dragSpacing: '50px', | ||
switchHeight: '16px', | ||
switchWidth: '45px', | ||
switchNubDiameter: '12px', | ||
switchNubTopMargin: '2px', | ||
switchNubLeftMargin: '2px', | ||
switchNubRightMargin: '2px', | ||
navbarHeight: '36px', | ||
downloadsBarHeight: '50px', | ||
tabsToolbarHeight: '28px', | ||
tabPagesHeight: '9px', | ||
bookmarksToolbarHeight: '24px', | ||
bookmarksToolbarWithFaviconsHeight: '28px', | ||
bookmarksFileIconSize: '13px', | ||
bookmarksFolderIconSize: '15px', | ||
navbarButtonSpacing: '4px', | ||
navbarButtonWidth: '20px', | ||
navbarBraveButtonWidth: '23px', | ||
navbarBraveButtonMarginLeft: '80px', | ||
navbarLeftMarginDarwin: '76px', | ||
sideBarWidth: '190px', | ||
aboutPageSectionPadding: '24px' | ||
}, | ||
shadow: { | ||
switchShadow: 'inset 0 1px 4px rgba(0, 0, 0, 0.35)', | ||
switchNubShadow: '1px 1px 5px -2px black', | ||
buttonShadow: '0px 1px 5px -1px rgba(0, 0, 0, 1.0)', | ||
dialogShadow: '0px 8px 22px 0px rgba(0, 0, 0, .5)', | ||
softBoxShadow: '0 4px 8px lightGray', | ||
lightBoxShadow: '0 2px 2px lightGray', | ||
insetShadow: 'inset -5px 0 15px black25', | ||
orangeButtonShadow: '0 2px 0 braveDarkOrange' | ||
}, | ||
transition: { | ||
transitionDuration: '100ms', | ||
transition: 'all 600ms linear', | ||
transitionFast: 'all 100ms linear', | ||
transitionSlow: 'all 1s linear', | ||
transitionEase: 'all 600ms ease', | ||
transitionFastEase: 'all 100ms ease', | ||
transitionSlowEase: 'all 1s ease', | ||
switchBGTransition: 'background-color 100ms', | ||
switchNubTransition: 'right 100ms' | ||
}, | ||
zindex: { | ||
zindexWindowNotActive: '900', | ||
zindexWindow: '1000', | ||
zindexWindowIsPreview: '1100', | ||
zindexDownloadsBar: '1000', | ||
zindexTabs: '1000', | ||
zindexTabsThumbnail: '1100', | ||
zindexTabsDragIndicator: '1100', | ||
zindexNavigationBar: '2000', | ||
zindexUrlbarNotLegend: '2100', | ||
zindexPopUp: '3000', | ||
zindexContextMenu: '3000', | ||
zindexDialogs: '3000', | ||
zindexPopupWindow: '3000', | ||
zindexForms: '3000', | ||
zindexSuggestionText: '3100', | ||
zindexWindowFullScreen: '4000', | ||
zindexWindowFullScreenBanner: '4100' | ||
} | ||
} | ||
|
||
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 | ||
globalStyles.color.switchBG_on = globalStyles.color.braveOrange | ||
globalStyles.color.statsGray = globalStyles.color.chromeText | ||
|
||
module.exports = globalStyles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const React = require('react') | ||
const ImmutableComponent = require('../../../js/components/immutableComponent') | ||
const {StyleSheet, css} = require('aphrodite') | ||
const globalStyles = require('./styles/global') | ||
|
||
class TabIcon extends ImmutableComponent { | ||
render () { | ||
const className = css( | ||
styles.icon, | ||
this.props.withBlueIcon && styles.blueIcon | ||
) | ||
return <div className={className}> | ||
<span className={this.props.styles} /> | ||
</div> | ||
} | ||
} | ||
|
||
class AudioTabIcon extends ImmutableComponent { | ||
render () { | ||
return <TabIcon withBlueIcon {...this.props} /> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
'icon': { | ||
backgroundPosition: 'center', | ||
backgroundRepeat: 'no-repeat', | ||
display: 'inline-block', | ||
fontSize: '14px', | ||
margin: 'auto 7px auto 7px', | ||
position: 'relative', | ||
verticalAlign: 'middle', | ||
textAlign: 'center' | ||
}, | ||
'blueIcon': { | ||
color: globalStyles.color.highlightBlue | ||
} | ||
}) | ||
|
||
module.exports = { | ||
TabIcon, | ||
AudioTabIcon | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ const dnd = require('../dnd') | |
const windowStore = require('../stores/windowStore') | ||
const ipc = global.require('electron').ipcRenderer | ||
|
||
const {TabIcon, AudioTabIcon} = require('../../app/renderer/components/tabIcon') | ||
|
||
class Tab extends ImmutableComponent { | ||
constructor () { | ||
super() | ||
|
@@ -172,15 +174,15 @@ class Tab extends ImmutableComponent { | |
} | ||
|
||
let playIcon = null | ||
let iconClass = null | ||
|
||
if (this.props.tab.get('audioPlaybackActive') || this.props.tab.get('audioMuted')) { | ||
playIcon = <span className={cx({ | ||
audioPlaybackActive: true, | ||
fa: true, | ||
'fa-volume-up': this.props.tab.get('audioPlaybackActive') && | ||
!this.props.tab.get('audioMuted'), | ||
'fa-volume-off': this.props.tab.get('audioPlaybackActive') && | ||
this.props.tab.get('audioMuted') | ||
})} | ||
if (this.props.tab.get('audioPlaybackActive') && !this.props.tab.get('audioMuted')) { | ||
iconClass = 'fa fa-volume-up' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These class names (along with the other FontAwesome class names) might be a natural fit into the global styles? For example: const globalStyles = {
//..
classAudioPlayingIcon: 'fa fa-volume-up',
classAudioMutedIcon: 'fa fa-volume-off',
//...
} |
||
} else if (this.props.tab.get('audioPlaybackActive') && this.props.tab.get('audioMuted')) { | ||
iconClass = 'fa fa-volume-off' | ||
} | ||
playIcon = <AudioTabIcon styles={iconClass} | ||
onClick={this.onMuteFrame.bind(this, !this.props.tab.get('audioMuted'))} /> | ||
} | ||
|
||
|
@@ -215,14 +217,14 @@ class Tab extends ImmutableComponent { | |
style={activeTabStyle}> | ||
{ | ||
this.props.tab.get('isPrivate') | ||
? <div className='privateIcon fa fa-eye' /> | ||
? <TabIcon styles='fa fa-eye' /> | ||
: null | ||
} | ||
{ | ||
this.props.tab.get('partitionNumber') | ||
? <div data-l10n-args={JSON.stringify({partitionNumber: this.props.tab.get('partitionNumber')})} | ||
data-l10n-id='sessionInfoTab' | ||
className='privateIcon fa fa-user' /> | ||
? <TabIcon l10nArgs={JSON.stringify({partitionNumber: this.props.tab.get('partitionNumber')})} | ||
l10nId='sessionInfoTab' | ||
styles='fa fa-user' /> | ||
: null | ||
} | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move the new tabIcon component to the new location (
app/renderer/components
), you may consider moving this too 😄 If moved, you'll have to update the paths for the requires here and then also anywhere that includes this (ex: tabs, pinnedtabs)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's all good with you, I might try moving tab.js later. I tried moving it now but it has a lot of deps to move around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good! 😄