The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: shingoushori on September 14, 2019, 12:24:25 PM

Title: Refactoring of Display settings dialog class
Post by: shingoushori on September 14, 2019, 12:24:25 PM
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.
Title: Re: Refactoring of Display settings dialog class
Post by: Dwachs on September 15, 2019, 11:27:32 AM
Good idea!

My only complaint is style: in the source code, such constants are uppercase. Please use something like IDBTN_SCROLL_INVERSE.
Title: Re: Refactoring of Display settings dialog class
Post by: shingoushori on September 16, 2019, 08:14:58 AM
thanks for response!
My 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.
Title: Re: Refactoring of Display settings dialog class
Post by: 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.
Title: Re: Refactoring of Display settings dialog class
Post by: Yona-TYT on October 02, 2019, 11:50:19 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
Title: Re: Refactoring of Display settings dialog class
Post by: prissi on October 15, 2019, 12:20:14 AM
Well, please try again the latest nightly above r8845.
Title: Re: Refactoring of Display settings dialog class
Post by: Yona-TYT on October 15, 2019, 01:31:29 AM
Well, 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.
(https://www.mediafire.com/convkey/c9ba/az841jlp74rjz4a6g.jpg)
Title: Re: Refactoring of Display settings dialog class
Post by: 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
Title: Re: Refactoring of Display settings dialog class
Post by: Yona-TYT on October 15, 2019, 08:21:37 AM
I 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 !.  ;)
Title: Re: Refactoring of Display settings dialog class
Post by: Leartin on October 15, 2019, 11:34:04 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?
Title: Re: Refactoring of Display settings dialog class
Post by: prissi on October 15, 2019, 11:47:45 AM
No, unfourtunately it became even more chaotic sizewise. See my other post.
Title: Re: Refactoring of Display settings dialog class
Post by: prissi on March 08, 2020, 03:29:15 AM
With the curretn fixes to comboboxes and stretchable text, a lot of dialoges should be improved in sizing.