News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

scrolled list issue

Started by Ranran, September 20, 2020, 12:23:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

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.



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.




Then, the space between the lines is filled like this, but there is a useless margin underneath. Because, the total height remains the same. (´・ω・`)

prissi

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

Dwachs

The debug switch is in gui_container.cc, line 10.
Parsley, sage, rosemary, and maggikraut.

Andarix

#3
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




line 13 is rail line, tooltip is from tab


prissi

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.

prissi

The was space.w added in container not space.h for vertical distance. Fixed in r9257