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

GuidedValueSlider: Rework to fix margin issues and other things #12183

Merged
merged 3 commits into from
Dec 14, 2024

Conversation

DonLakeFlyer
Copy link
Contributor

@DonLakeFlyer DonLakeFlyer commented Dec 9, 2024

Replacement for #12165

While looking at #12165 I discovered other issues and also wanted to rework it so that the code was clearer. So this pull is based on that pull with some additional changes.

Changes:

  • The slider is now parented right up to the top/bottom/right edges of window. Previously there was a small margin around it. This could cause problems where you would mistakenly zoom the map when you really wanted to scroll the slider if you were off the edge.
  • Mouse events were bleeding through to the map below. So if you happens to scroll over the slider left/right using a track pad the map would zoom below it. There is not a dead mouse area below the control to prevent mouse events from bleeding through controls below it.
  • There were various problems with the margins between the ticks and both negative and large positive values. Sometimes the values would overlap with the major ticks. To fix this the margins have been reworked so that there should always be room for a max of three digits (with/without negative)without bumping into the ticks.
  • The indicator was not drawing correctly in that the border was not equally sized around the indicator.
  • Since the margins are now larger I made the tick marks slightly smaller so that the overall width of the control didn't grow.
  • Reworked a number of property names/usage to make the code easier to understand.

@DonLakeFlyer
Copy link
Contributor Author

@DieBorr Can you review this as well as run it to make sure it works correctly on you system as well?

@HTRamsey
Copy link
Collaborator

HTRamsey commented Dec 9, 2024

This might just be me but it would be kinda nice to be able to quickly see Max/Min values which were easier to tell on the older slider since you could see how far up the slider you were.

@DieBorr
Copy link
Contributor

DieBorr commented Dec 9, 2024

Hi @DonLakeFlyer,

I’ve checked your rework, and while the logic of the object is still a bit complicated, it’s definitely easier to read now. However, I did notice an issue that was the main reason why I initially made the slider width bigger. Here’s a screenshot:

image

As you can see, on a monitor that’s not very big (26/27"), there’s some visible overlap. Also, the white rectangle of the vertical flickable feels a bit too close to the tick numbers. Since this widget is pretty important, I think adding a bit more width wouldn’t be a big problem. You can take my fix where I just take the rectangle near to the slider but not inside.

From my point of view, the workaround in #12165 about dynamically changing the slider width feels less user-friendly, I mean, the workaround itself is nice, but I found it too noticeable. Here’s a video to show what I mean:

simplescreenrecorder-2024-12-09_23.48.49.mp4

I find this width change too rough because it moves the widgets next to it in a aggressive way, with ft as metric system I find it smother, this should be a minor fix and is just a different point of view I think that @HTRamsey can give his opinion.

This are just little tweaks around the slider, spending time coding the base of the slider and not being able to leave it as refined as possible would be a shame.
Thank you both for your time.

@DonLakeFlyer
Copy link
Contributor Author

Hmm, strange. I tested out to "-100" and don't see the overlap. Not sure why I see different things. Let me look again.

Also, the white rectangle of the vertical flickable feels a bit too close to the tick numbers

Agree, I'll take a look at that as well.

@DonLakeFlyer
Copy link
Contributor Author

DonLakeFlyer commented Dec 14, 2024

@DieBorr I'm hoping my last change will fix the spacing between tick marks and values. Can you try it again?

@DieBorr
Copy link
Contributor

DieBorr commented Dec 14, 2024

@DieBorr I'm hoping my last change will fix the spacing between tick marks and values. Can you try it again?

Yes! Will try in this day as soon as I can

@DieBorr
Copy link
Contributor

DieBorr commented Dec 14, 2024

Congrats @DonLakeFlyer, it's a very clever solution. I have tested it with different UI scale values and also different font scale factors of the OS (ubuntu 22.04), and now it works perfectly fine. Thanks for the time you spent on it.

I'm planning to add a new feature to the slider. It consists of having a popup appear if the user holds the text value label for a specific time, allowing the user to select a specific value. Do you think this makes sense, or would it not be useful?

@DonLakeFlyer
Copy link
Contributor Author

now it works

Quite a twisted bit of spacing/margin logic to get right. Kind of makes my head hurt to think about it.

Do you think this makes sense, or would it not be useful?

Yeah, I think that would be super nice.

@DonLakeFlyer DonLakeFlyer merged commit 9ac1136 into master Dec 14, 2024
8 checks passed
@DonLakeFlyer DonLakeFlyer deleted the GuidedValueSlider branch December 14, 2024 21:10
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.

3 participants