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

Commit

Permalink
Merge pull request #12676 from brave/fix/issue-11728
Browse files Browse the repository at this point in the history
Restore disabled dragging and context menu for Bookmarks Bar on Windows
  • Loading branch information
petemill committed Jan 18, 2018
1 parent 6041001 commit 54f89bc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/renderer/components/bookmarks/bookmarksToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ class BookmarksToolbar extends React.Component {
// used in renderer
props.showOnlyFavicon = bookmarkUtil.showOnlyFavicon()
props.showFavicon = bookmarkUtil.showFavicon()
props.shouldAllowWindowDrag = windowState.shouldAllowWindowDrag(state, currentWindow, activeFrame, isFocused(state)) &&
!isWindows
props.shouldAllowWindowDrag = !isWindows && windowState.shouldAllowWindowDrag(state, currentWindow, activeFrame, isFocused(state))
props.visibleBookmarks = bookmarkToolbarState.getToolbar(state, currentWindowId)
props.hiddenBookmarks = bookmarkToolbarState.getOther(state, currentWindowId)

Expand All @@ -200,7 +199,8 @@ class BookmarksToolbar extends React.Component {
showFavicon: this.props.showFavicon,
showOnlyFavicon: this.props.showOnlyFavicon,
[css(styles.bookmarksToolbar)]: true,
[css(this.props.shouldAllowWindowDrag && styles.bookmarksToolbar__allowDragging)]: true,
[css(this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_allowDragging)]: true,
[css(!this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_disallowDragging)]: true,
[css(styles.bookmarksToolbar__showOnlyFavicon)]: true
})}
data-test-id='bookmarksToolbar'
Expand Down Expand Up @@ -239,9 +239,13 @@ const styles = StyleSheet.create({
padding: `0 ${globalStyles.spacing.bookmarksToolbarPadding}`,
margin: `${globalStyles.spacing.navbarMenubarMargin} 0`
},
bookmarksToolbar__allowDragging: {
bookmarksToolbar_allowDragging: {
WebkitAppRegion: 'drag'
},

bookmarksToolbar_disallowDragging: {
WebkitAppRegion: 'no-drag'
},
bookmarksToolbar__showOnlyFavicon: {
padding: `0 0 0 ${globalStyles.spacing.bookmarksToolbarPadding}`
},
Expand Down

0 comments on commit 54f89bc

Please sign in to comment.