diff --git a/gui/ui/app.slint b/gui/ui/app.slint index d28e744..ab4a452 100644 --- a/gui/ui/app.slint +++ b/gui/ui/app.slint @@ -283,24 +283,25 @@ component AddView inherits VerticalLayout { GoodButtons { } } -component ShopView inherits VerticalLayout { +component ShopView inherits ScrollView { in property <[SItem]> list; + mouse-drag-pan-enabled: true; + VerticalLayout { + RefreshButton { } - padding: 8px; - spacing: 8px; + padding: 8px; + spacing: 8px; + goods := GoodsList { + items <=> list; + } - RefreshButton { } - - goods := GoodsList { - items <=> list; - } - - HorizontalLayout { - padding: 12px; - Button { - text: "I am done hehe"; - clicked => { - State.delete-checked(); + HorizontalLayout { + padding: 12px; + Button { + text: "I am done hehe"; + clicked => { + State.delete-checked(); + } } } } @@ -326,7 +327,7 @@ component CatItem inherits HorizontalBox { component CatView inherits ScrollView { in-out property <[SButtonItem]> cats; - + mouse-drag-pan-enabled: true; VerticalLayout { for item in cats: CatItem { item: item; @@ -370,16 +371,4 @@ export component App inherits Window { SettingsView { } } } - - sgr := SwipeGestureHandler { - handle-swipe-right: tabs.current-index > 0; - handle-swipe-left: tabs.current-index < 4; - swiped => { - if self.current-position.x > self.pressed-position.x + self.width / 4 { - tabs.current-index -= 1; - } else if self.current-position.x < self.pressed-position.x - self.width / 4 { - tabs.current-index += 1; - } - } - } }