mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
homescreen: Fix applet edit function calls
This commit is contained in:
parent
68b7d3897e
commit
f3925f2ac0
3 changed files with 23 additions and 4 deletions
|
|
@ -27,7 +27,10 @@ ContainmentLayoutManager.BasicAppletContainer {
|
||||||
property real screenWidth: homeScreenState.availableScreenWidth
|
property real screenWidth: homeScreenState.availableScreenWidth
|
||||||
property real screenHeight: homeScreenState.availableScreenHeight
|
property real screenHeight: homeScreenState.availableScreenHeight
|
||||||
|
|
||||||
configOverlayComponent: Private.ConfigOverlay {}
|
configOverlayComponent: Private.ConfigOverlay {
|
||||||
|
onRequestEditModeClose: appletContainer.editMode = false;
|
||||||
|
onRequestRemoveTrigger: appletContainer.applet.action("remove").trigger();
|
||||||
|
}
|
||||||
|
|
||||||
property LauncherDragManager launcherDragManager
|
property LauncherDragManager launcherDragManager
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ PlasmaCore.ToolTipArea {
|
||||||
property bool checked: false
|
property bool checked: false
|
||||||
property bool toggle: false
|
property bool toggle: false
|
||||||
property string text
|
property string text
|
||||||
|
|
||||||
signal clicked
|
signal clicked
|
||||||
|
signal requestEditModeClose
|
||||||
|
|
||||||
implicitWidth: buttonRow.implicitWidth
|
implicitWidth: buttonRow.implicitWidth
|
||||||
implicitHeight: buttonRow.implicitHeight
|
implicitHeight: buttonRow.implicitHeight
|
||||||
|
|
@ -128,7 +130,7 @@ PlasmaCore.ToolTipArea {
|
||||||
} else {
|
} else {
|
||||||
button.clicked()
|
button.clicked()
|
||||||
}
|
}
|
||||||
appletContainer.editMode = false;
|
requestEditModeClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM
|
||||||
|
|
||||||
ContainmentLayoutManager.ConfigOverlayWithHandles {
|
ContainmentLayoutManager.ConfigOverlayWithHandles {
|
||||||
id: overlay
|
id: overlay
|
||||||
|
property var appletContainer
|
||||||
|
|
||||||
|
signal requestRemoveTrigger
|
||||||
|
signal requestEditModeClose
|
||||||
|
|
||||||
readonly property int iconSize: PlasmaCore.Units.iconSizes.medium
|
readonly property int iconSize: PlasmaCore.Units.iconSizes.medium
|
||||||
PlasmaCore.Svg {
|
PlasmaCore.Svg {
|
||||||
|
|
@ -45,8 +49,8 @@ ContainmentLayoutManager.ConfigOverlayWithHandles {
|
||||||
}
|
}
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: {
|
script: {
|
||||||
appletContainer.applet.action("remove").trigger();
|
overlay.requestRemoveTrigger();
|
||||||
appletContainer.editMode = false;
|
overlay.requestEditModeClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,6 +79,11 @@ ContainmentLayoutManager.ConfigOverlayWithHandles {
|
||||||
iconSize: overlay.iconSize
|
iconSize: overlay.iconSize
|
||||||
visible: (action && typeof(action) != "undefined") ? action.enabled : false
|
visible: (action && typeof(action) != "undefined") ? action.enabled : false
|
||||||
action: (applet) ? applet.action("configure") : null
|
action: (applet) ? applet.action("configure") : null
|
||||||
|
|
||||||
|
onRequestEditModeClose: {
|
||||||
|
overlay.requestEditModeClose();
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (action && typeof(action) != "undefined") {
|
if (action && typeof(action) != "undefined") {
|
||||||
action.enabled = true
|
action.enabled = true
|
||||||
|
|
@ -103,6 +112,11 @@ ContainmentLayoutManager.ConfigOverlayWithHandles {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
removeAnim.restart();
|
removeAnim.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRequestEditModeClose: {
|
||||||
|
overlay.requestEditModeClose();
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var a = applet.action("remove");
|
var a = applet.action("remove");
|
||||||
if (a && typeof(a) != "undefined") {
|
if (a && typeof(a) != "undefined") {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue