improve atScreenEdge code

pull/16/head
Michail Vourlakos 5 years ago
parent 9739c43674
commit 1cef4bb70f

@ -85,10 +85,18 @@ Item {
property bool isSystray: applet && (applet.pluginName === "org.kde.plasma.systemtray" || applet.pluginName === "org.nomad.systemtray" )
property bool firstChildOfStartLayout: index === layoutsContainer.startLayout.firstVisibleIndex
property bool firstChildOfMainLayout: index === layoutsContainer.mainLayout.firstVisibleIndex
property bool lastChildOfMainLayout: index === layoutsContainer.mainLayout.lastVisibleIndex
property bool lastChildOfEndLayout: index === layoutsContainer.endLayout.lastVisibleIndex
readonly property bool atScreenEdge: {
if (plasmoid.configuration.maxLength!==100 || plasmoid.configuration.offset!==0) {
if (root.panelAlignment !== Latte.Types.Justify || root.inConfigureAppletsMode || plasmoid.configuration.offset!==0) {
return false;
}
if (root.panelAlignment === Latte.Types.Justify) {
//! Justify case
if (plasmoid.configuration.maxLength!==100) {
return false;
}
@ -109,6 +117,23 @@ Item {
return false;
}
/*if (root.panelAlignment === Latte.Types.Left) {
//! Left case
return firstChildOfMainLayout;
} else if (root.panelAlignment === Latte.Types.Right) {
//! Right case
return lastChildOfMainLayout
}
if (root.panelAlignment === Latte.Types.Top) {
return firstChildOfMainLayout && latteView && latteView.y === latteView.screenGeometry.y;
} else if (root.panelAlignment === Latte.Types.Bottom) {
return lastChildOfMainLayout && latteView && ((latteView.y + latteView.height) === (latteView.screenGeometry.y + latteView.screenGeometry.height));
}*/
return false;
}
//applet is in starting edge
property bool firstAppletInContainer: (index >=0) &&
((index === layoutsContainer.startLayout.firstVisibleIndex)

Loading…
Cancel
Save