Skip to content

Commit

Permalink
Increase the size of the toolbar depending on the uidensity (bug 1171…
Browse files Browse the repository at this point in the history
…799)
  • Loading branch information
calixteman committed Sep 24, 2024
1 parent 529906c commit f59519c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
13 changes: 12 additions & 1 deletion web/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
9 changes: 9 additions & 0 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@
}
}

html {
&[data-toolbar-density="compact"] {
--toolbar-height: 30px;
}
&[data-toolbar-density="touch"] {
--toolbar-height: 44px;
}
}

html,
body {
height: 100%;
Expand Down

0 comments on commit f59519c

Please sign in to comment.