diff --git a/ui/app.slint b/ui/app.slint index bfbddf20..7b1018ff 100644 --- a/ui/app.slint +++ b/ui/app.slint @@ -152,10 +152,11 @@ component NavBar inherits Rectangle { Rectangle { height: 100%; width: root.width / nav-views.length; - z: -1; + visible: root.get-navbar-current-index() != -1; border-radius: self.height / 2; background: Token.color.primary-container; x: root.get-navbar-current-index() * self.width; + z: -1; animate x { duration: 400ms; easing: ease-in-out; diff --git a/ui/views/overlay/menu.slint b/ui/views/overlay/menu.slint index 248ec179..4ed72329 100644 --- a/ui/views/overlay/menu.slint +++ b/ui/views/overlay/menu.slint @@ -83,11 +83,19 @@ export component MenuOverlay inherits Overlay { Rectangle { x: body.width - self.width; height: root.height; - width: 400px; + width: 0; background: Token.color.surface-container; border-top-left-radius: 6px; border-bottom-left-radius: 6px; + init => { + self.width = 400px; + } + animate width { + duration: 400ms; + easing: ease-in-out; + } + VerticalLayout { padding: 10px; padding-top: 30px; @@ -132,7 +140,7 @@ export component MenuOverlay inherits Overlay { icon: Token.image.icon.history.normal; label: "历史活动"; clicked => { - ViewManager.push(ViewName.HistoryPage) + ViewManager.clean-push(ViewName.HistoryPage) } } @@ -150,7 +158,7 @@ export component MenuOverlay inherits Overlay { icon: Token.image.icon.setting.normal; label: "设置"; clicked => { - ViewManager.push(ViewName.SettingPage) + ViewManager.clean-push(ViewName.SettingPage) } } @@ -158,7 +166,7 @@ export component MenuOverlay inherits Overlay { icon: Token.image.icon.info.normal; label: "关于"; clicked => { - ViewManager.push(ViewName.AboutPage) + ViewManager.clean-push(ViewName.AboutPage) } }