Page 1 of 1

[Klonan] scroll pane without scrollbars

Posted: Wed Jan 29, 2025 7:34 am
by xyzzycgn
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

Posted: Wed Jan 29, 2025 10:29 am
by Klonan
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
It should work with that policy, can you post your code?

Re: scroll pane without scrollbars

Posted: Wed Jan 29, 2025 7:08 pm
by xyzzycgn
Hi Klonan,

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
The two used styles look like that:

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 function testtabData() adds 4 sprites to the flow called table inside the scroll pane.

The result look like that:
Image

Re: scroll pane without scrollbars

Posted: Thu Jan 30, 2025 9:52 am
by Klonan
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

Posted: Thu Jan 30, 2025 1:20 pm
by xyzzycgn
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)

Re: scroll pane without scrollbars

Posted: Thu Jan 30, 2025 1:56 pm
by Klonan
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)
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"

Re: scroll pane without scrollbars

Posted: Thu Jan 30, 2025 2:37 pm
by xyzzycgn
Klonan 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"
Of course :D

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"
But no change in behavior

Re: scroll pane without scrollbars

Posted: Fri Jan 31, 2025 9:00 am
by Klonan
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

Re: [Klonan] scroll pane without scrollbars

Posted: Fri Jan 31, 2025 9:21 am
by xyzzycgn
Thx for your efforts and I am excited about the solution

Re: [Klonan] scroll pane without scrollbars

Posted: Mon Jul 21, 2025 4:37 pm
by xyzzycgn
Is there a timeline when this will be corrected?