1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

add Communicator::lengthMarginsEnabled for applets

--applets can now inform Latte if they want length
margins or not
This commit is contained in:
Michail Vourlakos 2019-06-27 14:52:14 +03:00
parent 6fbb2d7d0d
commit 08f3855292
4 changed files with 15 additions and 2 deletions

View File

@ -35,7 +35,7 @@ Item{
property int separatorSpace: neighbourSeparator && !appletItem.isSeparator && !appletItem.latteApplet && root.zoomFactor>1 ? (2+root.lengthMargin) : 0
property real nHiddenSize: {
if (isSeparator || isSpacer) {
if (isSeparator || !communicator.lengthMarginsEnabled) {
return 0;
}

View File

@ -122,7 +122,7 @@ Item{
root.thickMargins :
(root.inFullJustify && atScreenEdge ? 0 : localLengthMargins) //Fitt's Law
property int localLengthMargins: isSpacer || isSeparator ? 0 : root.lengthMargins
property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : root.lengthMargins
property real scaledWidth: zoomScaleWidth * (layoutWidth + marginWidth)
property real scaledHeight: zoomScaleHeight * (layoutHeight + marginHeight)

View File

@ -51,6 +51,14 @@ Item{
// 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
@ -74,6 +82,8 @@ Item{
mainCommunicator.latteIconOverlayEnabled = value;
} else if (parameter === "activeIndicatorEnabled") {
mainCommunicator.activeIndicatorEnabled = value;
} else if (parameter === "lengthMarginsEnabled") {
mainCommunicator.lengthMarginsEnabled = value;
} else if (parameter === "parabolicEffectLocked") {
mainCommunicator.parabolicEffectLocked = value;
} else if (parameter === "windowsTrackingEnabled") {
@ -88,6 +98,8 @@ Item{
return mainCommunicator.latteIconOverlayEnabled;
} else if (parameter === "activeIndicatorEnabled") {
return mainCommunicator.activeIndicatorEnabled;
} else if (parameter === "lengthMarginsEnabled") {
return mainCommunicator.lengthMarginsEnabled;
} else if (parameter === "parabolicEffectLocked") {
return mainCommunicator.parabolicEffectLocked;
} else if (parameter === "windowsTrackingEnabled") {

View File

@ -53,6 +53,7 @@ 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
//! END OF PUBLIC PROPERTIES SET THROUGH LATTEBRIDGE.ACTIONS