Skip to content

Commit

Permalink
fix: Sidebar animation logic adjustment
Browse files Browse the repository at this point in the history
   Sidebar animation logic adjustment

Log: Sidebar animation logic adjustment
Bug: https://pms.uniontech.com/bug-view-194909.html
  • Loading branch information
starhcq committed Jul 18, 2024
1 parent 163597b commit d2d2fae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/qml/AlbumTitle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ TitleBar {
}
}

if (!GStatus.sideBarIsVisible)
return

// 标题栏缩放比例按钮跟随窗口尺寸左对齐/右对齐
if (width <= GStatus.needHideSideBarWidth) {
if (rightLayout.anchors.leftMargin === layoutLeftMargin_AlignRight && (lastWidth > width)) {
Expand Down
5 changes: 3 additions & 2 deletions src/qml/MainAlbumView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ Item {

// 侧边栏跟随窗口尺寸展开/收起
onWidthChanged: {
if (!GStatus.sideBarIsVisible)
return

if (width <= GStatus.needHideSideBarWidth) {
if (leftSidebar.x === 0 && (lastWidth > width)) {
hideSliderAnimation.start()
GStatus.sideBarIsVisible = false
}
} else {
if (leftSidebar.x < 0 && (lastWidth < width)) {
showSliderAnimation.start()
GStatus.sideBarIsVisible = true
}
}

Expand Down

0 comments on commit d2d2fae

Please sign in to comment.