Skip to content

Commit

Permalink
fix(ui): animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Serein207 committed Aug 9, 2024
1 parent 3c19120 commit 35fa707
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ui/app.slint
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 12 additions & 4 deletions ui/views/overlay/menu.slint
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}
}

Expand All @@ -150,15 +158,15 @@ export component MenuOverlay inherits Overlay {
icon: Token.image.icon.setting.normal;
label: "设置";
clicked => {
ViewManager.push(ViewName.SettingPage)
ViewManager.clean-push(ViewName.SettingPage)
}
}

MenuItem {
icon: Token.image.icon.info.normal;
label: "关于";
clicked => {
ViewManager.push(ViewName.AboutPage)
ViewManager.clean-push(ViewName.AboutPage)
}
}

Expand Down

0 comments on commit 35fa707

Please sign in to comment.