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

Material theme ScrollView: Hover state not cleared properly when panning #5262

Open
JuliDi opened this issue May 17, 2024 · 0 comments
Open

Comments

@JuliDi
Copy link

JuliDi commented May 17, 2024

There is an issue with the ScrollView on the material theme, probably related to #4411 .
When scrolling with the finger (on a touch screen) or using the mouse to pan on, e.g. Slint Live-Preview in VS Code, the hover state is not cleared properly when the pointer leaves the TouchArea.

This can be reproduced with the following code snippet and the VS Code Slint Live-Preview. Just click and drag any of the items, e.g. click the top one and drag down. It should go back to zero opacity as soon as the mouse cursor is no longer on top of it, or latest when it is released. However, you will see that it remains in the hover state (see screenshot).

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

component SideBarItem inherits Rectangle {
    min-height: state.preferred-height;

    states [
        pressed when touch.pressed: {
            state.opacity: 0.2;
        }
        hover when touch.has-hover: {
            state.opacity: 0.4;
        }
    ]
    state := Rectangle {
        opacity: 0;
        background: black;
        height: 20px;
    }

    touch := TouchArea {
        width: 100%;
        height: 100%;
    }
}

export component Demo {
    height: 200px;
    width: 300px;
    ScrollView {
        VerticalLayout {
            SideBarItem { }
            SideBarItem { }
            SideBarItem { }
            SideBarItem { }
            SideBarItem { }
            SideBarItem { }
            SideBarItem { }
        }
    }
}

Screenshot 2024-05-17 at 12 37 17

  • Platform / Programming Language: Independent, though confirmed with Rust on an STM32F469 using a touch screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant