fix(qt): blend the industrial rows in and decline unbounded ranges - #52
Open
Leonhardmaster2 wants to merge 1 commit into
Open
fix(qt): blend the industrial rows in and decline unbounded ranges#52Leonhardmaster2 wants to merge 1 commit into
Leonhardmaster2 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_secondarylike you suggested. Still derived rather than hardcoded so it follows the palette.Tested on Qt 6.10.3 / MSVC 2022.