From 530dd8d6556b89d85d975f9b0ebad3abc7699661 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 4 Nov 2018 20:29:07 +0200 Subject: [PATCH] simplify more the communicator --- .../package/contents/code/AppletIdentifier.js | 4 ++-- .../contents/ui/applet/Communicator.qml | 24 +++---------------- .../contents/ui/applet/LatteSettings.qml | 3 +++ plasmoid/package/contents/ui/main.qml | 7 +++++- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/containment/package/contents/code/AppletIdentifier.js b/containment/package/contents/code/AppletIdentifier.js index c47267e1c..d2a970fb6 100644 --- a/containment/package/contents/code/AppletIdentifier.js +++ b/containment/package/contents/code/AppletIdentifier.js @@ -62,7 +62,7 @@ function checkAndUpdateAppletRootItem() { for(var i=0; iAPPLET COMMUNICATION PROTOCOL // ------------------------------------- - - // USAGE: The applet can set the following properties in its main item in order to - // establish communication with the Latte containment - - // ------------------------------------- - // INGOING FROM LATTE TO APPLET - // ------------------------------------- - // NAME: isInLatte - // USAGE: property bool isInLatte: false - // EXPLANATION: Latte sets it to true when this applet is in a Latte containment. This parameter - // is very important because it identifies the main element of the applet in which all latte - // parameters need to also placed. Be careful in case you are using CompactRepresentation then - // the main element for which you must place the Latte options is the CompactRepresentation. - property bool appletContainsIsInLatte: appletRootItem && appletRootItem.hasOwnProperty("isInLatte") ? true : false - + // // NAME: latteSettings // USAGE: property QtObject latteSettings: null // EXPLANATION: The main shared object that Latte is using to communicate with the applet @@ -55,6 +41,7 @@ Item{ //! BEGIN OF PROPERTIES //this is used for folderView and icon widgets to fake their visual icons readonly property bool canShowOverlaiedLatteIcon: appletRootItem && communicator.appletIconItem + readonly property bool disableLatteSideColoring: settingsLoader.active ? settingsLoader.item.disableLatteSideColoring : false readonly property bool overlayLatteIconIsActive: canShowOverlaiedLatteIcon && settingsLoader.active && !settingsLoader.item.disableLatteIconOverlay @@ -68,11 +55,6 @@ Item{ //! END OF PROPERTIES //! BEGIN OF PROPERTY CHANGES - onAppletContainsIsInLatteChanged: { - if (appletContainsIsInLatte) { - appletRootItem.isInLatte = true; - } - } //! END OF PROPERTY CHANGES //! BEGIN OF FUNCTIONS @@ -120,7 +102,7 @@ Item{ Loader{ id:settingsLoader - active: appletContainsIsInLatte && appletContainsLatteSettings + active: appletContainsLatteSettings sourceComponent: LatteSettings{} } diff --git a/containment/package/contents/ui/applet/LatteSettings.qml b/containment/package/contents/ui/applet/LatteSettings.qml index 3040a694a..03e28afac 100644 --- a/containment/package/contents/ui/applet/LatteSettings.qml +++ b/containment/package/contents/ui/applet/LatteSettings.qml @@ -51,6 +51,7 @@ Item{ // Latte "palette" and FALSE otherwise // USE CASE: when Latte is transparent and applets colors need to be adjusted in order // to look consistent with the underlying desktop background + // @since: 0.9 readonly property bool applyPalette: disableLatteSideColoring ? colorizerManager.mustBeShown : false @@ -62,6 +63,7 @@ Item{ // USE CASE: when Latte is transparent and applets colors need to be adjusted in order // to look consistent with the underlying desktop background OR the applet // is not using monochromatic icons but rather colorful ones. + // @since: 0.9 property bool disableLatteSideColoring: false // NAME: disableLatteIconOverlay @@ -70,5 +72,6 @@ Item{ // the applet or alters the applet visual in any sense. // That means that the applet is responsible to provide a conherent // parabolic effect experience. + // @since: 0.9 property bool disableLatteIconOverlay: false } diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index fdd9aa2d4..804e21fa8 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -223,7 +223,12 @@ Item { //END Latte Dock Panel properties //BEGIN Latte Dock Communicator - property bool disableLatteSideColoring : true + property QtObject latteSettings: null + onLatteSettingsChanged: { + if (latteSettings) { + latteSettings.disableLatteSideColoring = true; + } + } //END Latte Dock Communicator