Merge pull request #16003 from Snuffleupagus/scaleSelect-width-CSS-var
Move the `--scale-select-width` CSS variable to the relevant DOM element
This commit is contained in:
commit
df71f82037
@ -17,7 +17,6 @@ import {
|
|||||||
animationStarted,
|
animationStarted,
|
||||||
DEFAULT_SCALE,
|
DEFAULT_SCALE,
|
||||||
DEFAULT_SCALE_VALUE,
|
DEFAULT_SCALE_VALUE,
|
||||||
docStyle,
|
|
||||||
MAX_SCALE,
|
MAX_SCALE,
|
||||||
MIN_SCALE,
|
MIN_SCALE,
|
||||||
noContextMenuHandler,
|
noContextMenuHandler,
|
||||||
@ -342,7 +341,8 @@ class Toolbar {
|
|||||||
maxWidth += 0.3 * scaleSelectWidth;
|
maxWidth += 0.3 * scaleSelectWidth;
|
||||||
|
|
||||||
if (maxWidth > scaleSelectWidth) {
|
if (maxWidth > scaleSelectWidth) {
|
||||||
docStyle.setProperty("--scale-select-width", `${maxWidth}px`);
|
const container = items.scaleSelect.parentNode;
|
||||||
|
container.style.setProperty("--scale-select-width", `${maxWidth}px`);
|
||||||
}
|
}
|
||||||
// Zeroing the width and height cause Firefox to release graphics resources
|
// Zeroing the width and height cause Firefox to release graphics resources
|
||||||
// immediately, which can greatly reduce memory consumption.
|
// immediately, which can greatly reduce memory consumption.
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
--sidebar-width: 200px;
|
--sidebar-width: 200px;
|
||||||
--sidebar-transition-duration: 200ms;
|
--sidebar-transition-duration: 200ms;
|
||||||
--sidebar-transition-timing-function: ease;
|
--sidebar-transition-timing-function: ease;
|
||||||
--scale-select-width: 140px;
|
|
||||||
|
|
||||||
--toolbar-icon-opacity: 0.7;
|
--toolbar-icon-opacity: 0.7;
|
||||||
--doorhanger-icon-opacity: 0.9;
|
--doorhanger-icon-opacity: 0.9;
|
||||||
@ -799,6 +798,10 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropdownToolbarButton {
|
.dropdownToolbarButton {
|
||||||
|
/* Define this variable here, and not in :root, to avoid reflowing the
|
||||||
|
entire viewer when updating the width. */
|
||||||
|
--scale-select-width: 140px;
|
||||||
|
|
||||||
width: var(--scale-select-width);
|
width: var(--scale-select-width);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background-color: var(--dropdown-btn-bg-color);
|
background-color: var(--dropdown-btn-bg-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user