Page 1 of 1

[Rseding91][0.16.20][Modding] guiElement scroll-pane

Posted: Tue Jan 30, 2018 9:57 am
by lovely_santa
Hi,

I know a gui rework is planned for 0.17... But I think the behaviour of the scroll bar doesn't work correctly...

I've set my scroll bar to only scroll in horizontal direction when needed:

Code: Select all

    local configTableSlider = configTable.add{
      type = "scroll-pane",
      name = self.guiElementNames.configTableSlider,
      horizontal_scroll_policy = "auto", -- default
      vertical_scroll_policy = "never"}
Resulting in this:
Image
Image

As you can see in the upper image it added the horizontal scroll bar when there are too many items to fit... BUT it also added a vertical one, none the less there isn't a limitation on the frames hight... AND I didn't add anything else in the vertical direction between the two pictures

So then i changed the horizontal policy to "always".. That way i'm sure there is enough vertical space to fit it, resulting in this:
Image
Image

So even when the horizontal scroll bar was already in place, it still added the vertical one... And if I scroll down on the vertical one there was nothing below... I would expect setting the vertical one to "never" would prevent it from showing, at least when the horizontal one is already present, becose at that point the height don't change at all in this case..

greetings
lovely_santa

PS: since the forum didn't let me upload any pictures for some reason (see 57310), i couldn't include a save file / code and pictures are uploaded on imgur
Image

Re: [Rseding91][0.16.20][Modding] guiElement scroll-pane

Posted: Tue Jan 30, 2018 10:12 am
by lovely_santa
Uploaded saves on wetransfer:

Mod used: https://we.tl/ERZnjKgJqk
Save file: https://we.tl/QMactARcoB

Steps:
  • In the save game is an emitter places click on it to open the UI and click the gears to open the gui from the screenshot.
  • In the mod file /src/gui.lua line 253 is a setting fieldWidth = 65 to add more buttons so the scroll bar should appear
  • When commenting that line it will only show 25 and it should fit.
  • On line 280 (same file) is the scroll-plane to set the horizontal/vertical scroll policy.
Greetings
lovely_santa

Re: [Rseding91][0.16.20][Modding] guiElement scroll-pane

Posted: Tue Jan 30, 2018 6:42 pm
by Rseding91
Thanks for the report. The scroll pane was bugged and would ignore vertical scroll policy in most cases. I've fixed it for the next version of 0.16.