cycfi / elements

Elements C++ GUI library
http://cycfi.github.io/elements/
3.15k stars 235 forks source link

Implemented logarithmic slider ticks #367

Closed klytje closed 11 months ago

klytje commented 11 months ago

I implemented a new element slider_marks_log and showcase it in the range_slider example.

I couldn't figure out how to do this correctly while limiting myself to the original <size, num_divs, major_divs> template, so I switched it around (for this element only) to <size, major_divs, minor_divs> instead. For consistency I think either the normal slider_marks element should also be updated with this, or alternatively remove the minor_divs template from this new element and hardcode it to 10. I don't see any reason to use a different number than this anyway.

djowel commented 11 months ago

Cool! I've been thinking about that this morning!

djowel commented 11 months ago

Screenshots please! :-)

klytje commented 11 months ago

Screencast from 12-06-2023 07:47:17 PM.webm

Now that I look at it, I think the example could use a little bit of polish with some titles and sections maybe

djowel commented 11 months ago

The <size, major_divs, minor_divs> API is better.

Here's a suggestion:

  1. Rewrite slider_marks with the updated template params, along with slider_marks_element.
  2. Rename it to slider_marks_lin and slider_marks_lin_element
  3. Write a forwarding template function slider_marks and alias template (or subclass, if alias is not possible) slider_marks_element, both in terms of slider_marks_lin and slider_marks_lin_element.
  4. Mark these as deprecated with a message referring to the new API.
  5. Have the examples use the new API.
djowel commented 11 months ago

@redtide is there a way to swash the commits posthoc via github?

djowel commented 11 months ago

@redtide is there a way to swash the commits posthoc via github?

Ah seems there is: https://bit.ly/3uU2EPP

djowel commented 11 months ago

@redtide is there a way to swash the commits posthoc via github?

Ah seems there is: https://bit.ly/3uU2EPP

Didn't know it was there all along!

image