The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Ranran(retired) on May 04, 2021, 06:42:50 AM

Title: Sort order switching button
Post by: Ranran(retired) on May 04, 2021, 06:42:50 AM
In extended, we used the up and down arrows on the scroll bar to substitute asc and desc buttons for sorting.
However, this was not the original purpose of use, and had problems such as small size.
I created a sort button with a new theme that doesn't require a dedicated image.
(https://i.imgur.com/g0raR3v.gif)

The design is quite orthodox. (´ ・ ω ・ `)
More sophisticated design may be possible with image, but I wanted to avoid having all themes prepare them anew.
I think this is also useful in standard. What do you think?

The patch is a function only and does not place buttons on the GUI.
Title: Re: Sort order switching button
Post by: prissi on May 04, 2021, 11:15:31 AM
I would suggest a new theme image with a fallback on the arrow ...

Looking at the dialogues, these are still a mess. Some use comboboxes for sort selectrion, some a button, some has reverse other not. A consistent design would be needed anyhow. So then one can introduce the sort button.
Title: Re: Sort order switching button
Post by: Ranran(retired) on May 05, 2021, 12:10:17 AM
QuoteI would suggest a new theme image with a fallback on the arrow ...
Well, that's what I was concerned about... (´・ω・`)

So I changed the design like this.
(https://i.imgur.com/4DE2Hh6.png)

(https://i.imgur.com/Er2Zoxy.png)

Since it is not an image, themes do not need to prepare a new image for the sort order switching button.
Also, the size of the image is fixed, but this icon changes according to the size of the font (button).

For specifications that require an image, an alternative process is required if the theme does not have an image.
I think this design is good enough to understand and we don't need to prepare an image if don't need the effort to provide something better than that.
So I haven't implemented an image object (pak) to do this.

EDIT:
Fixed patch file indentation in one place
Title: Re: Sort order switching button
Post by: Roboron on May 05, 2021, 10:39:31 AM
Why don't keep the "Ascending" and "Descending" texts? IMO the more clear what a button does the better.

Now talking about hypothetical improvements, while a button is good enough, both the button and the combobox could be combined if we put the sort categories at the top of list and make them buttons that when clicked would sort the list by that category (toggling between ascending/descending when clicking again). Think on Excel tables for example. But this would require much more work, of course. Don't take it as a suggestion. I was only thinking aloud.
Title: Re: Sort order switching button
Post by: Ranran(retired) on May 05, 2021, 10:20:44 PM
QuoteWhy don't keep the "Ascending" and "Descending" texts? IMO the more clear what a button does the better.
I think it is case by case whether the letters are good or the symbols are good. But when it comes to sorting, I don't think many other games and applications use that method.
The symbol presented is common symbols found in a relatively large number of applications. Placing a help tooltip on the button is sufficient for understanding.

For example, imagine replacing all gadgets in the title bar with letters. The meaning is clear, but the title bar is crowded.
And layout issues. The symbol saves a lot of space.

It also eliminates differences between languages.
"Ascending" and "Descending" use so many characters and occupy a lot of width. However, in the case of Japanese and Chinese, both are expressed in just two letters. Therefore, there are meaningless dead space in those languages.
Simutrans's GUI auto-alignment feature sometimes auto-enlarges components and creates a large dead space in the GUI.
If the button has a fixed width, it will always look the same in any language and the designer can easily create the layout he want.

Excel-style tables are something I always keep in mind, but they take a lot of effort to implement. (´・ω・`)
In the olden days Bernd Gabriel seemed to try to implement such a thing in experimental, but it is in great conflict with simutrans's new GUI and can't be used.
Title: Re: Sort order switching button
Post by: Roboron on May 06, 2021, 08:43:01 AM
A tooltip sounds fine 👍
Title: Re: Sort order switching button
Post by: prissi on May 23, 2021, 01:25:16 PM
In in r9798, Thank you. Now I just have to change t\he dialogues ...