stylesheet icon indicating copy to clipboard operation
stylesheet copied to clipboard

Gtk.Scale value wraps into two lines

Open dar5hak opened this issue 4 years ago • 3 comments

What Happened

If the current value text of a GTK Scale exceeds a certain width, then the text wraps into two lines. Observe the value for Fingers:

Screenshot from 2021-08-01 17-01-26

For narrower text values like “31 min,” this does not occur.

I can work around this by doing this:

scale value {
    min-width: 40px;
}

But that’s a hack and probably a bad idea for internationalization.

Expected Behavior

Text should not wrap.

Steps to Reproduce

  1. git clone [email protected]:elfenware/badger.git
  2. Build it with meson using the instructions in the readme.

Logs

Visual bug.

Platform Information

Odin beta, with Badger compiled from the main branch. Display is 1366×768.

dar5hak avatar Aug 01 '21 13:08 dar5hak

Update: I have pushed the workaround mentioned above, so if you clone Badger, make sure you comment this line.

dar5hak avatar Aug 03 '21 17:08 dar5hak

I had the same issue in a personal project, and found another workaround: using Unicode no-break spaces (U+00A0) instead of normal spaces to format the value, e.g. (Rust string format syntax): "31\u{00a0}min" instead of "31 min".

dajoha avatar Aug 11 '21 09:08 dajoha

@yolenoyer Whoa, that's a great idea, and much cleaner than messing with CSS. I'll give it a shot. Thanks!

dar5hak avatar Aug 11 '21 09:08 dar5hak