Skip to content

fix(qt): blend the industrial rows in and decline unbounded ranges - #52

Open
Leonhardmaster2 wants to merge 1 commit into
devfrom
fix/industrial-review-followup
Open

fix(qt): blend the industrial rows in and decline unbounded ranges#52
Leonhardmaster2 wants to merge 1 commit into
devfrom
fix/industrial-review-followup

Conversation

@Leonhardmaster2

Copy link
Copy Markdown
Contributor

Follow-up to your review on #47.

Unbounded sliders. can_render() accepted any range where max is bigger than min, and FLT_MAX / INT_MAX both pass that, so the industrial slider took rows it cant actually draw. Every real value sits in the first pixel of the rail and dragging jumps by huge amounts.

Both sliders now decline those so they fall through to stock, which has a proper unbounded mode where the handle sits centered and drags relatively. The sentinel check matches stock's is_range_bounded() exactly instead of picking its own threshold, otherwise a merely huge range gets declined here and still counted as bounded there, which would break it in both.

Doing an industrial unbounded slider properly needs a relative drag handle of its own. Thats a design job rather than a fix so Ive left it for a later pass, the rows work in the meantime.

Blending in. Went with the system font route rather than defaulting to stock, didnt want to throw the design away over it. Attribute keys were letter spaced and fully uppercased in a probed font family, thats gone, they use the app font now. Five row types were each repeating the same two lines so theres one row_label_font() instead.

Section background. Was a 0.30 lift off the window colour which lands around #6B6B6B on a #2B2B2B window. Now 0.15, which comes out at #4B4B4B, same as bg_secondary like you suggested. Still derived rather than hardcoded so it follows the palette.

Tested on Qt 6.10.3 / MSVC 2022.

Follow-up to the review on #47.

Unbounded sliders were broken. can_render() accepted any range where max
exceeds min, which FLT_MAX and INT_MAX both satisfy, so the industrial
slider claimed rows it cannot draw: every real value lands in the first
pixel of the rail and a drag moves the value by astronomical steps.

Both sliders now decline those, so they fall through to stock, whose
SliderFloat has a proper unbounded mode where the handle sits centred and
drags relatively. The sentinel test matches stock's is_range_bounded()
exactly rather than using a threshold of its own, otherwise a merely huge
range would be declined here and still counted as bounded there, breaking
it in both designs instead of neither.

An industrial unbounded slider wants a relative-drag handle of its own.
That is a design job rather than a fix, so it is left for a later pass.

The rows also read as a separate piece of UI sitting next to the rest of
the application. Two causes, both gone:

- attribute keys were letter-spaced and fully uppercased in a probed font
  family. They now use the host application's font at row size, via one
  row_label_font() rather than the same two lines repeated in five row
  types
- the section surface was a 0.30 lift off the window colour, which on a
  #2B2B2B window gives about #6B6B6B and stands out strongly. It is now
  0.15, landing on #4B4B4B, and still derived rather than hardcoded so it
  tracks whatever palette the host runs
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