Dialogs
Two of these are windows you show and two are surfaces you pop up from a widget,
and GTK treats the two kinds quite differently: the first is a GtkDialog with an action
area, the second a GtkPopover with a search entry. libadwaita restyles all four in one
place — a flat titlebar, a framed paper in the print preview — and adds nothing else.
About Dialog
Section titled “About Dialog”GTK’s own about window, and not the libadwaita one: a GtkWindow whose headerbar
holds a GtkStackSwitcher — no title text at all — over four pages. The main page is a
dialog-size logo over the program name in bold, then version, comments, website,
copyright and licence as centred labels. The other three pages exist only when they have
content, and each has its own rule: License only for a license-type of custom
and a licence string, System for any non-empty text, Credits for any credit
list, any extra addCreditSection or a translator-credits that is not the untranslated
gettext sentinel. A dialog with none of the three shows an empty headerbar, which is what
GTK shows.
Setting a license-type other than custom does something worth knowing: it overwrites
license with the standard warranty preamble, links it to that licence’s URL, and turns
wrap-license on.
Emoji Chooser
Section titled “Emoji Chooser”The popover a text widget opens to insert an emoji, and the whole of it is search: a term matches when it is a prefix of a word in the emoji’s name or in one of its keywords, a section with no match at all disappears heading included, and a search that empties every section shows the No Results Found page instead of the list. The toolbar below the list does two jobs — its buttons jump to a section, and the checked one follows the scroll position — which is why Ctrl+N and Ctrl+P move by section rather than by pixel, and why Enter picks the first result.
Picking one emits emoji-picked with the Unicode sequence (what an entry inserts, not what a label shows) and records it in Recents, capped at 21 with no duplicates. Holding Ctrl keeps the popover open so a second one can be added; a second click on an emoji with skin tones opens its variants.
Page Setup Dialog
Section titled “Page Setup Dialog”The page setup dialog Unix platforms have instead of a native one: two drop downs, one
label and four buttons. The label is the interesting part — it reports the chosen sheet as
W × H unit and puts the four margins in its tooltip, and the numbers go through GTK’s
own double_to_string, which prints two decimals in inch, one in millimetres and then
strips the zeros, so a whole millimetre comes out with no decimal point at all.
The four orientation buttons are one radio group, and set_page_setup writes them. A setup
whose margins match no row in the list is appended rather than dropped, because that is
what the C does when add_item is set — which is the same call this dialog always makes.
Print Dialog
Section titled “Print Dialog”Seven notebook pages over a printer list, and the capabilities are what make it a dialog
rather than a form. manual-capabilities is the half of the mask the application can
handle, and every control on the first two pages reads it: copies, reverse, scale, the
two-sided sheet picker, and whether Preview appears at all — visible, not merely
enabled. Collate needs the collate capability and a copies count above one, because
collating one copy is nothing.
Three properties only decide what the dialog lets a user reach: current-page (without a page, Current Page is insensitive), support-selection (without it, Selection is not shown) and has-selection (with support but nothing to print, it is insensitive). And the one control that explains itself: the two page thumbnails under Copies change their numbers with Collate and Reverse, and the second column appears only above one copy.