added mouse-drag property to ScrollView (#8512)

Closes #2260
This commit is contained in:
Avery Townsend 2025-05-26 16:22:57 -04:00 committed by GitHub
parent ed8089e43b
commit f7fa27b9b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 0 deletions

View file

@ -43,6 +43,11 @@ using for loops may be added in the future and is tracked in issue #407.
Used to render the frame as disabled or enabled, but doesn't change behavior of the widget. Used to render the frame as disabled or enabled, but doesn't change behavior of the widget.
</SlintProperty> </SlintProperty>
### mouse-drag
<SlintProperty propName="mouse-drag" typeName="bool" defaultValue="true for Material style, false for all others" propertyVisibility="in">
When true, the view can be scrolled by dragging with the mouse.
</SlintProperty>
### has-focus ### has-focus
<SlintProperty propName="has-focus" typeName="bool" defaultValue="false" propertyVisibility="in-out"> <SlintProperty propName="has-focus" typeName="bool" defaultValue="false" propertyVisibility="in-out">
Used to render the frame as focused or unfocused, but doesn't change the behavior of the widget. Used to render the frame as focused or unfocused, but doesn't change the behavior of the widget.

View file

@ -92,6 +92,8 @@ export component ScrollView {
in-out property <length> viewport-y <=> flickable.viewport-y; in-out property <length> viewport-y <=> flickable.viewport-y;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy;
in property <bool> mouse-drag <=> flickable.interactive;
// FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus // FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus
in-out property <bool> has-focus; in-out property <bool> has-focus;

View file

@ -100,6 +100,8 @@ export component ScrollView {
in-out property <length> viewport-y <=> flickable.viewport-y; in-out property <length> viewport-y <=> flickable.viewport-y;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy;
in property <bool> mouse-drag <=> flickable.interactive;
// FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus // FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus
in-out property <bool> has-focus; in-out property <bool> has-focus;

View file

@ -145,6 +145,7 @@ export component ScrollView {
in-out property <length> viewport-y <=> flickable.viewport-y; in-out property <length> viewport-y <=> flickable.viewport-y;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy;
in property <bool> mouse-drag <=> flickable.interactive;
// FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus // FIXME: remove. This property is currently set by the ListView and is used by the native style to draw the scrollbar differently when it has focus
in-out property <bool> has-focus; in-out property <bool> has-focus;

View file

@ -104,6 +104,7 @@ export component ScrollView {
in-out property <length> viewport-y <=> flickable.viewport-y; in-out property <length> viewport-y <=> flickable.viewport-y;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> vertical-bar.policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> horizontal-bar.policy;
in property <bool> mouse-drag <=> flickable.interactive;
callback scrolled <=> flickable.flicked; callback scrolled <=> flickable.flicked;

View file

@ -17,6 +17,7 @@ export component InternalScrollView {
in property <bool> enabled <=> native.enabled; in property <bool> enabled <=> native.enabled;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> native.vertical-scrollbar-policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> native.vertical-scrollbar-policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> native.horizontal-scrollbar-policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> native.horizontal-scrollbar-policy;
in property <bool> mouse-drag <=> fli.interactive;
// Used by the StandardTableView // Used by the StandardTableView
out property <length> native-padding-left: native.native-padding-left; out property <length> native-padding-left: native.native-padding-left;

View file

@ -14,6 +14,7 @@ export component ScrollView {
in-out property <length> viewport-y <=> internal.viewport-y; in-out property <length> viewport-y <=> internal.viewport-y;
in property <ScrollBarPolicy> vertical-scrollbar-policy <=> internal.vertical-scrollbar-policy; in property <ScrollBarPolicy> vertical-scrollbar-policy <=> internal.vertical-scrollbar-policy;
in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> internal.horizontal-scrollbar-policy; in property <ScrollBarPolicy> horizontal-scrollbar-policy <=> internal.horizontal-scrollbar-policy;
in property <bool> mouse-drag <=> internal.mouse-drag;
callback scrolled <=> internal.scrolled; callback scrolled <=> internal.scrolled;