News:

SimuTranslator
Make Simutrans speak your language.

Vertically center the image position of the tab header

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(retired)

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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

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(retired)

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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

prissi