Skip to content

Commit

Permalink
chore: add animation for menu
Browse files Browse the repository at this point in the history
add animation for menu

Log:
  • Loading branch information
wangfei committed Jul 17, 2024
1 parent a6ccd0f commit 6f5d308
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 13 additions & 0 deletions qt6/src/qml/ArrowListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import QtQuick 2.11
import QtQuick.Window 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DS
import org.deepin.dtk.private 1.0 as P

Expand Down Expand Up @@ -48,6 +49,18 @@ FocusScope {
}
interactive: Window.window ? (contentHeight > Window.window.height || model.count > maxVisibleItems) : false
ScrollIndicator.vertical: ScrollIndicator { }
highlight: Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 6
anchors.rightMargin: 6
property D.Palette backgroundColor: DS.Style.highlightPanel.background
color: D.ColorSelector.backgroundColor
radius: 6 // TODO can't display background when using dtk's InWindowBlur.
}
highlightFollowsCurrentItem: true
highlightMoveDuration: -1
highlightMoveVelocity: 100
}

P.ArrowListViewButton {
Expand Down
7 changes: 1 addition & 6 deletions qt6/src/qml/MenuItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,7 @@ T.MenuItem {

Loader {
anchors.fill: parent
active: control.down || control.highlighted
sourceComponent: Rectangle {
property D.Palette backgroundColor: DS.Style.highlightPanel.background
color: D.ColorSelector.backgroundColor
radius: 1 // TODO can't display background when using dtk's InWindowBlur.
}
active: false//control.down || control.highlighted
}
}
}

0 comments on commit 6f5d308

Please sign in to comment.