Skip to content

Form sections hold their children (win32, UIKit); win32 paints gradients, orders zstacks, keeps a tooltipped widget's text - #175

Open
nicolas-maman wants to merge 2 commits into
mainfrom
fix/form-section-inner
Open

nicolas-maman wants to merge 2 commits into
mainfrom
fix/form-section-inner

Conversation

@nicolas-maman

Copy link
Copy Markdown
Contributor

The styled example on Windows showed its title and its buttons and nothing between. Five defects behind that, all fixed and verified on screen.

  1. section()'s children went into the title label (win32 and UIKit). The DSL returns handle + 1 as the box children go into — the inner container GTK4 and AppKit register right after the frame. These two backends registered the title there, so every field and toggle of a section was parented to a label. The inner box is registered first now (then the title, which is still shown first).
  2. win32 did not treat forms, sections and navstacks as stacks. They are create_stack windows with a kind of their own, and every "is this a stack" test in the layout listed the three plain kinds: a form measured as 0×0 (its parent read the window's current size), requested no layout and did not show. One predicate, w32_is_stack, at every site; measure_subtree goes by orientation rather than kind.
  3. style_bg_gradient was stored and never painted on win32. The container's erase paints it (GradientFill), and a label, spacer or rule inside paints the slice of the gradient under itself (w32_erase_ground; WM_CTLCOLOR answers with a hollow brush after painting the slice), so a caption on a gradient header is text over the header rather than a box of one colour.
  4. win32 zstack: the last child is on top, margins hold, and the ground behind is the panel's. add_child pushes every new child to the bottom of the Z order (right for a row or a column, so enumeration reads in creation order), which in a zstack put the label added after the panel under it, with the two painting over each other in whichever order Windows chose. Children are raised in creation (handle) order and clip their lower siblings; a child's margins inset it (margin_of over a panel, as on GTK4's overlay); w32_ground_owner looks through a zstack's lower siblings so a label over a coloured panel paints the panel's colour behind its text.
  5. style_tooltip wiped the widget's text on win32. set_tooltip freed the text cache, so every button with a tooltip reported "" to the driver and to the a11y name fallback.

Verified natively: runtime test; 76 headless driver specs (the three that fail on this box are the GL-less gpuview_demo and the AETHER_UI_CHROME/AETHER_UI_TOOLTIP env-gated tumbling_cube/vg_tooltip, as before); 14 on-screen specs; captures of the styled example and a gradient/zstack probe.

…nts, orders zstacks, keeps a tooltipped widget's text

The styled example showed its title and its buttons and nothing between
on Windows. Five defects, all fixed:

- section()'s children went into the title label: the DSL returns
  handle + 1 as the inner box, and win32 and UIKit registered the title
  there. The inner box is registered first now.
- A form, a section and a navstack are stacks (create_stack) with a kind
  of their own, and every "is this a stack" test in the win32 layout
  named the three plain kinds: a form measured as 0x0 and requested no
  layout. w32_is_stack at every site; measure_subtree by orientation.
- style_bg_gradient was stored and never painted. GradientFill in the
  container's erase; a label, spacer or rule inside paints the slice of
  the gradient under itself (w32_erase_ground; WM_CTLCOLOR with a hollow
  brush).
- A zstack's later child was UNDER the earlier one (add_child pushes new
  children to the bottom of the Z order for enumeration in creation
  order) and margins were ignored. Children are raised in creation
  order, clip their lower siblings, and keep their margins; the ground
  behind a label over a panel is the panel's.
- set_tooltip freed the widget's text cache: a button with a tooltip
  reported "" to the driver.

Verified natively: runtime test; 76 headless specs (the three that fail
are the GL-less and env-gated runs); 14 on-screen specs; captures of the
styled example and a gradient/zstack probe.
A single read at a fixed 120ms raced the first layout on a loaded CI
runner (GTK4 under Xvfb printed 'left panel width = 0'), and 0 is not a
measurement of anything. Polled every 40ms until the pane has a width,
with a ceiling so an app that never lays out still reports and quits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant