Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout dimensions inside ScrollView not updated when increasing window size #2227

Open
mgunyho opened this issue Feb 13, 2023 · 1 comment
Open
Labels
a:flickable The implementation of the Flickable (mO) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

Comments

@mgunyho
Copy link

mgunyho commented Feb 13, 2023

Hi,

When a window with a ScrollView is resized to be bigger, the dimensions of the layout inside the ScrollView are apparently not updated, and the scrollbar extends outside of the ScrollView. As far as I can tell, this doesn't happen when the window becomes smaller. If I drag the slider, it snaps to the correct place.

Here's a minimal working example:

import { ScrollView } from "std-widgets.slint";

MainWindow := Window {
    preferred-width: 300px;
    preferred-height: 300px;
    ScrollView {
        HorizontalLayout {
            Rectangle {
                height: 500px;
                width: 500px;
                background: red;
            }
        }
    }
}

Here's a short video of it happening:

slint-scrollview-resize.2023-02-13.20-03.mp4

This happens both in debug and release version.

Possibly related to #2202 ?

Environment:

  • Slint version: 0.3.4, also happens on master @ e557ba5
  • Backend: winit-femtovg
  • rustc: 1.66.1
  • OS: OpenSUSE Tumbleweed with X11
  • WM: KDE, also happens on i3 with Ubuntu 20.04
@ogoffart ogoffart added the bug Something isn't working label Feb 14, 2023
@ogoffart
Copy link
Member

Thanks for the bug report.

Normally, the content-x and content-y property are set when the scrollbars are moved (or the wheel is rolled).
This process ensure that content-x and content-y are always within the bounds.
The problem is that when resizing, we don't change content-x and content-y. There is no way to express in the .slint language used by the widgets that they should be within the bounds because there can't be a binding since we change the value "manually" and we don't get callbacks when the geometry change.

Because the content position is not in bound, the computation of the size of the scrollbar is off.
We could fix the scrollbar being off by applying extra bounds in their binding, but that wouldn't fix the problem.

In other to fix this we either:

@ogoffart ogoffart added the a:flickable The implementation of the Flickable (mO) label Jul 13, 2023
@ogoffart ogoffart added the priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:flickable The implementation of the Flickable (mO) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this
Projects
None yet
Development

No branches or pull requests

2 participants