News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Refactoring of Display settings dialog class

Started by shingoushori, September 14, 2019, 12:24:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shingoushori

Hello everyone !
Let me propose the Refactoring of Display settings dialog class.
That is, Introducing enumeration into the button array of Display settings dialog class, for the benefit of easy modification.

Currently, buttons are managed with static id.
Therefore, there may be a conflict ids when merging the simutrans main repository with custom patch maintenance after being rejected by the forum, that's so heartbreaking.

And, this can be minimize size of buttons array.
Currently COLORS_MAX_BUTTONS is 26, This can be 18 with this refactoring. The array memory corresponding to this size difference are unused, I think.

Sorry if I have misunderstood.

Dwachs

Good idea!

My only complaint is style: in the source code, such constants are uppercase. Please use something like IDBTN_SCROLL_INVERSE.
Parsley, sage, rosemary, and maggikraut.

shingoushori

thanks for response!
Quote from: Dwachs on September 15, 2019, 11:27:32 AMMy only complaint is style: in the source code, such constants are uppercase. Please use something like IDBTN_SCROLL_INVERSE.
I tried it, I hope it's done well.

prissi

I think this dialog needs a deeper overhaul with tabs like the other settings. WIth a large theme, its height goes below my screen and there are of course no scrollbars ...

Anyway, in in r8831.

Yona-TYT

Quote from: prissi on October 02, 2019, 03:01:59 AM
I think this dialog needs a deeper overhaul with tabs like the other settings. WIth a large theme, its height goes below my screen and there are of course no scrollbars ...

Anyway, in in r8831.
That would definitely be great, and well imagine my poor resolution of "1024x600", I can not see the settings well even with the standard theme.  :o

prissi

Well, please try again the latest nightly above r8845.

Yona-TYT

#6
Quote from: prissi on October 15, 2019, 12:20:14 AMWell, please try again the latest nightly above r8845.
Wow wow, I really am very happy to see this gra improvement!, Now we who have small screens can play better!.  ;D ;D ;D ;D


One detail: I'm not sure if the window is now rescalable, but if so, it would be a good idea to add a "Auto rescaled" button like the one on the mini map, since as you can see in the image, it is impossible for my rescaling the window, since it is over the limits of my screen.

prissi

I cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846

Yona-TYT

Quote from: prissi on October 15, 2019, 07:34:29 AMI cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846
Thank you very much, this is a great help! .  ;D

I would like to mention (I apologize for not opening a new thread), there are other windows that have the same problem since they are scalable and sometimes you can go beyond the limits of the screen.

The highest priority in my humble opinion are: "Menssage Center", "Scenario Details" and the "Finance" window.

Regards !.  ;)

Leartin

Quote from: prissi on October 15, 2019, 07:34:29 AM
I cannot understand why it is that high. It is much smaller on my screen. Anyhow, adding it was easy. Check 8846
Don't all dialogs now remember their size?

prissi

No, unfourtunately it became even more chaotic sizewise. See my other post.

prissi

With the curretn fixes to comboboxes and stretchable text, a lot of dialoges should be improved in sizing.