Skip to content

[BUG] Header status label inflates natural width with long status strings #278

@pwsandoval

Description

@pwsandoval

Discovery

I discovered this while testing nmrs-gui under a compositor width rule.

I set a window/layer width rule to 300px (example), but with long header status text, the UI behaved as if it needed much more space (visually close to ~532px natural width pressure), so the width constraint appeared ignored.

To make this explicit, I’m attaching two screenshots:

Test setup example: compositor layer/window width rule = 300.

  1. Before fix: compositor rule is 300px, but header/status natural width inflation makes the surface look much wider than intended.
Image
  1. After fix: with ellipsize + max width chars, the same 300px rule is respected visually, and the layout stays constrained/vertical as expected.
Image

Problem

The header status label can report an inflated natural width when status text is long, which makes compositor width constraints appear ignored.

Expected behavior

Long status text should not expand the header width; it should remain visually constrained.

Proposed fix

In nmrs-gui/src/ui/mod.rs (build_ui), configure the status Label to:

  • align text to start (set_xalign(0.0))
  • ellipsize at end (set_ellipsize(EllipsizeMode::End))
  • limit natural width contribution (set_max_width_chars(36))

Scope

Single-file, atomic change only in nmrs-gui/src/ui/mod.rs.
No changes to:

  • networks.rs
  • wired_devices.rs
  • CSS
  • Stack/homogeneity
  • wrapping / hard size clamps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions