Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DolphinQt: Replace MappingButton bold text with graphical indicators. #13283

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jordan-woyak
Copy link
Member

The bold text was ugly and this is more visually similar to the other indicators.

Screencast_20250117_235817.webm

@MayImilae
Copy link
Contributor

MUCH better.

Copy link
Contributor

@Dentomologist Dentomologist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nice thing that I didn't see highlighted in the video is that the indicators will show partial values in the range 0-1; timer(1) demonstrates this well.

On my Windows 11 computer empty QLabels have a width of 6, which ButtonIndicator's sizeHint divides in half to have a width of 3. Draw then subtracts 2 to make room for the borders, meaning the actual indicator is only a single pixel wide and is a bit hard to see. I think having a platform-independent target width and adjusting it for the screen's DPI would be a better approach.

You clamp the input value to at most 1, but negative values will cause the indicator to cover the row of pixels forming the lower border, outside the intended indicator area.

@jordan-woyak
Copy link
Member Author

One nice thing that I didn't see highlighted in the video is that the indicators will show partial values in the range 0-1; timer(1) demonstrates this well.

On my Windows 11 computer empty QLabels have a width of 6, which ButtonIndicator's sizeHint divides in half to have a width of 3. Draw then subtracts 2 to make room for the borders, meaning the actual indicator is only a single pixel wide and is a bit hard to see. I think having a platform-independent target width and adjusting it for the screen's DPI would be a better approach.

You clamp the input value to at most 1, but negative values will cause the indicator to cover the row of pixels forming the lower border, outside the intended indicator area.

Thanks for testing. I've adjusted the size calculation and fixed the clamping math.
Here it is on Windows now:
image

Copy link
Contributor

@Dentomologist Dentomologist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM.

Copy link
Member

@dreamsyntax dreamsyntax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested new draw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants