Skip to content
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

Update the zoom dropdown width calculation to work better in locales with long zoom-strings (PR 11077 follow-up) #12250

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

With the changes in PR #11077, the zoom dropdown now looks "squashed" in locales with longer than average zoom-strings[1]. The reason is that the zoom-value and the dropdown-icon are too close together, which doesn't look good in affected locales.

To fix this, the following changes are made:

  • Increase the calculated dropdown width, in Toolbar._adjustScaleWidth, to account for the much wider icon (7 px -> 16 px) and the increased padding.
  • Move the dropdown-icon slightly outwards, and also slightly reduce the left (right in RTL locales) padding of the dropdown-contents.
  • Finally, remove the right (left in RTL locales) padding to reduce the chance of the default browser dropdown-icon being visible.

[1] This affects e.g. the de and nl locales, but there's probably other examples as well.

…with long zoom-strings (PR 11077 follow-up)

With the changes in PR 11077, the zoom dropdown now looks "squashed" in locales with longer than average zoom-strings[1]. The reason is that the zoom-value and the dropdown-icon are too close together, which doesn't look good in affected locales.

To fix this, the following changes are made:
 - Increase the calculated dropdown width, in `Toolbar._adjustScaleWidth`, to account for the much wider icon (7 px -> 16 px) and the increased padding.
 - Move the dropdown-icon *slightly* outwards, and also *slightly* reduce the left (right in RTL locales) padding of the dropdown-contents.
 - Finally, remove the right (left in RTL locales) padding to reduce the chance of the *default* browser dropdown-icon being visible.

---
[1] This affects e.g. the `de` and `nl` locales, but there's probably other examples as well.
@@ -352,7 +352,7 @@ html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentatio
background-color: var(--sidebar-bg-color);
}
html[dir='ltr'] #toolbarSidebar {
box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't manually change this line, but upon saving my editor removed the trailing space; given that we shouldn't have trailing spaces anywhere keeping this change thus seem OK here.

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/8e5599a7106f9e0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/8e5599a7106f9e0/output.txt

Total script time: 3.38 mins

Published

@timvandermeij timvandermeij merged commit 164be97 into mozilla:master Aug 20, 2020
@timvandermeij
Copy link
Contributor

Thank you for the follow-up!

@Snuffleupagus Snuffleupagus deleted the dropdownToolbarButton-adjustWidth branch August 21, 2020 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants