simplify more the communicator

pull/3/head
Michail Vourlakos 6 years ago
parent 0f1b090e19
commit 530dd8d655

@ -62,7 +62,7 @@ function checkAndUpdateAppletRootItem() {
for(var i=0; i<level0.length; ++i){
var level1 = level0[i].children;
if (!appletDiscoveredRootItem && level0[i].hasOwnProperty("isInLatte")) {
if (!appletDiscoveredRootItem && level0[i].hasOwnProperty("latteSettings")) {
appletDiscoveredRootItem = level0[i];
}
if (appletDiscoveredRootItem) {
@ -70,7 +70,7 @@ function checkAndUpdateAppletRootItem() {
}
for(var j=0; j<level1.length; ++j){
if (!appletDiscoveredRootItem && level1[j].hasOwnProperty("isInLatte")) {
if (!appletDiscoveredRootItem && level1[j].hasOwnProperty("latteSettings")) {
appletDiscoveredRootItem = level1[j];
}
if (appletDiscoveredRootItem) {

@ -28,21 +28,7 @@ Item{
// BEGIN OF INTERNAL APPLET PROPERTIES
// LATTE<->APPLET 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{}
}

@ -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
}

@ -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

Loading…
Cancel
Save