Skip to content

Commit

Permalink
fix: MenuItem can't be highlight by keyboard
Browse files Browse the repository at this point in the history
  `highlighted` property is updated by Menu when handling key event.
  • Loading branch information
18202781743 committed Mar 18, 2024
1 parent b19c9a8 commit 6de0340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qt6/src/qml/MenuItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.deepin.dtk.style 1.0 as DS
T.MenuItem {
id: control

property bool useIndicatorPadding: menu && menu.existsChecked
property bool useIndicatorPadding: menu && menu.existsChecked || false
implicitWidth: DS.Style.control.implicitWidth(control)
implicitHeight: DS.Style.control.implicitHeight(control)
baselineOffset: contentItem.y + contentItem.baselineOffset
Expand Down Expand Up @@ -104,7 +104,7 @@ T.MenuItem {

Loader {
anchors.fill: parent
active: control.hovered
active: control.down || control.highlighted
sourceComponent: HighlightPanel {}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/qml/MenuItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.deepin.dtk.style 1.0 as DS
T.MenuItem {
id: control

property bool useIndicatorPadding: menu && menu.existsChecked
property bool useIndicatorPadding: menu && menu.existsChecked || false
implicitWidth: DS.Style.control.implicitWidth(control)
implicitHeight: DS.Style.control.implicitHeight(control)
baselineOffset: contentItem.y + contentItem.baselineOffset
Expand Down Expand Up @@ -104,7 +104,7 @@ T.MenuItem {

Loader {
anchors.fill: parent
active: control.hovered
active: control.down || control.highlighted
sourceComponent: HighlightPanel {}
}
}
Expand Down

0 comments on commit 6de0340

Please sign in to comment.