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

Add configurable UI scaling #8419

Merged
merged 1 commit into from
Apr 24, 2017
Merged

Add configurable UI scaling #8419

merged 1 commit into from
Apr 24, 2017

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Apr 21, 2017

Break Preferences > Advanced into its own file

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

NOTE: This doesn't affect page size; scaling is only for the browser UI elements

Fixes #1937
Fixes #4050

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
  1. Open multiple windows and verify changing the setting takes effect
  2. Verify setting affects ALL UI elements... such as Alert
  3. Verify setting is saved on exit and that all windows are created on launch with the proper size

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Screenshots

New preference (under advanced)
screen shot 2017-04-21 at 12 38 50 am

The setting in action
zoom-ui

@bsclifton bsclifton added accessibility design A design change, especially one which needs input from the design team. QA/test-plan-specified release-notes/include labels Apr 21, 2017
@bsclifton bsclifton added this to the 0.15.1 milestone Apr 21, 2017
@bsclifton bsclifton self-assigned this Apr 21, 2017
Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this one

SUPERSIZE: 'supersize'
}

let zoomLevel = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't here be array and not object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object makes sense IMO- I use the array style syntax for accessing the object since the dot notation is not available with a variable. ex: zoomLevel.SUPERSIZE won't work, hence zoomLevel[SUPERSIZE]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

value={getSetting(settings.TOOLBAR_UI_SCALE, this.props.settings)}
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.TOOLBAR_UI_SCALE)}>
data-type='float'>
<option value={scaleSize.SMALLER}>Smaller</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please translate this values

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT catch!! 😄


moreInfo: {
display: 'flex',
flex: '1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need string here

const React = require('react')
const ImmutableComponent = require('../immutableComponent')

const {SettingsList, SettingItem, SettingCheckbox} = require('../settings')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please reorder imports in something like this: https://github.com/brave/browser-laptop/blob/master/js/components/main.js or https://github.com/brave/browser-laptop/pull/8225/files#diff-169b96dac6a9688438a29c5013735bda

This way it's really easy to find if you are searching for something.

@@ -0,0 +1,61 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++++ On splitting into a new file ❤️


const {SettingsList, SettingItem, SettingCheckbox} = require('../settings')
const {SettingDropdown} = require('../dropdown')
const {StyleSheet, css} = require('aphrodite')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add no-important to it. CC @cezaraugusto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ no-important pls
const {StyleSheet, css} = require('aphrodite/no-important')

</SettingItem>
</main>
<footer className={css(styles.moreInfo)}>
<div data-l10n-id='requiresRestart' className='requiresRestart' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put requiresRestart inside commonStyles.js?

@bsclifton
Copy link
Member Author

@bradleyrichter, @NejcZdovc, @cezaraugusto, @luixxiul Feedback incorporated! Give it a spin, re-review, let me know what you think 😄

@cndouglas
Copy link

@bsclifton There are some conflicts in js/about/preferences.js.

@bsclifton
Copy link
Member Author

@liunkae thanks for the heads up- rebased 😄


class AdvancedTab extends ImmutableComponent {
render () {
return <div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please redo this page so it will be aligned with this new approach that was added in this PR #8237

render () {
return <div>
<main className={css(styles.advancedTabMain)}>
<div className='sectionTitle' data-l10n-id='contentSettings' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<SettingCheckbox dataL10nId='sendUsageStatistics' prefKey={settings.SEND_USAGE_STATISTICS} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
</SettingsList>

<div className='sectionTitle' data-l10n-id='toolbarUserInterfaceScale' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

…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
- use new `DefaultSectionTitle` tag for the new AdvancedTab component
@bsclifton
Copy link
Member Author

@NejcZdovc updated! 😄

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is in a higher ground ♫ of quality ++

@cezaraugusto cezaraugusto merged commit 2212b33 into master Apr 24, 2017
@bsclifton bsclifton deleted the zoom-for-ui-elements branch April 24, 2017 21:07
@bsclifton
Copy link
Member Author

🎹

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility design A design change, especially one which needs input from the design team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants