Is it possible to have a scroll pane without scrollbars which is still scrollable (with mouse wheel)?
I've already tried the *_scroll_policies with "dont-show-but-allow-scrolling", but unfortunatelly scrollbars are still shown and I can't see any difference in behaviour to "auto".
Thx in advance
[Klonan] scroll pane without scrollbars
Re: scroll pane without scrollbars
It should work with that policy, can you post your code?xyzzycgn wrote: Wed Jan 29, 2025 7:34 am Is it possible to have a scroll pane without scrollbars which is still scrollable (with mouse wheel)?
I've already tried the *_scroll_policies with "dont-show-but-allow-scrolling", but unfortunatelly scrollbars are still shown and I can't see any difference in behaviour to "auto".
Thx in advance
Re: scroll pane without scrollbars
Hi Klonan,
thx for your quick response.
This is the relevant part of the code, where the scroll pane sp is created:
The two used styles look like that:
The function testtabData() adds 4 sprites to the flow called table inside the scroll pane.
The result look like that:

thx for your quick response.
This is the relevant part of the code, where the scroll pane sp is created:
Code: Select all
function testtab.update(refs, data)
local container = refs.testtab_tab
-- ugly - clear all children and create new ones
container.clear()
local sp = container.add {
type = "scroll-pane",
style = "rldman_small_slot_table_scroll_pane",
name = "scrollpane"
}
local filler = container.add {
type = "flow",
direction = "horizontal",
width = 450,
height = 76,
name = "filler-in-container"
}
local lfiller = filler.add {
type = "label",
width = 450,
height = 76,
caption = "xxxxxxxxxxxxxxxxxxx",
name = "label-in-filler"
}
local table = sp.add {
type = "flow",
style = "rldman_no_stretch_no_squash_flow",
direction = "horizontal",
name = "flow-in-scrollpane"
}
testtabData(table, data)
end
Code: Select all
styles.rldman_small_slot_table_scroll_pane = {
type = "scroll_pane_style",
parent = "flib_naked_scroll_pane_no_padding",
--horizontal_scroll_policy = "never",
horizontal_scroll_policy = "dont-show-but-allow-scrolling",
--horizontal_scroll_policy = "auto",
vertical_scroll_policy = "never",
width = 44 * 2,
height = 66,
padding = 0,
}
styles.rldman_no_stretch_no_squash_flow = {
type = "horizontal_flow_style",
horizontally_stretchable = "off",
vertically_stretchable = "off",
horizontally_squashable = "on",
vertically_squashable = "on",
}
The result look like that:

Re: scroll pane without scrollbars
The policy is not set by the Style, but in the gui element directly (during creation of afterwards):
Code: Select all
local sp = container.add {
type = "scroll-pane",
style = "rldman_small_slot_table_scroll_pane",
horizontal_scroll_policy = "dont-show-but-allow-scrolling",
name = "scrollpane"
}
Re: scroll pane without scrollbars
Oh yeah, you're right - that is wrong
Unfortunately there is no change in behavior after correcting this (I've checked whether the policy is now set correctly by logging the content of the field)

Unfortunately there is no change in behavior after correcting this (I've checked whether the policy is now set correctly by logging the content of the field)
Re: scroll pane without scrollbars
Hmm, can you try setting it after creation?xyzzycgn wrote: Thu Jan 30, 2025 1:20 pm Oh yeah, you're right - that is wrong![]()
Unfortunately there is no change in behavior after correcting this (I've checked whether the policy is now set correctly by logging the content of the field)
Code: Select all
local sp = container.add {
type = "scroll-pane",
style = "rldman_small_slot_table_scroll_pane",
name = "scrollpane"
}
sp.horizontal_scroll_policy = "dont-show-but-allow-scrolling"
Re: scroll pane without scrollbars
Of courseKlonan wrote: Thu Jan 30, 2025 1:56 pm Hmm, can you try setting it after creation?Code: Select all
local sp = container.add { type = "scroll-pane", style = "rldman_small_slot_table_scroll_pane", name = "scrollpane" } sp.horizontal_scroll_policy = "dont-show-but-allow-scrolling"

Code now is
Code: Select all
local sp = container.add {
type = "scroll-pane",
style = "rldman_small_slot_table_scroll_pane",
--horizontal_scroll_policy = "dont-show-but-allow-scrolling",
--vertical_scroll_policy = "never",
name = "scrollpane"
}
sp.horizontal_scroll_policy = "dont-show-but-allow-scrolling"
sp.vertical_scroll_policy = "never"
Re: scroll pane without scrollbars
Okay I looked a bit deeper, and it seems its only supported for textboxes at the moment,
I will move this to bugs and assign it to me so I don't forget to look into adding support to normal scroll panes
I will move this to bugs and assign it to me so I don't forget to look into adding support to normal scroll panes
Re: [Klonan] scroll pane without scrollbars
Thx for your efforts and I am excited about the solution