diff --git a/app/renderer/components/bookmarks/addEditBookmarkHanger.js b/app/renderer/components/bookmarks/addEditBookmarkHanger.js index f1ec6145087..5fef8b3860d 100644 --- a/app/renderer/components/bookmarks/addEditBookmarkHanger.js +++ b/app/renderer/components/bookmarks/addEditBookmarkHanger.js @@ -159,6 +159,20 @@ class AddEditBookmarkHanger extends React.Component { } } +const navigationButtonContainerWidth = globalStyles.navigationBar.navigationButtonContainer.width +const navigationButtonContainerMarginRight = globalStyles.navigationBar.navigationButtonContainer.marginRight +const bookmarkButtonContainerWidth = globalStyles.navigationBar.urlbarForm.height + +// Add navigationButtonContainerMarginRight (6px) +const navigationButtonWidth = `calc(${navigationButtonContainerWidth} + ${navigationButtonContainerMarginRight})` + +// Count the reload and stop button, adding the half width of the bookmark button container +// 12px == arrowUp width +const bookmarkHangerPosition = `calc(12px + ${navigationButtonWidth} + (${bookmarkButtonContainerWidth} / 2))` + +// Add another container width +const bookmarkHangerPositionWithHomeButton = `calc(${bookmarkHangerPosition} + ${navigationButtonWidth})` + const styles = StyleSheet.create({ // Copied from commonForm.js commonFormSection: { @@ -185,7 +199,7 @@ const styles = StyleSheet.create({ }, bookmarkHanger__arrowUp: { position: 'relative', - left: '54px', + left: bookmarkHangerPosition, '::after': { content: '""', @@ -199,7 +213,7 @@ const styles = StyleSheet.create({ } }, bookmarkHanger__withHomeButton: { - left: '83px' + left: bookmarkHangerPositionWithHomeButton }, bookmark__bottomWrapper: { display: 'flex', diff --git a/app/renderer/components/common/commonForm.js b/app/renderer/components/common/commonForm.js index 9ca3b49e217..6fd26a7c7bd 100644 --- a/app/renderer/components/common/commonForm.js +++ b/app/renderer/components/common/commonForm.js @@ -164,7 +164,7 @@ const styles = StyleSheet.create({ maxWidth: globalStyles.spacing.bookmarkHangerMaxWidth, height: 'initial', // #8634 - // Cancel the inherited value from .navbarMenubarFlexContainer, which is 'nowrap'. + // Cancel the inherited value from navigator__menuBarAndNavigationBar on navigator.js, which is 'nowrap'. whiteSpace: 'normal' }, diff --git a/app/renderer/components/navigation/homeButton.js b/app/renderer/components/navigation/homeButton.js index a0bbb9d9afa..fb2cee1530b 100644 --- a/app/renderer/components/navigation/homeButton.js +++ b/app/renderer/components/navigation/homeButton.js @@ -14,9 +14,15 @@ const appActions = require('../../../../js/actions/appActions') const settings = require('../../../../js/constants/settings') // Utils +const cx = require('../../../../js/lib/classSet') const {getSetting} = require('../../../../js/settings') const eventUtil = require('../../../../js/lib/eventUtil') +const {StyleSheet, css} = require('aphrodite/no-important') +const globalStyles = require('../styles/global') + +const homeButton = require('../../../../img/toolbar/home_btn.svg') + class HomeButton extends ImmutableComponent { constructor (props) { super(props) @@ -49,17 +55,37 @@ class HomeButton extends ImmutableComponent { }) } + // BEM Level: navigationBar__buttonContainer render () { - return -