The International Simutrans Forum

 

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

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1660
  • 今日は兎汁よー
  • 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: 1590
  • 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: 10905
  • 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: 314
  • 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: 10905
  • 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: 314
  • 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

Offline Ranran

  • Devotee
  • *
  • Posts: 1660
  • 今日は兎汁よー
  • Languages: ja
Re: Vertically center the image position of the tab header
« Reply #6 on: August 07, 2021, 05:43:53 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10905
  • Languages: De,EN,JP
Re: Vertically center the image position of the tab header
« Reply #7 on: August 08, 2021, 12:02:38 PM »
IN with r9991, thanks.