-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Hide title bar on mac, and change style with theme. Fixes Issue #1055 #1972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0ddafe0
Made top bar draggable, and change based on the theme. Issue #1055
9613d0e
made it so windows works with the new menu bar
StormBurpee 16157f1
Made changes according to review
StormBurpee f3fe397
made all changes according to review
StormBurpee 03a1283
removed the windows test for mac
StormBurpee 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 hidden or 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 |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| .escButton | ||
| height 50px | ||
| height 40px | ||
| position absolute | ||
| background-color transparent | ||
| color $ui-inactive-text-color | ||
| border none | ||
| top 1px | ||
| top -1px | ||
| right 10px | ||
| text-align center | ||
| width top-bar--height | ||
| height top-bar-height | ||
|
|
||
| .esc-mark | ||
| font-size 28px | ||
| font-size 24px | ||
| margin-top -5px | ||
| margin-bottom -7px | ||
| margin-bottom -7px |
This file contains hidden or 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
This file contains hidden or 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,78 @@ | ||
| import PropTypes from 'prop-types' | ||
| import React from 'react' | ||
| import CSSModules from 'browser/lib/CSSModules' | ||
| import styles from './ApplicationMenuDropdown.styl' | ||
| import _ from 'lodash' | ||
| import i18n from 'browser/lib/i18n' | ||
|
|
||
| class ApplicationMenuDropdown extends React.Component { | ||
| constructor (props) { | ||
| super(props) | ||
|
|
||
| this.state = { | ||
| isActive: false, | ||
| menu: props.menu.items, | ||
| open: props.open | ||
| } | ||
|
|
||
| console.log(this.state.menu, 'submenu') | ||
|
Contributor
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. Why console? |
||
| } | ||
|
|
||
| componentWillReceiveProps (nextProps) { | ||
| this.setState({ | ||
| menu: nextProps.menu.items, | ||
| open: nextProps.open | ||
| }) | ||
| } | ||
|
|
||
| handleMouseDown (e) { | ||
| this.setState({ | ||
| isActive: true | ||
| }) | ||
| } | ||
|
|
||
| handleMouseUp (e) { | ||
| this.setState({ | ||
| isActive: false | ||
| }) | ||
| } | ||
|
|
||
| handleMouseLeave (e) { | ||
| this.setState({ | ||
| isActive: false | ||
| }) | ||
| } | ||
|
|
||
| clickMenu (key) { | ||
| this.state.menu[key].click() | ||
| } | ||
|
|
||
| render () { | ||
| const { className } = this.props | ||
|
|
||
| return ( | ||
| <div className='ApplicationMenuDropdown' | ||
| styleName={this.state.open === true ? 'root' : 'root-hidden'}> | ||
|
Contributor
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. please write like below: render () {
const { className, open, menu } = this.props
const menuItems = menu.items
return (
~~~~~~~
styleName={open ? 'root' : 'root-hidden'}
~~~~~~~
onClick={() => menuItems[key].click()}>
~~~~~~~
)
} |
||
| <ul | ||
| styleName='dropdown-items'> | ||
| {Object.keys(this.state.menu).map(key => | ||
| <li | ||
| key={key} | ||
| styleName='submenu-item' | ||
| onClick={() => this.state.menu[key].click()}> | ||
| {this.state.menu[key].label} | ||
| </li> | ||
| )} | ||
| </ul> | ||
| </div> | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| ApplicationMenuDropdown.propTypes = { | ||
| isActive: PropTypes.bool, | ||
| onClick: PropTypes.func, | ||
| className: PropTypes.string | ||
| } | ||
|
|
||
| export default CSSModules(ApplicationMenuDropdown, styles) | ||
This file contains hidden or 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,44 @@ | ||
| .root | ||
| background-color $ui-backgroundColor | ||
| z-index 99 | ||
| border-radius 5px | ||
| position absolute | ||
| min-width 50px | ||
| min-height 20px | ||
| border 1px solid $ui-borderColor | ||
| box-shadow 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) | ||
|
|
||
| .root-hidden | ||
| display none | ||
| height 0px | ||
| z-index 0 | ||
|
|
||
| .dropdown-items | ||
| li | ||
| transition 0.2s background ease-in-out | ||
| cursor pointer | ||
| padding 0px 20px | ||
| li:hover | ||
| background rgba(0,0,0,0.12) | ||
|
|
||
| body[data-theme="white"] | ||
| .root | ||
| background-color $ui-backgroundColor | ||
|
|
||
| body[data-theme="dark"] | ||
| .root | ||
| background-color $ui-dark-backgroundColor | ||
| border-color $ui-dark-borderColor | ||
| color $ui-dark-text-color | ||
|
|
||
| body[data-theme="solarized-dark"] | ||
| .root | ||
| background-color $ui-solarized-dark-backgroundColor | ||
| border-color $ui-solarized-dark-borderColor | ||
| color $ui-solarized-dark-text-color | ||
|
|
||
| body[data-theme="monokai"] | ||
| .root | ||
| background-color $ui-monokai-backgroundColor | ||
| border-color $ui-monokai-borderColor | ||
| color $ui-monokai-text-color |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
I want you to don't use
statein this case.please use
props.