Fix not working applet with same compact/full representation when hiding

If preferred, compact and full represenation are set to the same value,
the value of appletShouldBeExpanded will be true, which means the applet
will be expanded by default. In this case, only fullRepresentation will
be created and compactRepresentationItem will simply be null.

If compactRepresentationItem is null, also check the fullRepresentation
for mouse event forwarding.

This fixes manage-inputmethod applet not working if it's hidden in the
tray.
wilder-5.25
Weng Xuetian 4 years ago committed by Nate Graham
parent d31ab4ef2b
commit 69702475e5
  1. 6
      applets/systemtray/package/contents/ui/items/PlasmoidItem.qml

@ -38,7 +38,8 @@ AbstractItem {
return
}
//forward click event to the applet
const mouseArea = findMouseArea(applet.compactRepresentationItem)
var appletItem = applet.compactRepresentationItem ? applet.compactRepresentationItem : applet.fullRepresentationItem
const mouseArea = findMouseArea(appletItem)
if (mouseArea) {
mouseArea.clicked(mouse)
} else if (mouse.button === Qt.LeftButton) {//falback
@ -61,7 +62,8 @@ AbstractItem {
return
}
//forward wheel event to the applet
const mouseArea = findMouseArea(applet.compactRepresentationItem)
var appletItem = applet.compactRepresentationItem ? applet.compactRepresentationItem : applet.fullRepresentationItem
const mouseArea = findMouseArea(appletItem)
if (mouseArea) {
mouseArea.wheel(wheel)
}

Loading…
Cancel
Save