Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Convoi images list on depot dialog is too small

Started by Roboron, August 26, 2022, 03:53:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


The convoi images list for pak128.german ships depot is so small by default that a player mistakenly reported that the game has no ships. I've tried to increase the default height of the list in the code but I had no luck.


Additionally, when you first open the depot dialog, if you don't resize the dialog but scroll the list, only the first row is actually shown.



Giving this a second try, I found the source of the bug. The issue is that the gui_scrollpane component does not care about min_size height of inside component, it will always default to min size of scrollbar.

Solution was of course to tell gui_scrollpane to use the min_size height the same way it is using the width ( limiting the height so the dialogs are not oversized).

Furthermore, I wanted the vehicle list to only show the necessary height it needs for displaying a row (in min_size), not more. For this I needed a new min_size, which I called min_scroll_size, which tells gui_scrollpane what the minimum scrolling size of the inside component is. When this min_scroll_size is defined, gui_scrollpane will use that for its own size, otherwise it will fallback to min_size.

The second bug mentioned I also found a way to fix it, which is not the same that saying that I know what causes it. I just noticed that replacing set_windowsize by resize in depot_frame constructor workaround the bug, but is probably not the correct solution.

See the comparison now / before (showing that minimum height of lists have changed too, but that can be reverted. I just found the previous default too comically small).


thanks, in r10788.

The size variable in was (0,0). Setting to minimum window size was enough.
Parsley, sage, rosemary, and maggikraut.