racket / gui

Other
64 stars 77 forks source link

Linux sliders are upside down #314

Open kengruven opened 1 year ago

kengruven commented 1 year ago

On Linux, a vertical slider% has the lowest value at the top, and the highest value at the bottom, and it visualy 'fills' the slider from the top down. It gets this behavior from GTK's default.

This is backwards from how sliders work on macOS, Qt, Java, Firefox, Chrome, Safari, Edge, light switches on walls, lighting consoles, audio consoles, and every other vertical slider I've encountered. GTK is just weird here. Nobody pushes a slider up and expects a lower volume or less light.

Normally, I'm in favor of cross-platform toolkits following the local conventions, but in this case I don't see any rationale for GTK being the odd one out, and also I haven't found a single GTK application (even among the GTK demos) with a vertical slider, so I don't think there's any real convention to be beholden to. The racket/gui documentation doesn't say which orientation you get, so we wouldn't be breaking any promises to change it.

As with most toolkits, GTK does provide a property to flip the slider vertically (though their own documentation on it is self-contradictory!), but AFAICT it's not exposed by racket/gui so programmers can't use it.

I propose that slider% on GTK set the "inverted" property on vertical sliders so the highest value is on top, as it is everywhere else in the world. My second choice would be to expose such a property in racket/gui's slider% so that applications can choose either "platform native" or "cross-platform consistent".

sorawee commented 4 months ago

@mflatt is this fixed? Can it be closed?