The International Simutrans Forum

 

Author Topic: scrolled list issue  (Read 519 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
scrolled list issue
« 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.



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. (´・ω・`)

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10627
  • Languages: De,EN,JP
Re: scrolled list issue
« Reply #1 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

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: scrolled list issue
« Reply #2 on: September 22, 2020, 06:43:53 PM »
The debug switch is in gui_container.cc, line 10.

Offline Andarix

  • *
  • Posts: 262
  • Languages: de
Re: scrolled list issue
« Reply #3 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.
Code: [Select]
# horizontal and vertical margins between objects
gui_hspace = 5
gui_vspace = 5



line 13 is rail line, tooltip is from tab

« Last Edit: September 26, 2020, 01:21:33 PM by Andarix »

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10627
  • Languages: De,EN,JP
Re: scrolled list issue
« Reply #4 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.

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10627
  • Languages: De,EN,JP
Re: scrolled list issue
« Reply #5 on: September 27, 2020, 12:58:23 PM »
The was space.w added in container not space.h for vertical distance. Fixed in r9257