The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: RESTRICTED ACCOUNT on July 05, 2021, 10:56:19 AM

Title: Vertically center the image position of the tab header
Post by: RESTRICTED ACCOUNT on July 05, 2021, 10:56:19 AM
The images in the tab header are currently aligned at the top. This doesn't look good when the font size is large.

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


This patch modifies it so that it is vertically centered.

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


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:
(https://i.imgur.com/aLGiBK8.png)

After:
(https://i.imgur.com/3BMDyEY.png)

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.
Title: Re: Vertically center the image position of the tab header
Post by: Leartin on July 05, 2021, 12:02:03 PM
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...)
Title: Re: Vertically center the image position of the tab header
Post by: prissi on July 06, 2021, 12:56:01 PM
Thank you, incorporated in r9931
Title: Re: Vertically center the image position of the tab header
Post by: Andarix on July 06, 2021, 01:20:00 PM
Is it possible that the tab width can also be adjusted?

pak64.german
(https://forum.simutrans.com/index.php?action=dlattach;topic=20999.0;attach=29688;image)
Title: Re: Vertically center the image position of the tab header
Post by: prissi on July 07, 2021, 12:40:56 PM
There was also old code assuming fixed sizes in there. In r9932 the tabs will be as large as required.
Title: Re: Vertically center the image position of the tab header
Post by: Andarix on July 07, 2021, 02:02:55 PM
works

thank you
Title: Re: Vertically center the image position of the tab header
Post by: RESTRICTED ACCOUNT on August 07, 2021, 05:43:53 PM
I noticed that merging r9933 made the tab title area cramped. (´・ω・`)


Before merging r9933:
(https://i.imgur.com/GxfoP9D.png)

After merging r9933:
(https://i.imgur.com/BquGV1G.png)


(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.
Title: Re: Vertically center the image position of the tab header
Post by: prissi on August 08, 2021, 12:02:38 PM
IN with r9991, thanks.