The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Ranran(retired) on September 20, 2020, 12:23:43 PM

Title: scrolled list issue
Post by: Ranran(retired) on September 20, 2020, 12:23:43 PM
After incorporating the new GUI engine, I noticed that the scroll list had larger line spacing and that clicks may not respond.

I noticed that there is a display mode for GUI debugging, so I used it.

(https://i.imgur.com/l99ZNms.png)

Obviously there is a space between the lines, which creates a click-invalid space.
The player does not expect a margin where such clicks are disabled. So I think this has to be fixed.

There are two ways I came up with the fix:
(1) Eliminate the space between lines
(2) Expand the effective range of clicks


I tried to choose method (1). Because it has the same line spacing as the old GUI engine.
Add container.set_spacing(scr_size(D_H_SPACE, 0)); under container.set_table_layout(1,0); in gui_scrolled_list.cc.

(https://i.imgur.com/AkZt5Q9.png)


Then, the space between the lines is filled like this, but there is a useless margin underneath. Because, the total height remains the same. (´・ω・`)
Title: Re: scrolled list issue
Post by: prissi on September 22, 2020, 02:15:56 PM
Wow, you are the first to notice and complain. (Btw, how to switch on the debug mode?)

The container has to use container.set_margin(scr_size(D_H_SPACE, 0),scr_size(D_H_SPACE, 0));

Also there was an error in getroffen and inbuttons, that the bottom right was not counting as inside, while to the top was counting as inside.

See r9252
Title: Re: scrolled list issue
Post by: Dwachs on September 22, 2020, 06:43:53 PM
The debug switch is in gui_container.cc, line 10.
Title: Re: scrolled list issue
Post by: Andarix on September 26, 2020, 12:58:30 PM
I think the fix is not correct or there are other errors. The line height or the line spacing are no longer given as before.

I suspect the theme settings no longer work.
# horizontal and vertical margins between objects
gui_hspace = 5
gui_vspace = 5


(https://simutrans-germany.com/files/upload/Bild_2020-09-26_145520.png)

line 13 is rail line, tooltip is from tab
(https://forum.simutrans.com/index.php?action=dlattach;topic=20342.0;attach=29287;image)
Title: Re: scrolled list issue
Post by: prissi on September 26, 2020, 02:34:46 PM
The question is, what is wanted. Is a dead space between objects in scrolled list wanted or not.

The combbox in question just have a predefined height, which can exceed the height of the actual list.
Title: Re: scrolled list issue
Post by: prissi on September 27, 2020, 12:58:23 PM
The was space.w added in container not space.h for vertical distance. Fixed in r9257