1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Increase the size of the toolbar depending on the uidensity (bug 1171799)

This commit is contained in:
Calixte Denizet 2024-09-24 15:37:42 +02:00
parent 529906c74f
commit e23159c41b
3 changed files with 27 additions and 4 deletions

View file

@ -126,7 +126,18 @@ class Toolbar {
this.reset();
}
#updateToolbarDensity() {}
#updateToolbarDensity({ value }) {
let name = "normal";
switch (value) {
case 1:
name = "compact";
break;
case 2:
name = "touch";
break;
}
document.documentElement.setAttribute("data-toolbar-density", name);
}
#setAnnotationEditorUIManager(uiManager, parentContainer) {
const colorPicker = new ColorPicker({ uiManager });

View file

@ -227,6 +227,15 @@
}
}
html {
&[data-toolbar-density="compact"] {
--toolbar-height: 30px;
}
&[data-toolbar-density="touch"] {
--toolbar-height: 44px;
}
}
html,
body {
height: 100%;
@ -1093,6 +1102,10 @@ dialog :link {
height: 100%;
}
.menu {
padding-block: 5px;
}
.menuContainer {
width: 100%;
height: auto;
@ -1103,7 +1116,6 @@ dialog :link {
display: flex;
flex-direction: column;
box-sizing: border-box;
padding-block: 5px;
overflow-y: auto;
}

View file

@ -307,7 +307,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<button id="editorStampButton" class="toolbarButton" type="button" disabled="disabled" title="Add or edit images" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorStampParamsToolbar" tabindex="0" data-l10n-id="pdfjs-editor-stamp-button">
<span data-l10n-id="pdfjs-editor-stamp-button-label">Add or edit images</span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight" id="editorStampParamsToolbar">
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorStampParamsToolbar">
<div class="menuContainer">
<button id="editorStampAddImage" class="toolbarButton labeled" type="button" title="Add image" tabindex="0" data-l10n-id="pdfjs-editor-stamp-add-image-button">
<span class="editorParamsLabel" data-l10n-id="pdfjs-editor-stamp-add-image-button-label">Add image</span>
@ -335,7 +335,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<button id="secondaryToolbarToggleButton" class="toolbarButton" type="button" title="Tools" tabindex="0" data-l10n-id="pdfjs-tools-button" aria-expanded="false" aria-haspopup="true" aria-controls="secondaryToolbar">
<span data-l10n-id="pdfjs-tools-button-label">Tools</span>
</button>
<div id="secondaryToolbar" class="hidden doorHangerRight">
<div id="secondaryToolbar" class="hidden doorHangerRight menu">
<div id="secondaryToolbarButtonContainer" class="menuContainer">
<!--#if GENERIC-->
<button id="secondaryOpenFile" class="toolbarButton labeled" type="button" title="Open File" tabindex="0" data-l10n-id="pdfjs-open-file-button">