Commit d900944e authored by dpapad's avatar dpapad Committed by Commit Bot

PDF Viewer: Increase page selector minimum width and padding.

Also fixing an alignment issue, where the pageselector-container
would be larger than its contents, causing its contents to be
left-aligned instead of center-aligned.

Fixed: 1095210
Change-Id: I7a70eb86b65c50babd1fecf355055ec7f9e4d463
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2246912Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779498}
parent b22e1f69
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
color: #fff; color: #fff;
display: flex; display: flex;
font-size: 0.81rem; font-size: 0.81rem;
--page-selector-spacing: 4px;
} }
:host ::selection { :host ::selection {
...@@ -11,12 +13,10 @@ ...@@ -11,12 +13,10 @@
#pageselector::part(input), #pageselector::part(input),
#pagelength { #pagelength {
box-sizing: content-box;
padding: 0 3px;
/* --page-length-digits is set through JavaScript. 1px is added because /* --page-length-digits is set through JavaScript. 1px is added because
* the unit 'ch' does not provide exact whole number pixels, and * the unit 'ch' does not provide exact whole number pixels, and
* therefore seems to have 1px-off bugginess. */ * therefore seems to have 1px-off bugginess. */
width: calc(var(--page-length-digits) * 1ch + 1px); width: calc(max(2, var(--page-length-digits)) * 1ch + 1px);
} }
#pageselector { #pageselector {
...@@ -29,12 +29,18 @@ ...@@ -29,12 +29,18 @@
#pageselector::part(input) { #pageselector::part(input) {
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
box-sizing: content-box;
caret-color: var(--cr-input-color); caret-color: var(--cr-input-color);
padding: 0 var(--page-selector-spacing);
}
#divider {
margin: 0 var(--page-selector-spacing);
} }
</style> </style>
<cr-input id="pageselector" value="[[pageNo]]" on-mouseup="select" <cr-input id="pageselector" value="[[pageNo]]" on-mouseup="select"
on-value-changed="onInputValueChange_" on-change="pageNoCommitted" on-value-changed="onInputValueChange_" on-change="pageNoCommitted"
aria-label$="$i18n{labelPageNumber}"> aria-label$="$i18n{labelPageNumber}">
</cr-input> </cr-input>
/ <span id="divider">/</span>
<span id="pagelength">[[docLength]]</span> <span id="pagelength">[[docLength]]</span>
...@@ -143,10 +143,6 @@ ...@@ -143,10 +143,6 @@
#rotate-left { #rotate-left {
display: none; display: none;
} }
#pageselector-container {
flex: 2;
}
} }
@media(max-width: 450px) { @media(max-width: 450px) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment