Skip to content

fix(ui): absolute-positioned elements don't reflow on window resize #24

Description

@ac999

Problem

When the window is resized larger than the design size (1144×729), only elements using width: parent.width reflow correctly (title text, subtitle, logo, exit button). The absolute-positioned elements stay anchored to their original pixel coordinates and go off the visible area or fail to centre:

  • Section 1 card + number badge (x: 279px, y: 262px hardcoded in SectionElement)
  • Section 2 card + number badge (x: 279px, y: 437px hardcoded)
  • Create Room button (x relative to snd.x + snd.width)
  • Join Room button (same)

Root cause

The layout in rust/src/ui.slint uses absolute x/y pixel coordinates throughout SectionElement, CodeRectangle, DataRectangle, and the room action buttons on Screen 0. These were designed for a fixed 1144×729 canvas.

Fix

Convert Screen 0 content from absolute coordinates to Slint layout elements (VerticalLayout / HorizontalLayout / GridLayout), similar to how Screen 2 is already structured. The outer VerticalLayout should drive vertical spacing; the code sections and action buttons should be placed in HorizontalLayouts with alignment: center.

Affected file

rust/src/ui.slint — Screen 0 content block (~line 560–680)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions