GtkScale / GtkRange "inverted" property use case


I am trying to understand, what is the real use case for a 'GtkScale' widget, having the 'inverted' range property set ?

inverted=false: ( 'default' value, looks normal and useful )


inverted=true: ( ?? )


The bottom one is quite confusing as a widget, and I was wondering if there are valid use cases for this.


Interfaces which are laid out RTL seem like a valid use case for this.

AFAIK, RTL “direction switch” should happen automatically for relevant widgets, and shouldn’t need a property for that.

Infact, doing an RTL switch will produce the same visual effect of “LTR GtkScale with inverted=true” , but will still have 'inverted' flag set as FALSE ( default ), since as far as the GtkScale widget is concerned, RTL just means to switch directions, and doesn’t mean to set 'inverted' flag.


Well, then I can’t think of a use case for it. But I also can’t think of a reason why that property existing would bother anyone so I think I just don’t have a very good imagination.

Removing a single property is unlikely to provide any real benefit but you can always submit a merge request and see what happens. It’s used in gtk*-widget-factory so that will need to be updated also.

The “inverted” property was added to GTK2, 20 years ago; sadly, there’s not much information as to why it was added. Additionally, the property is on GtkRange, which has been the base class for scales and scroll bars, and other range-based widgets.

One use case is to show some missing quantity; e.g. you want to show the progress over a range, and the missing part is highlighted.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.