@gjsify/adwaita-web 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adwaita-web.css +8070 -3037
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-application-window.spec.d.ts +1 -0
- package/lib/types/adw-bin.spec.d.ts +1 -0
- package/lib/types/adw-breakpoint-bin.spec.d.ts +1 -0
- package/lib/types/adw-clamp-scrollable.spec.d.ts +1 -0
- package/lib/types/adw-multi-layout-view.spec.d.ts +1 -0
- package/lib/types/adw-preferences-row.spec.d.ts +1 -0
- package/lib/types/adw-shortcuts.spec.d.ts +1 -0
- package/lib/types/adw-tab-bar.spec.d.ts +1 -0
- package/lib/types/adw-tab-button.spec.d.ts +1 -0
- package/lib/types/adw-tab-overview.spec.d.ts +1 -0
- package/lib/types/adw-view-switcher-sidebar.spec.d.ts +1 -0
- package/lib/types/adw-window.spec.d.ts +1 -0
- package/lib/types/breakpoints.d.ts +14 -3
- package/lib/types/construct-vectors.spec.d.ts +1 -0
- package/lib/types/elements/adw-application-window.d.ts +27 -0
- package/lib/types/elements/adw-bin.d.ts +17 -0
- package/lib/types/elements/adw-breakpoint-bin.d.ts +67 -0
- package/lib/types/elements/adw-clamp-scrollable.d.ts +38 -0
- package/lib/types/elements/adw-dialog.d.ts +10 -0
- package/lib/types/elements/adw-layout-slot.d.ts +19 -0
- package/lib/types/elements/adw-multi-layout-view.d.ts +101 -0
- package/lib/types/elements/adw-preferences-row.d.ts +31 -0
- package/lib/types/elements/adw-shortcuts-dialog.d.ts +13 -0
- package/lib/types/elements/adw-shortcuts-item.d.ts +36 -0
- package/lib/types/elements/adw-shortcuts-section.d.ts +14 -0
- package/lib/types/elements/adw-sidebar.d.ts +5 -0
- package/lib/types/elements/adw-switch-row.d.ts +3 -0
- package/lib/types/elements/adw-tab-bar.d.ts +108 -0
- package/lib/types/elements/adw-tab-button.d.ts +32 -0
- package/lib/types/elements/adw-tab-overview.d.ts +199 -0
- package/lib/types/elements/adw-tab-view.d.ts +19 -23
- package/lib/types/elements/adw-view-switcher-sidebar.d.ts +84 -0
- package/lib/types/elements/adw-window.d.ts +40 -0
- package/lib/types/elements/gtk-about-dialog.d.ts +146 -0
- package/lib/types/elements/gtk-application-window.d.ts +34 -0
- package/lib/types/elements/gtk-aspect-frame.d.ts +27 -0
- package/lib/types/elements/gtk-button.d.ts +9 -0
- package/lib/types/elements/gtk-calendar.d.ts +159 -0
- package/lib/types/elements/gtk-center-box.d.ts +39 -0
- package/lib/types/elements/gtk-color-dialog-button.d.ts +69 -0
- package/lib/types/elements/gtk-column-view.d.ts +50 -0
- package/lib/types/elements/gtk-drag-icon.d.ts +78 -0
- package/lib/types/elements/gtk-drawing-area.d.ts +95 -0
- package/lib/types/elements/gtk-editable-label.d.ts +33 -0
- package/lib/types/elements/gtk-emoji-chooser.d.ts +84 -0
- package/lib/types/elements/gtk-entry.d.ts +20 -1
- package/lib/types/elements/gtk-expander.d.ts +49 -0
- package/lib/types/elements/gtk-fixed.d.ts +13 -0
- package/lib/types/elements/gtk-flow-box-child.d.ts +14 -0
- package/lib/types/elements/gtk-flow-box.d.ts +87 -0
- package/lib/types/elements/gtk-font-dialog-button.d.ts +83 -0
- package/lib/types/elements/gtk-frame.d.ts +24 -0
- package/lib/types/elements/gtk-gl-area.d.ts +136 -0
- package/lib/types/elements/gtk-graphics-offload.d.ts +24 -0
- package/lib/types/elements/gtk-grid-view.d.ts +39 -0
- package/lib/types/elements/gtk-grid.d.ts +27 -0
- package/lib/types/elements/gtk-header-bar.d.ts +60 -0
- package/lib/types/elements/gtk-inscription.d.ts +64 -0
- package/lib/types/elements/gtk-label.d.ts +3 -0
- package/lib/types/elements/gtk-level-bar.d.ts +59 -0
- package/lib/types/elements/gtk-link-button.d.ts +29 -0
- package/lib/types/elements/gtk-list-box-row.d.ts +54 -0
- package/lib/types/elements/gtk-list-box.d.ts +100 -0
- package/lib/types/elements/gtk-list-view.d.ts +73 -0
- package/lib/types/elements/gtk-media-controls.d.ts +142 -0
- package/lib/types/elements/gtk-notebook.d.ts +148 -0
- package/lib/types/elements/gtk-overlay.d.ts +22 -0
- package/lib/types/elements/gtk-page-setup-unix-dialog.d.ts +87 -0
- package/lib/types/elements/gtk-paned.d.ts +121 -0
- package/lib/types/elements/gtk-password-entry.d.ts +27 -0
- package/lib/types/elements/gtk-picture.d.ts +66 -0
- package/lib/types/elements/gtk-popover-bin.d.ts +82 -0
- package/lib/types/elements/gtk-popover-menu-bar.d.ts +66 -0
- package/lib/types/elements/gtk-popover-menu.d.ts +83 -0
- package/lib/types/elements/gtk-popover.d.ts +28 -3
- package/lib/types/elements/gtk-print-unix-dialog.d.ts +167 -0
- package/lib/types/elements/gtk-revealer.d.ts +55 -0
- package/lib/types/elements/gtk-scale-button.d.ts +59 -0
- package/lib/types/elements/gtk-scale.d.ts +98 -0
- package/lib/types/elements/gtk-scrollbar.d.ts +124 -0
- package/lib/types/elements/gtk-scrolled-window.d.ts +121 -0
- package/lib/types/elements/gtk-search-bar.d.ts +39 -0
- package/lib/types/elements/gtk-search-entry.d.ts +27 -0
- package/lib/types/elements/gtk-separator.d.ts +10 -0
- package/lib/types/elements/gtk-spin-button.d.ts +94 -0
- package/lib/types/elements/gtk-spinner.d.ts +14 -0
- package/lib/types/elements/gtk-stack-sidebar.d.ts +43 -0
- package/lib/types/elements/gtk-stack-switcher.d.ts +58 -0
- package/lib/types/elements/gtk-stack.d.ts +154 -0
- package/lib/types/elements/gtk-switch.d.ts +4 -1
- package/lib/types/elements/gtk-text-view.d.ts +62 -0
- package/lib/types/elements/gtk-text.d.ts +45 -0
- package/lib/types/elements/gtk-toggle-button.d.ts +45 -0
- package/lib/types/elements/gtk-tree-expander.d.ts +38 -0
- package/lib/types/elements/gtk-video.d.ts +97 -0
- package/lib/types/elements/gtk-viewport.d.ts +84 -0
- package/lib/types/elements/gtk-window-controls.d.ts +80 -0
- package/lib/types/elements/gtk-window-handle.d.ts +39 -0
- package/lib/types/elements/gtk-window.d.ts +97 -0
- package/lib/types/elements/justification.d.ts +2 -0
- package/lib/types/elements/popover-menu.d.ts +18 -0
- package/lib/types/elements/roving-focus.d.ts +29 -1
- package/lib/types/emoji-data.d.ts +38 -0
- package/lib/types/font-description.d.ts +96 -0
- package/lib/types/gtk-about-dialog.spec.d.ts +1 -0
- package/lib/types/gtk-action-bar.spec.d.ts +1 -0
- package/lib/types/gtk-application-window.spec.d.ts +1 -0
- package/lib/types/gtk-aspect-frame.spec.d.ts +1 -0
- package/lib/types/gtk-calendar.spec.d.ts +1 -0
- package/lib/types/gtk-center-box.spec.d.ts +1 -0
- package/lib/types/gtk-color-dialog-button.spec.d.ts +1 -0
- package/lib/types/gtk-column-view.spec.d.ts +1 -0
- package/lib/types/gtk-drag-icon.spec.d.ts +1 -0
- package/lib/types/gtk-drawing-area.spec.d.ts +1 -0
- package/lib/types/gtk-editable-label.spec.d.ts +1 -0
- package/lib/types/gtk-emoji-chooser.spec.d.ts +1 -0
- package/lib/types/gtk-expander.spec.d.ts +1 -0
- package/lib/types/gtk-fixed.spec.d.ts +1 -0
- package/lib/types/gtk-flow-box.spec.d.ts +1 -0
- package/lib/types/gtk-font-dialog-button.spec.d.ts +1 -0
- package/lib/types/gtk-frame.spec.d.ts +1 -0
- package/lib/types/gtk-gl-area.spec.d.ts +1 -0
- package/lib/types/gtk-graphics-offload.spec.d.ts +1 -0
- package/lib/types/gtk-grid-view.spec.d.ts +1 -0
- package/lib/types/gtk-grid.spec.d.ts +1 -0
- package/lib/types/gtk-header-bar.spec.d.ts +1 -0
- package/lib/types/gtk-inscription.spec.d.ts +1 -0
- package/lib/types/gtk-level-bar.spec.d.ts +1 -0
- package/lib/types/gtk-link-button.spec.d.ts +1 -0
- package/lib/types/gtk-list-box.spec.d.ts +1 -0
- package/lib/types/gtk-list-view.spec.d.ts +1 -0
- package/lib/types/gtk-media-controls.spec.d.ts +1 -0
- package/lib/types/gtk-notebook.spec.d.ts +1 -0
- package/lib/types/gtk-overlay.spec.d.ts +1 -0
- package/lib/types/gtk-paned.spec.d.ts +1 -0
- package/lib/types/gtk-password-entry.spec.d.ts +1 -0
- package/lib/types/gtk-picture.spec.d.ts +1 -0
- package/lib/types/gtk-popover-bin.spec.d.ts +1 -0
- package/lib/types/gtk-popover-menu-bar.spec.d.ts +1 -0
- package/lib/types/gtk-popover-menu.spec.d.ts +1 -0
- package/lib/types/gtk-popover-role.spec.d.ts +1 -0
- package/lib/types/gtk-popover.spec.d.ts +1 -0
- package/lib/types/gtk-print-dialogs.spec.d.ts +1 -0
- package/lib/types/gtk-revealer.spec.d.ts +1 -0
- package/lib/types/gtk-scale-button.spec.d.ts +1 -0
- package/lib/types/gtk-scale.spec.d.ts +1 -0
- package/lib/types/gtk-scrollbar.spec.d.ts +1 -0
- package/lib/types/gtk-scrolled-window.spec.d.ts +1 -0
- package/lib/types/gtk-search-bar.spec.d.ts +1 -0
- package/lib/types/gtk-search-entry.spec.d.ts +1 -0
- package/lib/types/gtk-separator.spec.d.ts +1 -0
- package/lib/types/gtk-spin-button.spec.d.ts +1 -0
- package/lib/types/gtk-spinner.spec.d.ts +1 -0
- package/lib/types/gtk-stack-sidebar.spec.d.ts +1 -0
- package/lib/types/gtk-stack-switcher.spec.d.ts +1 -0
- package/lib/types/gtk-stack.spec.d.ts +1 -0
- package/lib/types/gtk-text-view.spec.d.ts +1 -0
- package/lib/types/gtk-text.spec.d.ts +1 -0
- package/lib/types/gtk-toggle-button.spec.d.ts +1 -0
- package/lib/types/gtk-tree-expander.spec.d.ts +1 -0
- package/lib/types/gtk-video.spec.d.ts +1 -0
- package/lib/types/gtk-viewport.spec.d.ts +1 -0
- package/lib/types/gtk-window-controls.spec.d.ts +1 -0
- package/lib/types/gtk-window-handle.spec.d.ts +1 -0
- package/lib/types/gtk-window.spec.d.ts +1 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/list-view-dom.d.ts +44 -0
- package/lib/types/namespace/adw.d.ts +12 -0
- package/lib/types/namespace/gtk.d.ts +61 -0
- package/lib/types/page-setup.d.ts +100 -0
- package/lib/types/scroll-shading.d.ts +15 -1
- package/lib/types/shared-tree-builder.d.ts +30 -2
- package/lib/types/signals.d.ts +4 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/lib/types/tab-chip.d.ts +73 -0
- package/lib/types/template-classes.d.ts +11 -0
- package/package.json +12 -8
- package/scss/_action_row.scss +2 -2
- package/scss/_application_window.scss +26 -0
- package/scss/_aspect_frame.scss +25 -0
- package/scss/_bin.scss +26 -0
- package/scss/_button.scss +45 -0
- package/scss/_calendar.scss +176 -0
- package/scss/_center_box.scss +25 -0
- package/scss/_checks.scss +6 -1
- package/scss/_clamp_scrollable.scss +28 -0
- package/scss/_color_button.scss +67 -0
- package/scss/_column_view.scss +126 -0
- package/scss/_drag_icon.scss +55 -0
- package/scss/_drawing.scss +85 -0
- package/scss/_emoji_chooser.scss +213 -0
- package/scss/_entry.scss +13 -5
- package/scss/_entry_row.scss +1 -1
- package/scss/_expander.scss +113 -0
- package/scss/_fixed.scss +29 -0
- package/scss/_flow_box.scss +94 -0
- package/scss/_font_button.scss +63 -0
- package/scss/_frame.scss +41 -0
- package/scss/_grid.scss +19 -0
- package/scss/_grid_view.scss +46 -0
- package/scss/_gtk_about_dialog.scss +186 -0
- package/scss/_headerbar.scss +132 -0
- package/scss/_icons.generated.scss +186 -0
- package/scss/_inscription.scss +125 -0
- package/scss/_level_bar.scss +190 -0
- package/scss/_link.scss +82 -0
- package/scss/_list_box.scss +88 -0
- package/scss/_list_view.scss +96 -0
- package/scss/_media_controls.scss +139 -0
- package/scss/_overlay.scss +68 -0
- package/scss/_paned.scss +130 -0
- package/scss/_password_entry.scss +83 -0
- package/scss/_picture.scss +80 -0
- package/scss/_popover_bin.scss +53 -0
- package/scss/_popover_menu_bar.scss +104 -0
- package/scss/_preferences_row.scss +51 -0
- package/scss/_print_dialogs.scss +328 -0
- package/scss/_reset.scss +21 -19
- package/scss/_revealer.scss +37 -0
- package/scss/_row.scss +20 -5
- package/scss/_scale.scss +298 -0
- package/scss/_scale_button.scss +167 -0
- package/scss/_scrollbar.scss +230 -0
- package/scss/_scrolled_window.scss +131 -0
- package/scss/_search_bar.scss +118 -0
- package/scss/_search_entry.scss +86 -0
- package/scss/_separator.scss +44 -0
- package/scss/_shortcuts_dialog.scss +100 -0
- package/scss/_spin_button.scss +172 -0
- package/scss/_spin_row.scss +56 -8
- package/scss/_spinner.scss +85 -4
- package/scss/_stack.scss +729 -0
- package/scss/_switch.scss +13 -5
- package/scss/_switch_row.scss +10 -0
- package/scss/_tab_bar.scss +317 -0
- package/scss/_tab_button.scss +98 -0
- package/scss/_tab_overview.scss +483 -0
- package/scss/_text.scss +182 -0
- package/scss/_theme.scss +1 -1
- package/scss/_tree_expander.scss +62 -0
- package/scss/_variables.scss +43 -21
- package/scss/_video.scss +146 -0
- package/scss/_view_switcher_sidebar.scss +112 -0
- package/scss/_viewport.scss +50 -0
- package/scss/_window.scss +118 -1
- package/scss/_window_handle.scss +20 -0
- package/scss/adwaita-skin.scss +109 -0
- package/src/adw-action-rows.spec.ts +76 -0
- package/src/adw-application-window.spec.ts +118 -0
- package/src/adw-bin.spec.ts +75 -0
- package/src/adw-breakpoint-bin.spec.ts +324 -0
- package/src/adw-clamp-scrollable.spec.ts +189 -0
- package/src/adw-multi-layout-view.spec.ts +243 -0
- package/src/adw-preferences-row.spec.ts +164 -0
- package/src/adw-row-state.spec.ts +142 -0
- package/src/adw-shortcuts.spec.ts +155 -0
- package/src/adw-tab-bar.spec.ts +287 -0
- package/src/adw-tab-button.spec.ts +101 -0
- package/src/adw-tab-overview.spec.ts +443 -0
- package/src/adw-view-switcher-sidebar.spec.ts +281 -0
- package/src/adw-window.spec.ts +129 -0
- package/src/breakpoints.ts +25 -8
- package/src/capabilities.d.mts +3 -0
- package/src/capabilities.mjs +18 -0
- package/src/connect-lifecycle.spec.ts +12 -0
- package/src/construct-vectors.spec.ts +175 -0
- package/src/elements/adw-application-window.ts +154 -0
- package/src/elements/adw-bin.ts +101 -0
- package/src/elements/adw-breakpoint-bin.ts +287 -0
- package/src/elements/adw-clamp-scrollable.ts +207 -0
- package/src/elements/adw-dialog.ts +19 -0
- package/src/elements/adw-layout-slot.ts +95 -0
- package/src/elements/adw-multi-layout-view.ts +326 -0
- package/src/elements/adw-preferences-row.ts +150 -0
- package/src/elements/adw-shortcuts-dialog.ts +52 -0
- package/src/elements/adw-shortcuts-item.ts +171 -0
- package/src/elements/adw-shortcuts-section.ts +86 -0
- package/src/elements/adw-sidebar.ts +42 -3
- package/src/elements/adw-switch-row.ts +28 -1
- package/src/elements/adw-tab-bar.ts +529 -0
- package/src/elements/adw-tab-button.ts +194 -0
- package/src/elements/adw-tab-overview.ts +1011 -0
- package/src/elements/adw-tab-view.ts +66 -145
- package/src/elements/adw-toggle-group.ts +20 -5
- package/src/elements/adw-view-stack.ts +18 -0
- package/src/elements/adw-view-switcher-sidebar.ts +332 -0
- package/src/elements/adw-window.ts +185 -11
- package/src/elements/checks.ts +35 -8
- package/src/elements/gtk-about-dialog.ts +811 -0
- package/src/elements/gtk-application-window.ts +108 -0
- package/src/elements/gtk-aspect-frame.ts +160 -0
- package/src/elements/gtk-button.ts +12 -0
- package/src/elements/gtk-calendar.ts +757 -0
- package/src/elements/gtk-center-box.ts +184 -0
- package/src/elements/gtk-color-dialog-button.ts +278 -0
- package/src/elements/gtk-column-view.ts +320 -0
- package/src/elements/gtk-drag-icon.ts +257 -0
- package/src/elements/gtk-drawing-area.ts +303 -0
- package/src/elements/gtk-editable-label.ts +204 -0
- package/src/elements/gtk-emoji-chooser.ts +542 -0
- package/src/elements/gtk-entry.ts +39 -5
- package/src/elements/gtk-expander.ts +301 -0
- package/src/elements/gtk-fixed.ts +99 -0
- package/src/elements/gtk-flow-box-child.ts +68 -0
- package/src/elements/gtk-flow-box.ts +480 -0
- package/src/elements/gtk-font-dialog-button.ts +432 -0
- package/src/elements/gtk-frame.ts +174 -0
- package/src/elements/gtk-gl-area.ts +476 -0
- package/src/elements/gtk-graphics-offload.ts +130 -0
- package/src/elements/gtk-grid-view.ts +168 -0
- package/src/elements/gtk-grid.ts +127 -0
- package/src/elements/gtk-header-bar.ts +273 -0
- package/src/elements/gtk-inscription.ts +387 -0
- package/src/elements/gtk-label.ts +19 -11
- package/src/elements/gtk-level-bar.ts +323 -0
- package/src/elements/gtk-link-button.ts +138 -0
- package/src/elements/gtk-list-box-row.ts +195 -0
- package/src/elements/gtk-list-box.ts +413 -0
- package/src/elements/gtk-list-view.ts +370 -0
- package/src/elements/gtk-media-controls.ts +509 -0
- package/src/elements/gtk-notebook.ts +664 -0
- package/src/elements/gtk-overlay.ts +149 -0
- package/src/elements/gtk-page-setup-unix-dialog.ts +420 -0
- package/src/elements/gtk-paned.ts +597 -0
- package/src/elements/gtk-password-entry.ts +170 -0
- package/src/elements/gtk-picture.ts +254 -0
- package/src/elements/gtk-popover-bin.ts +332 -0
- package/src/elements/gtk-popover-menu-bar.ts +355 -0
- package/src/elements/gtk-popover-menu.ts +339 -0
- package/src/elements/gtk-popover.ts +92 -10
- package/src/elements/gtk-print-unix-dialog.ts +989 -0
- package/src/elements/gtk-progress-bar.ts +24 -11
- package/src/elements/gtk-revealer.ts +406 -0
- package/src/elements/gtk-scale-button.ts +358 -0
- package/src/elements/gtk-scale.ts +492 -0
- package/src/elements/gtk-scrollbar.ts +528 -0
- package/src/elements/gtk-scrolled-window.ts +642 -0
- package/src/elements/gtk-search-bar.ts +200 -0
- package/src/elements/gtk-search-entry.ts +172 -0
- package/src/elements/gtk-separator.ts +52 -0
- package/src/elements/gtk-spin-button.ts +475 -0
- package/src/elements/gtk-spinner.ts +126 -0
- package/src/elements/gtk-stack-sidebar.ts +212 -0
- package/src/elements/gtk-stack-switcher.ts +279 -0
- package/src/elements/gtk-stack.ts +748 -0
- package/src/elements/gtk-switch.ts +52 -19
- package/src/elements/gtk-text-view.ts +290 -0
- package/src/elements/gtk-text.ts +219 -0
- package/src/elements/gtk-toggle-button.ts +239 -0
- package/src/elements/gtk-tree-expander.ts +243 -0
- package/src/elements/gtk-video.ts +423 -0
- package/src/elements/gtk-viewport.ts +277 -0
- package/src/elements/gtk-window-controls.ts +341 -0
- package/src/elements/gtk-window-handle.ts +221 -0
- package/src/elements/gtk-window.ts +366 -0
- package/src/elements/justification.ts +24 -0
- package/src/elements/popover-menu.ts +24 -0
- package/src/elements/roving-focus.ts +53 -21
- package/src/emoji-data.ts +577 -0
- package/src/entry-rows.spec.ts +31 -0
- package/src/font-description.ts +238 -0
- package/src/gtk-about-dialog.spec.ts +250 -0
- package/src/gtk-action-bar.spec.ts +89 -0
- package/src/gtk-application-window.spec.ts +107 -0
- package/src/gtk-aspect-frame.spec.ts +114 -0
- package/src/gtk-calendar.spec.ts +589 -0
- package/src/gtk-center-box.spec.ts +125 -0
- package/src/gtk-color-dialog-button.spec.ts +141 -0
- package/src/gtk-column-view.spec.ts +154 -0
- package/src/gtk-drag-icon.spec.ts +190 -0
- package/src/gtk-drawing-area.spec.ts +211 -0
- package/src/gtk-editable-label.spec.ts +190 -0
- package/src/gtk-emoji-chooser.spec.ts +173 -0
- package/src/gtk-entry.spec.ts +23 -0
- package/src/gtk-expander.spec.ts +170 -0
- package/src/gtk-fixed.spec.ts +97 -0
- package/src/gtk-flow-box.spec.ts +289 -0
- package/src/gtk-font-dialog-button.spec.ts +166 -0
- package/src/gtk-frame.spec.ts +119 -0
- package/src/gtk-gl-area.spec.ts +361 -0
- package/src/gtk-graphics-offload.spec.ts +119 -0
- package/src/gtk-grid-view.spec.ts +106 -0
- package/src/gtk-grid.spec.ts +122 -0
- package/src/gtk-header-bar.spec.ts +202 -0
- package/src/gtk-inscription.spec.ts +235 -0
- package/src/gtk-level-bar.spec.ts +199 -0
- package/src/gtk-link-button.spec.ts +117 -0
- package/src/gtk-list-box.spec.ts +422 -0
- package/src/gtk-list-view.spec.ts +203 -0
- package/src/gtk-media-controls.spec.ts +295 -0
- package/src/gtk-notebook.spec.ts +546 -0
- package/src/gtk-overlay.spec.ts +141 -0
- package/src/gtk-paned.spec.ts +267 -0
- package/src/gtk-password-entry.spec.ts +150 -0
- package/src/gtk-picture.spec.ts +172 -0
- package/src/gtk-popover-bin.spec.ts +229 -0
- package/src/gtk-popover-menu-bar.spec.ts +296 -0
- package/src/gtk-popover-menu.spec.ts +261 -0
- package/src/gtk-popover-role.spec.ts +138 -0
- package/src/gtk-popover.spec.ts +264 -0
- package/src/gtk-print-dialogs.spec.ts +251 -0
- package/src/gtk-revealer.spec.ts +164 -0
- package/src/gtk-scale-button.spec.ts +218 -0
- package/src/gtk-scale.spec.ts +213 -0
- package/src/gtk-scrollbar.spec.ts +244 -0
- package/src/gtk-scrolled-window.spec.ts +262 -0
- package/src/gtk-search-bar.spec.ts +179 -0
- package/src/gtk-search-entry.spec.ts +142 -0
- package/src/gtk-separator.spec.ts +74 -0
- package/src/gtk-spin-button.spec.ts +186 -0
- package/src/gtk-spinner.spec.ts +130 -0
- package/src/gtk-stack-sidebar.spec.ts +217 -0
- package/src/gtk-stack-switcher.spec.ts +249 -0
- package/src/gtk-stack.spec.ts +432 -0
- package/src/gtk-text-view.spec.ts +189 -0
- package/src/gtk-text.spec.ts +163 -0
- package/src/gtk-toggle-button.spec.ts +186 -0
- package/src/gtk-tree-expander.spec.ts +201 -0
- package/src/gtk-video.spec.ts +240 -0
- package/src/gtk-viewport.spec.ts +140 -0
- package/src/gtk-window-controls.spec.ts +232 -0
- package/src/gtk-window-handle.spec.ts +158 -0
- package/src/gtk-window.spec.ts +190 -0
- package/src/index.ts +9 -1
- package/src/keyboard-operable.spec.ts +33 -1
- package/src/list-view-dom.ts +121 -0
- package/src/namespace/adw.ts +12 -0
- package/src/namespace/gtk.ts +61 -0
- package/src/page-setup.ts +222 -0
- package/src/scroll-shading.ts +18 -1
- package/src/shared-tree-builder.ts +263 -21
- package/src/signals.ts +15 -0
- package/src/source-view/theme.ts +11 -5
- package/src/style-classes.spec.ts +9 -8
- package/src/styles.generated.ts +1 -1
- package/src/tab-chip.ts +200 -0
- package/src/template-classes.ts +45 -0
- package/src/test.browser.mts +152 -0
package/src/namespace/gtk.ts
CHANGED
|
@@ -21,16 +21,77 @@
|
|
|
21
21
|
// are the same write and nothing in this package had to learn a second input shape.
|
|
22
22
|
|
|
23
23
|
export { GtkAdjustment as Adjustment } from '@gjsify/adwaita-core';
|
|
24
|
+
export { GtkAboutDialog as AboutDialog } from '../elements/gtk-about-dialog.js';
|
|
24
25
|
export { GtkActionBar as ActionBar } from '../elements/gtk-action-bar.js';
|
|
26
|
+
export { GtkApplicationWindow as ApplicationWindow } from '../elements/gtk-application-window.js';
|
|
27
|
+
export { GtkAspectFrame as AspectFrame } from '../elements/gtk-aspect-frame.js';
|
|
25
28
|
export { GtkBox as Box } from '../elements/gtk-box.js';
|
|
26
29
|
export { GtkButton as Button } from '../elements/gtk-button.js';
|
|
30
|
+
export { GtkCalendar as Calendar } from '../elements/gtk-calendar.js';
|
|
31
|
+
export { GtkCenterBox as CenterBox } from '../elements/gtk-center-box.js';
|
|
27
32
|
export { GtkCheckButton as CheckButton } from '../elements/checks.js';
|
|
33
|
+
export { GtkColorDialogButton as ColorDialogButton } from '../elements/gtk-color-dialog-button.js';
|
|
34
|
+
export { GtkColumnView as ColumnView } from '../elements/gtk-column-view.js';
|
|
28
35
|
export { GtkDropDown as DropDown } from '../elements/gtk-drop-down.js';
|
|
36
|
+
export { GtkDrawingArea as DrawingArea } from '../elements/gtk-drawing-area.js';
|
|
37
|
+
export { GtkDragIcon as DragIcon } from '../elements/gtk-drag-icon.js';
|
|
38
|
+
export { GtkEditableLabel as EditableLabel } from '../elements/gtk-editable-label.js';
|
|
39
|
+
export { GtkEmojiChooser as EmojiChooser } from '../elements/gtk-emoji-chooser.js';
|
|
29
40
|
export { GtkEntry as Entry } from '../elements/gtk-entry.js';
|
|
41
|
+
export { GtkExpander as Expander } from '../elements/gtk-expander.js';
|
|
42
|
+
export { GtkFixed as Fixed } from '../elements/gtk-fixed.js';
|
|
43
|
+
export { GtkFlowBox as FlowBox } from '../elements/gtk-flow-box.js';
|
|
44
|
+
export { GtkFlowBoxChild as FlowBoxChild } from '../elements/gtk-flow-box-child.js';
|
|
45
|
+
export { GtkFontDialogButton as FontDialogButton } from '../elements/gtk-font-dialog-button.js';
|
|
46
|
+
export { GtkFrame as Frame } from '../elements/gtk-frame.js';
|
|
47
|
+
export { GtkGLArea as GLArea } from '../elements/gtk-gl-area.js';
|
|
48
|
+
export { GtkGraphicsOffload as GraphicsOffload } from '../elements/gtk-graphics-offload.js';
|
|
49
|
+
export { GtkGrid as Grid } from '../elements/gtk-grid.js';
|
|
50
|
+
export { GtkGridView as GridView } from '../elements/gtk-grid-view.js';
|
|
51
|
+
export { GtkHeaderBar as HeaderBar } from '../elements/gtk-header-bar.js';
|
|
30
52
|
export { GtkImage as Image } from '../elements/gtk-image.js';
|
|
53
|
+
export { GtkLinkButton as LinkButton } from '../elements/gtk-link-button.js';
|
|
31
54
|
export { GtkLabel as Label } from '../elements/gtk-label.js';
|
|
55
|
+
export { GtkInscription as Inscription } from '../elements/gtk-inscription.js';
|
|
56
|
+
export { GtkLevelBar as LevelBar } from '../elements/gtk-level-bar.js';
|
|
57
|
+
export { GtkListBox as ListBox } from '../elements/gtk-list-box.js';
|
|
58
|
+
export { GtkListBoxRow as ListBoxRow } from '../elements/gtk-list-box-row.js';
|
|
59
|
+
export { GtkListView as ListView } from '../elements/gtk-list-view.js';
|
|
60
|
+
export { GtkMediaControls as MediaControls } from '../elements/gtk-media-controls.js';
|
|
32
61
|
export { GtkMenuButton as MenuButton } from '../elements/gtk-menu-button.js';
|
|
62
|
+
export { GtkNotebook as Notebook } from '../elements/gtk-notebook.js';
|
|
63
|
+
export { GtkOverlay as Overlay } from '../elements/gtk-overlay.js';
|
|
64
|
+
export { GtkPageSetupUnixDialog as PageSetupUnixDialog } from '../elements/gtk-page-setup-unix-dialog.js';
|
|
65
|
+
export { GtkPaned as Paned } from '../elements/gtk-paned.js';
|
|
66
|
+
export { GtkPasswordEntry as PasswordEntry } from '../elements/gtk-password-entry.js';
|
|
67
|
+
export { GtkPicture as Picture } from '../elements/gtk-picture.js';
|
|
33
68
|
export { GtkPopover as Popover } from '../elements/gtk-popover.js';
|
|
69
|
+
export { GtkPopoverBin as PopoverBin } from '../elements/gtk-popover-bin.js';
|
|
70
|
+
export { GtkPopoverMenu as PopoverMenu } from '../elements/gtk-popover-menu.js';
|
|
71
|
+
export { GtkPopoverMenuBar as PopoverMenuBar } from '../elements/gtk-popover-menu-bar.js';
|
|
72
|
+
export { GtkPrintUnixDialog as PrintUnixDialog } from '../elements/gtk-print-unix-dialog.js';
|
|
34
73
|
export { GtkProgressBar as ProgressBar } from '../elements/gtk-progress-bar.js';
|
|
74
|
+
export { GtkRevealer as Revealer } from '../elements/gtk-revealer.js';
|
|
75
|
+
export { GtkScale as Scale } from '../elements/gtk-scale.js';
|
|
76
|
+
export { GtkScaleButton as ScaleButton } from '../elements/gtk-scale-button.js';
|
|
77
|
+
export { GtkSearchBar as SearchBar } from '../elements/gtk-search-bar.js';
|
|
78
|
+
export { GtkSearchEntry as SearchEntry } from '../elements/gtk-search-entry.js';
|
|
79
|
+
export { GtkScrolledWindow as ScrolledWindow } from '../elements/gtk-scrolled-window.js';
|
|
80
|
+
export { GtkScrollbar as Scrollbar } from '../elements/gtk-scrollbar.js';
|
|
81
|
+
export { GtkSeparator as Separator } from '../elements/gtk-separator.js';
|
|
82
|
+
export { GtkSpinButton as SpinButton } from '../elements/gtk-spin-button.js';
|
|
83
|
+
export { GtkSpinner as Spinner } from '../elements/gtk-spinner.js';
|
|
84
|
+
export { GtkStack as Stack } from '../elements/gtk-stack.js';
|
|
85
|
+
export { GtkStackSidebar as StackSidebar } from '../elements/gtk-stack-sidebar.js';
|
|
86
|
+
export { GtkStackSwitcher as StackSwitcher } from '../elements/gtk-stack-switcher.js';
|
|
35
87
|
export { GtkStringList as StringList } from '@gjsify/adwaita-core';
|
|
36
88
|
export { GtkSwitch as Switch } from '../elements/gtk-switch.js';
|
|
89
|
+
export { GtkText as Text } from '../elements/gtk-text.js';
|
|
90
|
+
export { GtkTextView as TextView } from '../elements/gtk-text-view.js';
|
|
91
|
+
export { GtkToggleButton as ToggleButton } from '../elements/gtk-toggle-button.js';
|
|
92
|
+
export { GtkTreeExpander as TreeExpander } from '../elements/gtk-tree-expander.js';
|
|
93
|
+
export { GtkVideo as Video } from '../elements/gtk-video.js';
|
|
94
|
+
export { GtkWindow as Window } from '../elements/gtk-window.js';
|
|
95
|
+
export { GtkWindowControls as WindowControls } from '../elements/gtk-window-controls.js';
|
|
96
|
+
export { GtkViewport as Viewport } from '../elements/gtk-viewport.js';
|
|
97
|
+
export { GtkWindowHandle as WindowHandle } from '../elements/gtk-window-handle.js';
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// The PORTABLE `Gtk.PageSetup` — the value the two print dialogs read and write.
|
|
2
|
+
//
|
|
3
|
+
// `GtkPageSetup` is a GObject holding a paper size and four margins, and both
|
|
4
|
+
// `GtkPageSetupUnixDialog` and `GtkPrintUnixDialog` carry it as a property. An HTML
|
|
5
|
+
// attribute cannot hold an object, so on this renderer the object is PLAIN DATA and
|
|
6
|
+
// the two widgets expose it as a property (`pageSetup`), which is the shape ADR 0047
|
|
7
|
+
// gave `Gtk.Adjustment` and ADR 0046 gave the list models: a `get`/`set` pair where
|
|
8
|
+
// the setter still performs GTK's derivation instead of storing the value.
|
|
9
|
+
//
|
|
10
|
+
// WHAT IS PORTED, AND WHERE IT COMES FROM
|
|
11
|
+
//
|
|
12
|
+
// · the twelve `common_paper_sizes` — gtkpagesetupunixdialog.c:121-134 — with each
|
|
13
|
+
// one's `PaperInfo` row from gtk/paper_names.c (the `210x297mm` size string and
|
|
14
|
+
// the display name), parsed the way `parse_media_size` (gtkpapersize.c:101-136)
|
|
15
|
+
// parses it, `in` converted at `MM_PER_INCH`;
|
|
16
|
+
// · the DEFAULT MARGINS — `gtk_paper_size_get_default_{top,bottom,left,right}_margin`
|
|
17
|
+
// (gtkpapersize.c:835-900): 0.25in everywhere, and 0.56in at the BOTTOM for
|
|
18
|
+
// `na_letter`, `na_legal` and `iso_a4` alone;
|
|
19
|
+
// · the page `double_to_string` munges its numbers with (gtkpagesetupunixdialog.c:
|
|
20
|
+
// 594-628): two decimals in inch, ONE in mm, and the trailing zeros stripped so a
|
|
21
|
+
// whole number prints without a decimal point at all;
|
|
22
|
+
// · the two label strings `paper_size_changed` composes from them (the `W × H unit`
|
|
23
|
+
// line and the four-line `Margins:` tooltip).
|
|
24
|
+
//
|
|
25
|
+
// WHAT IS NOT, and why: the printer's OWN paper list (`gtk_printer_list_papers`,
|
|
26
|
+
// reached through CUPS/IPP backends), which needs a print backend and therefore a
|
|
27
|
+
// print subsystem. Both dialogs show the twelve COMMON sizes here — which is exactly
|
|
28
|
+
// what GTK does for `printer == NULL` (gtkpagesetupunixdialog.c:474-491) — and the
|
|
29
|
+
// `Manage Custom Sizes…` row opens nothing, as the custom-paper dialog needs the same
|
|
30
|
+
// backends.
|
|
31
|
+
|
|
32
|
+
/** `Gtk.PageOrientation`, in enum order. Reversed orientations are separate values. */
|
|
33
|
+
export const PAGE_ORIENTATIONS = ['portrait', 'landscape', 'reverse-portrait', 'reverse-landscape'] as const;
|
|
34
|
+
|
|
35
|
+
/** One `Gtk.PageOrientation` — the nicks `packages/framework/gtk-host` generates. */
|
|
36
|
+
export type PageOrientation = (typeof PAGE_ORIENTATIONS)[number];
|
|
37
|
+
|
|
38
|
+
/** The `Gtk.Unit` the two dialogs' labels speak: millimetres or inches. */
|
|
39
|
+
export type PageUnit = 'mm' | 'inch';
|
|
40
|
+
|
|
41
|
+
/** One row of GTK's `paper_names` table, in millimetres. */
|
|
42
|
+
export interface PaperSize {
|
|
43
|
+
/** The `GtkPaperSize` name — `iso_a4`, `na_letter`, … */
|
|
44
|
+
readonly name: string;
|
|
45
|
+
/** `gtk_paper_size_get_display_name()` — `A4`, `US Letter`, … */
|
|
46
|
+
readonly displayName: string;
|
|
47
|
+
/** Short edge, mm. */
|
|
48
|
+
readonly width: number;
|
|
49
|
+
/** Long edge, mm. */
|
|
50
|
+
readonly height: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** `MM_PER_INCH` (gtkpapersize.c) — the one conversion `parse_media_size` needs. */
|
|
54
|
+
const MM_PER_INCH = 25.4;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The twelve `common_paper_sizes`, in the order `fill_paper_sizes_from_printer` appends
|
|
58
|
+
* them when there is no printer (gtkpagesetupunixdialog.c:474-491): the list is
|
|
59
|
+
* deliberately NOT sorted, so the order here is the one a reader sees.
|
|
60
|
+
*
|
|
61
|
+
* Sizes and names are the `paper_names.c` rows for those keys; `in` sizes are
|
|
62
|
+
* converted once, at parse time, exactly as `parse_media_size` does.
|
|
63
|
+
*/
|
|
64
|
+
export const COMMON_PAPER_SIZES: readonly PaperSize[] = [
|
|
65
|
+
{ name: 'na_letter', displayName: 'US Letter', width: 8.5 * MM_PER_INCH, height: 11 * MM_PER_INCH },
|
|
66
|
+
{ name: 'na_legal', displayName: 'US Legal', width: 8.5 * MM_PER_INCH, height: 14 * MM_PER_INCH },
|
|
67
|
+
{ name: 'iso_a4', displayName: 'A4', width: 210, height: 297 },
|
|
68
|
+
{ name: 'iso_a5', displayName: 'A5', width: 148, height: 210 },
|
|
69
|
+
{ name: 'roc_16k', displayName: 'ROC 16k', width: 7.75 * MM_PER_INCH, height: 10.75 * MM_PER_INCH },
|
|
70
|
+
{ name: 'iso_b5', displayName: 'B5', width: 176, height: 250 },
|
|
71
|
+
{ name: 'jis_b5', displayName: 'JB5', width: 182, height: 257 },
|
|
72
|
+
{ name: 'na_number-10', displayName: '#10 Envelope', width: 4.125 * MM_PER_INCH, height: 9.5 * MM_PER_INCH },
|
|
73
|
+
{ name: 'iso_dl', displayName: 'DL Envelope', width: 110, height: 220 },
|
|
74
|
+
{ name: 'jpn_chou3', displayName: 'Choukei 3 Envelope', width: 120, height: 235 },
|
|
75
|
+
{ name: 'na_ledger', displayName: 'Tabloid', width: 11 * MM_PER_INCH, height: 17 * MM_PER_INCH },
|
|
76
|
+
{ name: 'iso_a3', displayName: 'A3', width: 297, height: 420 },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
/** The paper sizes whose bottom margin is 0.56in rather than 0.25in. */
|
|
80
|
+
const TALL_BOTTOM_MARGIN = new Set(['na_letter', 'na_legal', 'iso_a4']);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* `double_to_string` (gtkpagesetupunixdialog.c:594-628).
|
|
84
|
+
*
|
|
85
|
+
* The comment above the C is the reason this is not `toFixed`: the author wanted no
|
|
86
|
+
* decimal point at all on a whole number and at most one significant digit otherwise,
|
|
87
|
+
* and `printf` offers no "max precision" — so the code prints two places in inch and
|
|
88
|
+
* one in mm and then strips the zeros and the separator by hand. The stripping is
|
|
89
|
+
* ASCII-only and drops a `0.0` to `0`.
|
|
90
|
+
*/
|
|
91
|
+
export function doubleToString(value: number, unit: PageUnit): string {
|
|
92
|
+
// Two decimals in inch, ONE in mm — the two `g_strdup_printf` formats.
|
|
93
|
+
let text = unit === 'inch' ? value.toFixed(2) : value.toFixed(1);
|
|
94
|
+
// `strstr (val, decimal_point)` — the value HAS a fractional part.
|
|
95
|
+
if (text.includes('.')) {
|
|
96
|
+
// Drop the trailing zeros, then a separator left dangling by them.
|
|
97
|
+
text = text.replace(/0+$/, '');
|
|
98
|
+
if (text.endsWith('.')) text = text.slice(0, -1);
|
|
99
|
+
}
|
|
100
|
+
return text;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The four margins of a `Gtk.PageSetup`, in millimetres. */
|
|
104
|
+
export interface PageMargins {
|
|
105
|
+
readonly top: number;
|
|
106
|
+
readonly bottom: number;
|
|
107
|
+
readonly left: number;
|
|
108
|
+
readonly right: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* `gtk_page_setup_set_paper_size_and_default_margins` (gtkpagesetup.c:248-258) —
|
|
113
|
+
* every margin `gtk_paper_size_get_default_*_margin` returns, for one paper size.
|
|
114
|
+
*/
|
|
115
|
+
export function defaultMargins(size: PaperSize): PageMargins {
|
|
116
|
+
return {
|
|
117
|
+
top: 0.25 * MM_PER_INCH,
|
|
118
|
+
bottom: (TALL_BOTTOM_MARGIN.has(size.name) ? 0.56 : 0.25) * MM_PER_INCH,
|
|
119
|
+
left: 0.25 * MM_PER_INCH,
|
|
120
|
+
right: 0.25 * MM_PER_INCH,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** A plain-data `Gtk.PageSetup`: which paper, which way up, and the four margins. */
|
|
125
|
+
export interface PageSetup {
|
|
126
|
+
/** The `GtkPaperSize` name. */
|
|
127
|
+
readonly paperSize: string;
|
|
128
|
+
/** `GtkPageOrientation`. */
|
|
129
|
+
readonly orientation: PageOrientation;
|
|
130
|
+
/** Margins in millimetres, which is what `GtkPageSetup` stores internally. */
|
|
131
|
+
readonly margins: PageMargins;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* `gtk_page_setup_new()` — the default setup GTK hands a dialog that has been given
|
|
136
|
+
* none: ISO A4, portrait, the default margins for it.
|
|
137
|
+
*/
|
|
138
|
+
export function defaultPageSetup(): PageSetup {
|
|
139
|
+
const size = COMMON_PAPER_SIZES.find((candidate) => candidate.name === 'iso_a4')!;
|
|
140
|
+
return { paperSize: size.name, orientation: 'portrait', margins: defaultMargins(size) };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* `gtk_paper_size_new (name)` + the margins, for one of the twelve common sizes, or
|
|
145
|
+
* `null` for a name the table does not have — which is what `set_paper_size` sees
|
|
146
|
+
* when no row matches (it returns FALSE rather than inventing one).
|
|
147
|
+
*/
|
|
148
|
+
export function paperSizeByName(name: string): PaperSize | null {
|
|
149
|
+
return COMMON_PAPER_SIZES.find((candidate) => candidate.name === name) ?? null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** The paper size a setup names, or the default one when the name is unknown. */
|
|
153
|
+
export function paperSizeOf(setup: PageSetup): PaperSize {
|
|
154
|
+
return paperSizeByName(setup.paperSize) ?? COMMON_PAPER_SIZES[2]!;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* `page_setup_is_equal` (gtkpagesetupunixdialog.c:410-418): same paper AND the same
|
|
159
|
+
* four margins. `page_setup_is_same_size` is the first half of it, which
|
|
160
|
+
* `set_paper_size` asks for when a new printer brings its own sizes along.
|
|
161
|
+
*/
|
|
162
|
+
export function pageSetupEquals(a: PageSetup, b: PageSetup): boolean {
|
|
163
|
+
return (
|
|
164
|
+
a.paperSize === b.paperSize &&
|
|
165
|
+
a.margins.top === b.margins.top &&
|
|
166
|
+
a.margins.bottom === b.margins.bottom &&
|
|
167
|
+
a.margins.left === b.margins.left &&
|
|
168
|
+
a.margins.right === b.margins.right
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** `page_setup_is_same_size` — the paper alone, margins ignored. */
|
|
173
|
+
export function pageSetupSameSize(a: PageSetup, b: PageSetup): boolean {
|
|
174
|
+
return a.paperSize === b.paperSize;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The width and height a `GtkPageSetup` reports for an orientation: landscape and
|
|
179
|
+
* reverse-landscape SWAP the two edges, which is the whole of
|
|
180
|
+
* `gtk_page_setup_get_orientation`-aware geometry in GTK (there is no separate
|
|
181
|
+
* landscape size).
|
|
182
|
+
*/
|
|
183
|
+
export function orientedSize(setup: PageSetup, unit: PageUnit = 'mm'): { width: number; height: number } {
|
|
184
|
+
const size = paperSizeOf(setup);
|
|
185
|
+
const landscape = setup.orientation === 'landscape' || setup.orientation === 'reverse-landscape';
|
|
186
|
+
const width = landscape ? size.height : size.width;
|
|
187
|
+
const height = landscape ? size.width : size.height;
|
|
188
|
+
if (unit === 'mm') return { width, height };
|
|
189
|
+
return { width: width / MM_PER_INCH, height: height / MM_PER_INCH };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** The `unit_str` of `paper_size_changed`: `_("mm")` or `_("inch")`. */
|
|
193
|
+
export function unitLabel(unit: PageUnit): string {
|
|
194
|
+
return unit === 'mm' ? 'mm' : 'inch';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The label under the paper-size combo: `W × H unit`, both numbers through
|
|
199
|
+
* {@link doubleToString} and in the dialog's user unit.
|
|
200
|
+
*/
|
|
201
|
+
export function paperSizeLabel(setup: PageSetup, unit: PageUnit = 'mm'): string {
|
|
202
|
+
const { width, height } = orientedSize(setup, unit);
|
|
203
|
+
return `${doubleToString(width, unit)} × ${doubleToString(height, unit)} ${unitLabel(unit)}`;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The tooltip `paper_size_changed` puts on the same label — the margins alone, in its
|
|
208
|
+
* order: left, right, top, bottom. The sizes live in the label text, not here.
|
|
209
|
+
*/
|
|
210
|
+
export function paperMarginsTooltip(setup: PageSetup, unit: PageUnit = 'mm'): string {
|
|
211
|
+
// A `GtkPageSetup` stores its margins in mm whatever the display unit is.
|
|
212
|
+
const inUnit = (value: number) => (unit === 'mm' ? value : value / MM_PER_INCH);
|
|
213
|
+
const shown = (value: number) => `${doubleToString(inUnit(value), unit)} ${unitLabel(unit)}`;
|
|
214
|
+
const { margins } = setup;
|
|
215
|
+
return [
|
|
216
|
+
'Margins:',
|
|
217
|
+
` Left: ${shown(margins.left)}`,
|
|
218
|
+
` Right: ${shown(margins.right)}`,
|
|
219
|
+
` Top: ${shown(margins.top)}`,
|
|
220
|
+
` Bottom: ${shown(margins.bottom)}`,
|
|
221
|
+
].join('\n');
|
|
222
|
+
}
|
package/src/scroll-shading.ts
CHANGED
|
@@ -95,6 +95,20 @@ export interface AdwUndershootEdges {
|
|
|
95
95
|
bottom: boolean;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* What a caller can ask to hear about, which is `GtkScrolledWindow::edge-overshot`'s own
|
|
100
|
+
* argument: the SIGNED distance past the edge, negative at the near one and positive at the
|
|
101
|
+
* far one, and `0` when the position is back inside the range.
|
|
102
|
+
*
|
|
103
|
+
* The alternative is a second copy of the overshoot accumulation in the caller, which is
|
|
104
|
+
* the duplication this module exists to prevent — the unclamped position is a value only
|
|
105
|
+
* the wheel bookkeeping here has.
|
|
106
|
+
*/
|
|
107
|
+
export interface AdwScrollShadingOptions {
|
|
108
|
+
/** Called whenever a wheel pushes a scroller's position past one of its edges. */
|
|
109
|
+
onOvershoot?: (distance: number) => void;
|
|
110
|
+
}
|
|
111
|
+
|
|
98
112
|
/**
|
|
99
113
|
* Keeps every scroller under a root marked with its live edge indicators.
|
|
100
114
|
*
|
|
@@ -114,9 +128,11 @@ export class AdwScrollShading {
|
|
|
114
128
|
private _shaded = new Set<HTMLElement>();
|
|
115
129
|
private _pendingScan = 0;
|
|
116
130
|
private _undershootEdges: AdwUndershootEdges = { top: true, bottom: true };
|
|
131
|
+
private _onOvershoot: ((distance: number) => void) | null;
|
|
117
132
|
|
|
118
|
-
constructor(root: HTMLElement) {
|
|
133
|
+
constructor(root: HTMLElement, options: AdwScrollShadingOptions = {}) {
|
|
119
134
|
this._root = root;
|
|
135
|
+
this._onOvershoot = options.onOvershoot ?? null;
|
|
120
136
|
}
|
|
121
137
|
|
|
122
138
|
/**
|
|
@@ -242,6 +258,7 @@ export class AdwScrollShading {
|
|
|
242
258
|
el.classList.toggle('overshoot-bottom', distance > 0);
|
|
243
259
|
if (distance === 0) el.style.removeProperty(OVERSHOOT_PROPERTY);
|
|
244
260
|
else el.style.setProperty(OVERSHOOT_PROPERTY, `${Math.abs(distance)}px`);
|
|
261
|
+
this._onOvershoot?.(distance);
|
|
245
262
|
}
|
|
246
263
|
|
|
247
264
|
/** The nearest shaded scroller at or above a wheel target, root included. */
|