The International Simutrans Forum

 

Author Topic: Vertically center the image position of the tab header  (Read 367 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1553
  • Languages: ja
Vertically center the image position of the tab header
« 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.




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.

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1578
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Vertically center the image position of the tab header
« Reply #1 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...)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10682
  • Languages: De,EN,JP
Re: Vertically center the image position of the tab header
« Reply #2 on: July 06, 2021, 12:56:01 PM »
Thank you, incorporated in r9931

Offline Andarix

  • *
  • Posts: 279
  • Languages: de
Re: Vertically center the image position of the tab header
« Reply #3 on: July 06, 2021, 01:20:00 PM »
Is it possible that the tab width can also be adjusted?

pak64.german

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10682
  • Languages: De,EN,JP
Re: Vertically center the image position of the tab header
« Reply #4 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.

Offline Andarix

  • *
  • Posts: 279
  • Languages: de
Re: Vertically center the image position of the tab header
« Reply #5 on: July 07, 2021, 02:02:55 PM »
works

thank you