News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Vertically center the image position of the tab header

Started by Ranran, July 05, 2021, 10:56:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

The images in the tab header are currently aligned at the top. This doesn't look good when the font size is large.




This patch modifies it so that it is vertically centered.




In addition, the selected tab will move the selected image and text up 2px in line with the existing specification that the border will move to the top of 2px.
As an example, the 192.comic tab header image keeps the same vertical position regardless of whether it is selected, but this change changes the vertical position, which makes it a little easier to see.

Before:


After:


However, please note that if the font is large, the image created assuming that the tab header height is 10px like this will also be displayed in the vertically center.

Leartin

Nice, but it makes me think:
- Does it make sense to have the text "all" there, rather than another representative image? Why mix text and pictograms? (especially when they all display text on mouseover - seems like a weird design choice)
- The core issue is that some symbols are intended to be used "inline" with text. Most prominently the symbols for pax, mail, goods, but also those "type of vehicle"-indicators, the season-indicator, the "timeline is used"-indicator,... They were all created fitting the original font, so the logical thing would be to scale them based on font size. (Not strictly, more like keep original size for font size up to 10, then 1.5x scale up to font size 15, and 2x scale at larger font sizes. And somehow only if the font is scalable in the first place...)

prissi


Andarix

Is it possible that the tab width can also be adjusted?

pak64.german

prissi

There was also old code assuming fixed sizes in there. In r9932 the tabs will be as large as required.


Ranran

I noticed that merging r9933 made the tab title area cramped. (´・ω・`)


Before merging r9933:


After merging r9933:



(1) The fixed magic number margins 8 of the text style has been replaced by D_H_SPACE. The default for D_H_SPACE is 4, which is half of what it used to be.

(2) For the symbol style, the margin will be 0 to fit the size of the image. It is great if pakse have a symbol like pak.comic192, but it doesn't seem to fit the simutrans popular old style.
The narrow gauge symbol is narrow and the airplane is wide.



The attached patch will fix it so that it does not adversely affect the old waytype symbol. The minimum width of the symbol type is now 28. So if you want to fit the width of the image like pak.comic192, a width of 26 or more is recommended.

prissi