help: the search block's (i) on its header, a 12 px mark, and a real search page
This commit is contained in:
1 parent
d549223889
commit
fe499bfe41
10 files changed
+178
-53
No files matched your search
+16
-8
@@ -71,16 +71,24 @@ void install_css() {
|
||||
" border-radius: 12px; padding: 12px; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45); }\n"
|
||||
// The contextual-help "(i)": a *mark*, not a button. Adwaita's menu button is a 34x34 control
|
||||
// (a 24 px floor plus 5 px of padding) with a 16 px glyph, which beside a heading reads as a
|
||||
// second toolbar button -- the size the ask calls too big. Measured on libadwaita 1.10: the
|
||||
// outer `menubutton` node *and* its `button` subnode both carry a floor and padding, and a class
|
||||
// selector on either alone leaves the other at 34 (`min-width` on the widget itself is ignored
|
||||
// by `GtkMenuButton`'s measure, and so is a size request -- tried both). Zeroing all three --
|
||||
// the outer node, the subnode and its glyph -- is what brings it to **16x16**: the icon's own
|
||||
// size and nothing else, because a `min-width` is a floor, not a cap, so 16 px is where a 16 px
|
||||
// Adwaita glyph stops. That is the reading `hint=WxH` in the dump prints.
|
||||
// second toolbar button. Measured on libadwaita 1.10: the outer `menubutton` node *and* its
|
||||
// `button` subnode both carry a floor and padding, and a class selector on either alone leaves
|
||||
// the other at 34 (`min-width` on the widget itself is ignored by `GtkMenuButton`'s measure, and
|
||||
// so is a size request -- tried both). Beyond those two there is a third node, and getting its
|
||||
// path wrong is silent: the button's own tree is `menubutton > button > box > image` (read off
|
||||
// the CSS node dump), so the direct-grandchild form `> button > image` matches *nothing* and
|
||||
// leaves the glyph at its natural 16 px -- which is the 16x16 the first version shipped and
|
||||
// mistook for a floor. The glyph is reached through the `box`; trimming the outer node, the
|
||||
// `button` subnode and the glyph together, and asking the glyph for 12 px with
|
||||
// `-gtk-icon-size` (which `GtkImage` honours when it is `GTK_ICON_SIZE_INHERIT`, and which
|
||||
// *scales* the drawing rather than merely clamping its box), is what brings the mark to
|
||||
// **12x12**. There is no lower floor to find: the symbolic glyph renders at any request
|
||||
// (measured down to 4 px), so 12 px is a legibility choice, and it is the size the rule always
|
||||
// meant -- the first version already wrote 12 px, on a selector that never matched. That is
|
||||
// the reading `hint=WxH` in the dump prints.
|
||||
"menubutton.udpscope-hint { min-width: 0; min-height: 0; padding: 0; margin: 0; }\n"
|
||||
"menubutton.udpscope-hint > button { min-width: 0; min-height: 0; padding: 0; }\n"
|
||||
"menubutton.udpscope-hint > button > image { min-width: 12px; min-height: 12px;"
|
||||
"menubutton.udpscope-hint > button > box > image { min-width: 12px; min-height: 12px;"
|
||||
" -gtk-icon-size: 12px; }\n";
|
||||
GtkCssProvider* p = gtk_css_provider_new();
|
||||
gtk_css_provider_load_from_string(p, kCss);
|
||||
|
||||
Reference in new issue
Block a user