Commit 5e7a074a authored by Nate Graham's avatar Nate Graham 🔩

Revert "Revert "Make accidental panel and panel widget deletion more difficult""

This reverts commit 0a1eb00b.

This was accidentally commited to the stable branch, but we do want
it on the master branch, so revert the reversion of the commit on the
stable branch here on the master branch.
parent 72eaf58a
......@@ -360,7 +360,6 @@ MouseArea {
currentApplet.applet.prepareContextualActions();
alternativesButton.visible = currentApplet.applet.action("alternatives") && currentApplet.applet.action("alternatives").enabled;
configureButton.visible = currentApplet.applet.action("configure") && currentApplet.applet.action("configure").enabled;
closeButton.visible = currentApplet.applet.action("remove") && currentApplet.applet.action("remove").enabled;
label.text = currentApplet.applet.title;
}
}
......@@ -384,6 +383,21 @@ MouseArea {
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
// we want destructive actions to be far from the initial
// cursor position, so show this on the top unless it's on
// a top panel
visible: tooltip.location !== PlasmaCore.Types.TopEdge
&& currentApplet.applet.action("remove")
&& currentApplet.applet.action("remove").enabled
iconSource: "delete"
text: i18n("Remove")
onClicked: {
tooltip.visible = false;
currentApplet.applet.action("remove").trigger();
}
}
PlasmaComponents.ToolButton {
id: configureButton
Layout.fillWidth: true
......@@ -405,8 +419,12 @@ MouseArea {
}
}
PlasmaComponents.ToolButton {
id: closeButton
Layout.fillWidth: true
// we want destructive actions to be far from the initial
// cursor position, so show this on the bottom for top panels
visible: tooltip.location === PlasmaCore.Types.TopEdge
&& currentApplet.applet.action("remove")
&& currentApplet.applet.action("remove").enabled
iconSource: "delete"
text: i18n("Remove")
onClicked: {
......
......@@ -38,6 +38,16 @@ PlasmaCore.Dialog {
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
PlasmaComponents.ToolButton {
Layout.fillWidth: true
// we want destructive actions to be far from the initial cursor
// position, so show this on the top unless it's on a top panel
visible: location !== PlasmaCore.Types.TopEdge
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Remove Panel")
iconSource: "delete"
onClicked: plasmoid.action("remove").trigger();
}
PlasmaExtras.Heading {
level: 3
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Panel Alignment")
......@@ -127,6 +137,15 @@ PlasmaCore.Dialog {
iconSource: panel.formFactor === PlasmaCore.Types.Vertical ? "zoom-fit-height" : "zoom-fit-width"
onClicked: panel.maximize();
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
// we want destructive actions to be far from the initial cursor
// position, so show this on the bottom for top panels
visible: location === PlasmaCore.Types.TopEdge
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Remove Panel")
iconSource: "delete"
onClicked: plasmoid.action("remove").trigger();
}
}
function hide() {
......
......@@ -30,7 +30,6 @@ Item {
implicitWidth: Math.max(buttonsLayout_1.width, buttonsLayout_2.width, row.width) + units.smallSpacing * 2
implicitHeight: row.height + 20
readonly property string removePanelButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Remove Panel")
readonly property string addWidgetsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Widgets...")
readonly property string addSpacerButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Spacer")
readonly property string settingsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "More Settings...")
......@@ -67,12 +66,23 @@ Item {
columnSpacing: units.smallSpacing
PlasmaComponents.Button {
iconSource: "delete"
text: buttonsLayout_1.showText ? root.removePanelButtonText : ""
tooltip: buttonsLayout_1.showText ? "" : root.removePanelButtonText
text: buttonsLayout_2.showText ? root.addWidgetsButtonText : ""
tooltip: buttonsLayout_2.showText ? "" : root.addWidgetsButtonText
iconSource: "list-add"
Layout.fillWidth: true
onClicked: {
configDialog.close();
configDialog.showAddWidgetDialog();
}
}
PlasmaComponents.Button {
iconSource: "distribute-horizontal-x"
text: buttonsLayout_2.showText ? root.addSpacerButtonText : ""
tooltip: buttonsLayout_2.showText ? "" : root.addSpacerButtonText
Layout.fillWidth: true
onClicked: {
plasmoid.action("remove").trigger();
configDialog.addPanelSpacer();
}
}
}
......@@ -124,27 +134,6 @@ Item {
rowSpacing: units.smallSpacing
columnSpacing: units.smallSpacing
PlasmaComponents.Button {
text: buttonsLayout_2.showText ? root.addWidgetsButtonText : ""
tooltip: buttonsLayout_2.showText ? "" : root.addWidgetsButtonText
iconSource: "list-add"
Layout.fillWidth: true
onClicked: {
configDialog.close();
configDialog.showAddWidgetDialog();
}
}
PlasmaComponents.Button {
iconSource: "distribute-horizontal-x"
text: buttonsLayout_2.showText ? root.addSpacerButtonText : ""
tooltip: buttonsLayout_2.showText ? "" : root.addSpacerButtonText
Layout.fillWidth: true
onClicked: {
configDialog.addPanelSpacer();
}
}
PlasmaComponents.Button {
id: settingsButton
iconSource: "configure"
......
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