This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break
Preferences > Advanced
into its own file; move the new zoom s…
…etting there Auditors: @cezaraugusto, @NejcZdovc Test Plan: 1. Open preferences and visit the `Advanced` tab 2. Settings should work as expected; there should be no console errors Add configurable UI scaling. This doesn't affect page size; scaling is only for the browser UI elements Fixes #1937 Auditors: @bradleyrichter, @alexwykoff, @NejcZdovc Test Plan: 1. Open preferences and visit the `Advanced` tab 2. Change the new `Toolbar and UI elements scale` setting. - verify default is `Normal` - choose a smaller size and verify URL bar, nav buttons, etc get smaller - choose a larger size and verify URL bar, nav buttons, etc get larger - verify size of page content does not change This commit incorporates feedback from PR - organize imports - translations for the new drop down values - moved "requires restart" style to commonStyles - switch advancedTab to use aphrodite/no-important - updated zoom values per convo w/ @bradleyrichter
- Loading branch information
Showing
10 changed files
with
114 additions
and
25 deletions.
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,21 @@ | ||
/* 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 scaleSize = { | ||
SMALLER: 'smaller', | ||
NORMAL: 'normal', | ||
LARGER: 'larger', | ||
SUPERSIZE: 'supersize' | ||
} | ||
|
||
let zoomLevel = {} | ||
zoomLevel[scaleSize.SMALLER] = -0.5 | ||
zoomLevel[scaleSize.NORMAL] = 0.0 | ||
zoomLevel[scaleSize.LARGER] = 1.0 | ||
zoomLevel[scaleSize.SUPERSIZE] = 3.0 | ||
|
||
module.exports = { | ||
scaleSize, | ||
zoomLevel | ||
} |
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
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,68 @@ | ||
/* 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('../immutableComponent') | ||
const {StyleSheet, css} = require('aphrodite/no-important') | ||
const commonStyles = require('../styles/commonStyles') | ||
|
||
// Actions | ||
const {getSetting} = require('../../../../js/settings') | ||
|
||
// Components | ||
const {SettingsList, SettingItem, SettingCheckbox} = require('../settings') | ||
const {SettingDropdown} = require('../dropdown') | ||
|
||
// Constants | ||
const settings = require('../../../../js/constants/settings') | ||
const {scaleSize} = require('../../../common/constants/toolbarUserInterfaceScale') | ||
|
||
// Utils | ||
const {changeSetting} = require('../../lib/settingsUtil') | ||
|
||
class AdvancedTab extends ImmutableComponent { | ||
render () { | ||
return <div> | ||
<main className={css(styles.advancedTabMain)}> | ||
<div className='sectionTitle' data-l10n-id='contentSettings' /> | ||
<SettingsList> | ||
<SettingCheckbox dataL10nId='useHardwareAcceleration' prefKey={settings.HARDWARE_ACCELERATION_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} /> | ||
<SettingCheckbox dataL10nId='useSmoothScroll' prefKey={settings.SMOOTH_SCROLL_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} /> | ||
<SettingCheckbox dataL10nId='sendCrashReports' prefKey={settings.SEND_CRASH_REPORTS} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} /> | ||
<SettingCheckbox dataL10nId='sendUsageStatistics' prefKey={settings.SEND_USAGE_STATISTICS} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} /> | ||
</SettingsList> | ||
|
||
<div className='sectionTitle' data-l10n-id='toolbarUserInterfaceScale' /> | ||
<SettingItem> | ||
<SettingDropdown | ||
value={getSetting(settings.TOOLBAR_UI_SCALE, this.props.settings)} | ||
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.TOOLBAR_UI_SCALE)}> | ||
data-type='float'> | ||
<option data-l10n-id='scaleSizeSmaller' value={scaleSize.SMALLER} /> | ||
<option data-l10n-id='scaleSizeNormal' value={scaleSize.NORMAL} /> | ||
<option data-l10n-id='scaleSizeLarger' value={scaleSize.LARGER} /> | ||
<option data-l10n-id='scaleSizeSuper' value={scaleSize.SUPERSIZE} /> | ||
</SettingDropdown> | ||
</SettingItem> | ||
</main> | ||
<footer className={css(styles.moreInfo)}> | ||
<div data-l10n-id='requiresRestart' className={css(commonStyles.requiresRestart)} /> | ||
</footer> | ||
</div> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
advancedTabMain: { | ||
paddingBottom: '40px' | ||
}, | ||
|
||
moreInfo: { | ||
display: 'flex', | ||
flex: 1, | ||
alignItems: 'flex-end' | ||
} | ||
}) | ||
|
||
module.exports = AdvancedTab |
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -685,8 +685,3 @@ table.sortableTable { | |
#syncQR { | ||
margin: 1em; | ||
} | ||
|
||
.requiresRestart { | ||
font-style: italic; | ||
margin-bottom: 2em; | ||
} |