Commit b360c548 authored by andy salerno's avatar andy salerno Committed by Nate Graham
Browse files

[applets/systemtray] Only show back button when the hidden items view has any items

Today on master, the system tray menu *always* shows a back button, regardless of the context.

But when all items are visible, the back button simply acts as a "close" button, since we are
only "one layer" deep and there is nowhere to go back to. This commit fixes that issue by only
displaying the back button hen the hidden items view has any items in it such that you could go
back to it.


(cherry picked from commit eb411f7b)
parent f05588dc
......@@ -69,7 +69,7 @@ Item {
PlasmaComponents.ToolButton {
id: backButton
visible: activeApplet
visible: activeApplet && activeApplet.expanded && (hiddenItemsView.itemCount > 0)
icon.name: "go-previous"
onClicked: {
if (activeApplet) {
......@@ -93,7 +93,7 @@ Item {
// that it triggers the config action for whatever applet is
// being viewed, and then hide the applet's own config button
// if both would be shown at the same time
visible: !backButton.visible && plasmoid.action("configure").enabled
visible: !activeApplet && plasmoid.action("configure").enabled
icon.name: "configure"
onClicked: plasmoid.action("configure").trigger()
PlasmaComponents.ToolTip {
......@@ -128,6 +128,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
visible: activeApplet
// We need to add our own margins on the top and left (when the
// hidden items view is visible, at least) so it matches the
// dialog's own margins and content is centered correctly
......
......@@ -31,6 +31,7 @@ MouseArea {
id: hiddenTasksView
property alias layout: hiddenTasks
readonly property alias itemCount: hiddenTasks.itemCount
hoverEnabled: true
onExited: hiddenTasks.currentIndex = -1
......
......@@ -85,10 +85,7 @@ AbstractItem {
plasmoidContainer.activated()
} else if (root.activeApplet === applet) {
if (!inHiddenLayout) {
dialog.visible = false;
}
//if not expanded we don't have an active applet anymore
// if not expanded we don't have an active applet anymore
root.activeApplet = null;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment