From 2ef64f4ab3a41c581ada3b74c9e92064f642dbef Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 23 Apr 2017 02:43:24 +0300 Subject: [PATCH] fix #411,deactivate applets when show previews --- app/dockview.h | 3 +-- containment/contents/ui/main.qml | 7 +++++++ plasmoid/contents/ui/main.qml | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/dockview.h b/app/dockview.h index 56d4a6450..f3e6f32ab 100644 --- a/app/dockview.h +++ b/app/dockview.h @@ -143,8 +143,6 @@ public: VisibilityManager *visibility() const; - void deactivateApplets(); - QQmlListProperty screens(); static int countScreens(QQmlListProperty *property); static QScreen *atScreens(QQmlListProperty *property, int index); @@ -157,6 +155,7 @@ public slots: Q_INVOKABLE QList freeEdges() const; Q_INVOKABLE QVariantList containmentActions(); Q_INVOKABLE int docksWithTasks(); + Q_INVOKABLE void deactivateApplets(); Q_INVOKABLE void removeTasksPlasmoid(); Q_INVOKABLE bool setCurrentScreen(const QString id); Q_INVOKABLE bool tasksPresent(); diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index 67f9e7b1e..439eb2312 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -595,6 +595,7 @@ DragDrop.DropArea { latteApplet.signalAnimationsNeedLength.connect(slotAnimationsNeedLength); latteApplet.signalAnimationsNeedThickness.connect(slotAnimationsNeedThickness); latteApplet.signalActionsBlockHiding.connect(slotActionsBlockHiding); + latteApplet.signalPreviewsShown.connect(slotPreviewsShown); } } @@ -1087,6 +1088,12 @@ DragDrop.DropArea { } } + function slotPreviewsShown(){ + if (dock) { + dock.deactivateApplets(); + } + } + function updateAutomaticIconSize() { if ((visibilityManager.normalState && !root.editMode && root.autoDecreaseIconSize) && (iconSize===root.maxIconSize || iconSize === automaticIconSizeBasedSize) ) { diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 27c98e5a7..9fb5f3818 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -171,6 +171,7 @@ Item { signal signalAnimationsNeedBothAxis(int value); signal signalAnimationsNeedLength(int value); signal signalAnimationsNeedThickness(int value); + signal signalPreviewsShown(); //signal signalDraggingState(bool value); signal showPreviewForTasks(QtObject group); //trigger updating scaling of neighbour delegates of zoomed delegate @@ -402,6 +403,12 @@ Item { if (!activeItem || (activeItem !== taskItem) && !taskItem.contextMenu) { //console.log("preview show called: accepted..."); + //this can be used from others to hide their appearance + //e.g but applets from the dock to hide themselves + if (!visible) { + root.signalPreviewsShown(); + } + //used to initialize windows previews buffers from task to task visible = false; activeItem = taskItem;