From 810dd5a1b4cfcc2c7150b5a78fbf8001eb024ef6 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 20 Apr 2020 12:41:20 +0300 Subject: [PATCH] publish Abilities qml library --add AppletRequirements in Abilities qml library --- .../contents/ui/applet/HiddenSpacer.qml | 2 +- .../ui/applet/communicator/Actions.qml | 53 ------------- .../ui/applet/communicator/Engine.qml | 12 +-- declarativeimports/CMakeLists.txt | 1 + .../abilities/AppletRequirements.qml | 74 +++++++++++++++++++ declarativeimports/abilities/qmldir | 3 + indicators/default/package/config/config.qml | 1 - .../package/config/config.qml | 1 - .../package/ui/BackLayer.qml | 2 - .../package/ui/FrontLayer.qml | 2 - .../org.kde.latte.plasma/package/ui/main.qml | 1 - .../package/ui/BackLayer.qml | 2 - .../package/ui/main.qml | 1 - 13 files changed, 82 insertions(+), 73 deletions(-) create mode 100644 declarativeimports/abilities/AppletRequirements.qml create mode 100644 declarativeimports/abilities/qmldir diff --git a/containment/package/contents/ui/applet/HiddenSpacer.qml b/containment/package/contents/ui/applet/HiddenSpacer.qml index 3a582ee32..85a431626 100644 --- a/containment/package/contents/ui/applet/HiddenSpacer.qml +++ b/containment/package/contents/ui/applet/HiddenSpacer.qml @@ -51,7 +51,7 @@ Item{ readonly property bool atEdgeForcingFittsLaw: !isSeparator && !parabolicEffectMarginsEnabled && atScreenEdge readonly property int subtrackedMargins: { if (atEdgeForcingFittsLaw && ((firstAppletInContainer && rightSpacer) || (lastAppletInContainer && !rightSpacer ))) { - return (wrapperAlias.requires.edgeLengthMarginsDisabled ? root.lengthExtMargin + appletItem.lengthAppletIntMargin : root.lengthExtMargin); + return (wrapperAlias.edgeLengthMarginsDisabled ? root.lengthExtMargin + appletItem.lengthAppletIntMargin : root.lengthExtMargin); } return 0; diff --git a/containment/package/contents/ui/applet/communicator/Actions.qml b/containment/package/contents/ui/applet/communicator/Actions.qml index b37d909f3..b5912fd56 100644 --- a/containment/package/contents/ui/applet/communicator/Actions.qml +++ b/containment/package/contents/ui/applet/communicator/Actions.qml @@ -23,59 +23,6 @@ import org.kde.latte 0.2 as Latte import org.kde.latte.core 0.2 as LatteCore Item{ - // NAME: latteSideColoringEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is FALSE, Latte is not painting/colorizing this applet - // in any case. In such case the applet can use 'palette' - // in order to access the color palette used at all cases from Latte - // 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 - - - // NAME: latteIconOverlayEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is FALSE, Latte is not overlaying any icons above - // the applet or alters the applet visual in any sense. - // That means that the applet is responsible to provide a coherent - // parabolic effect experience. - // @since: 0.9 - - // NAME: activeIndicatorEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is TRUE, Latte can show its own Active Indicator - // when needed. For FALSE, the Latte Active Indicator is not drawn - // or used for that applet. - // @since: 0.9 - - // NAME: lengthMarginsEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is TRUE, all length margins are drawn including - // indicator padding and applets distance. For FALSE, length margins - // are not drawn at all. - // @since: 0.9 - - // NAME: parabolicEffectEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is TRUE, Latte can use Parabolic Effect in order - // to draw that applet. For FALSE, this applet is considered locked - // and can not be zoomed. - // @since: 0.9 - - // NAME: windowsTrackingEnabled - // TYPE: bool - // USAGE: writable through actions.setProperty - // EXPLANATION: when is TRUE, Latte is informed that this applet requests - // windows tracking. For FALSE, this applet is not requesting - // windows tracking. - // @since: 0.9 - function setProperty(appletId, parameter, value) { if (parameter === "latteSideColoringEnabled") { mainCommunicator.requires.latteSideColoringEnabled = value; diff --git a/containment/package/contents/ui/applet/communicator/Engine.qml b/containment/package/contents/ui/applet/communicator/Engine.qml index fed5b488e..7c820eebb 100644 --- a/containment/package/contents/ui/applet/communicator/Engine.qml +++ b/containment/package/contents/ui/applet/communicator/Engine.qml @@ -19,6 +19,8 @@ import QtQuick 2.7 +import org.kde.latte.abilities 0.1 as Abilities + import "../../../code/AppletIdentifier.js" as AppletIdentifier Item{ @@ -50,15 +52,7 @@ Item{ //! END OF PROPERTIES //! BEGIN OF PUBLIC PROPERTIES SET THROUGH LATTEBRIDGE.ACTIONS - readonly property Item requires: Item { - property bool latteSideColoringEnabled: true - property bool latteIconOverlayEnabled: true - property bool activeIndicatorEnabled: true - property bool lengthMarginsEnabled: true - property bool windowsTrackingEnabled: false - property bool parabolicEffectLocked: false - property bool screenEdgeMarginSupported: false - } + readonly property Item requires: Abilities.AppletRequirements{} //! END OF PUBLIC PROPERTIES SET THROUGH LATTEBRIDGE.ACTIONS diff --git a/declarativeimports/CMakeLists.txt b/declarativeimports/CMakeLists.txt index 2d1e25071..22e164a52 100644 --- a/declarativeimports/CMakeLists.txt +++ b/declarativeimports/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(core) +install(DIRECTORY abilities/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/latte/abilities) install(DIRECTORY components/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/latte/components) diff --git a/declarativeimports/abilities/AppletRequirements.qml b/declarativeimports/abilities/AppletRequirements.qml new file mode 100644 index 000000000..a3029f136 --- /dev/null +++ b/declarativeimports/abilities/AppletRequirements.qml @@ -0,0 +1,74 @@ +/* +* Copyright 2020 Michail Vourlakos +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +import QtQuick 2.0 + +Item{ + property bool activeIndicatorEnabled: true + property bool latteSideColoringEnabled: true + property bool latteIconOverlayEnabled: true + property bool lengthMarginsEnabled: true + property bool parabolicEffectLocked: false + property bool screenEdgeMarginSupported: false + property bool windowsTrackingEnabled: false + + // NAME: activeIndicatorEnabled + // EXPLANATION: when is TRUE, Latte can show its own Active Indicator + // when needed. For FALSE, the Latte Active Indicator is not drawn + // or used for that applet. + // SINCE: 0.9 + + // NAME: latteSideColoringEnabled + // EXPLANATION: when is FALSE, Latte is not painting/colorizing this applet + // in any case. In such case the applet can use 'palette' + // in order to access the color palette used at all cases from Latte + // 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 + + // NAME: latteIconOverlayEnabled + // EXPLANATION: when is FALSE, Latte is not overlaying any icons above + // the applet or alters the applet visual in any sense. + // That means that the applet is responsible to provide a coherent + // parabolic effect experience. + // SINCE: 0.9 + + // NAME: lengthMarginsEnabled + // EXPLANATION: when is TRUE, all length margins are drawn including + // indicator padding and applets distance. For FALSE, length margins + // are not drawn at all. + // SINCE: 0.9 + + // NAME: parabolicEffectLocked + // EXPLANATION: For TRUE, this applet is considered locked + // and can not be zoomed. + // SINCE: 0.9 + + // NAME: screenEdgeMarginSupported + // EXPLANATION: For TRUE, this applet can handle the screen edge margin on + // its own and Latte should not take any special actions to help it + // work properly. + // SINCE: 0.10 + + // NAME: windowsTrackingEnabled + // EXPLANATION: when is TRUE, Latte is informed that applet requests + // windows tracking functionality. + // SINCE: 0.9 +} diff --git a/declarativeimports/abilities/qmldir b/declarativeimports/abilities/qmldir new file mode 100644 index 000000000..384e26281 --- /dev/null +++ b/declarativeimports/abilities/qmldir @@ -0,0 +1,3 @@ +module org.kde.latte.abilities + +AppletRequirements 0.1 AppletRequirements.qml diff --git a/indicators/default/package/config/config.qml b/indicators/default/package/config/config.qml index b12f3e0ff..503f42f4d 100644 --- a/indicators/default/package/config/config.qml +++ b/indicators/default/package/config/config.qml @@ -27,7 +27,6 @@ import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.plasmoid 2.0 -import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents ColumnLayout { diff --git a/indicators/org.kde.latte.plasma/package/config/config.qml b/indicators/org.kde.latte.plasma/package/config/config.qml index ef0af8eba..ad030bdcc 100644 --- a/indicators/org.kde.latte.plasma/package/config/config.qml +++ b/indicators/org.kde.latte.plasma/package/config/config.qml @@ -25,7 +25,6 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents ColumnLayout { diff --git a/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml b/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml index facdefb02..cebb3ee75 100644 --- a/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml +++ b/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml @@ -21,8 +21,6 @@ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.latte 0.2 as Latte - PlasmaCore.FrameSvgItem { id: frame property string basePrefix: "normal" diff --git a/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml b/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml index b85f78425..d0a37328d 100644 --- a/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml +++ b/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml @@ -22,8 +22,6 @@ import QtQuick 2.7 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.latte 0.2 as Latte - Item { anchors.fill: parent diff --git a/indicators/org.kde.latte.plasma/package/ui/main.qml b/indicators/org.kde.latte.plasma/package/ui/main.qml index deaa89f41..47e63d159 100644 --- a/indicators/org.kde.latte.plasma/package/ui/main.qml +++ b/indicators/org.kde.latte.plasma/package/ui/main.qml @@ -21,7 +21,6 @@ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents LatteComponents.IndicatorItem { diff --git a/indicators/org.kde.latte.plasmatabstyle/package/ui/BackLayer.qml b/indicators/org.kde.latte.plasmatabstyle/package/ui/BackLayer.qml index 61fc41cfe..1c5de6ded 100644 --- a/indicators/org.kde.latte.plasmatabstyle/package/ui/BackLayer.qml +++ b/indicators/org.kde.latte.plasmatabstyle/package/ui/BackLayer.qml @@ -21,8 +21,6 @@ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.latte 0.2 as Latte - PlasmaCore.FrameSvgItem { id: frame property string basePrefix: "normal" diff --git a/indicators/org.kde.latte.plasmatabstyle/package/ui/main.qml b/indicators/org.kde.latte.plasmatabstyle/package/ui/main.qml index de6f1e7f9..21730c924 100644 --- a/indicators/org.kde.latte.plasmatabstyle/package/ui/main.qml +++ b/indicators/org.kde.latte.plasmatabstyle/package/ui/main.qml @@ -21,7 +21,6 @@ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents LatteComponents.IndicatorItem {