mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-28 18:50:40 +03:00
simplify code readability for panelShadowsActive
--fix also a case that the user hasnt enabled to show panel background at all from the Show option and the shadows where shown because they were chosen before it was disabled by the user (cherry picked from commit 0f79c08e862932fe78c161d0bfc3601a81e72761)
This commit is contained in:
parent
d080b9a89f
commit
43f78605d4
@ -89,7 +89,7 @@ DragDrop.DropArea {
|
||||
property bool windowIsTouching: dock && dock.visibility && (dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet)
|
||||
|
||||
property bool forceSemiTransparentPanel: ((!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized && windowIsTouching)
|
||||
|| (plasmoid.configuration.solidBackgroundForMaximized && !plasmoid.configuration.backgroundOnlyOnMaximized && !windowIsTouching))
|
||||
|| (plasmoid.configuration.solidBackgroundForMaximized && !plasmoid.configuration.backgroundOnlyOnMaximized && !windowIsTouching))
|
||||
&& Latte.WindowSystem.compositingActive
|
||||
|
||||
property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && dock && dock.visibility
|
||||
@ -188,11 +188,26 @@ DragDrop.DropArea {
|
||||
property int panelTransparency: plasmoid.configuration.panelTransparency //user set
|
||||
property int currentPanelTransparency: 0 //application override
|
||||
|
||||
property bool panelShadowsActive: (( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized)
|
||||
|| (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel))
|
||||
&& !(disablePanelShadowMaximized && dock.visibility.existsWindowMaximized))
|
||||
|| (hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100 && !(root.solidPanel && !plasmoid.configuration.panelShadows) )
|
||||
property bool panelShadowsActive: {
|
||||
if (!userShowPanelBackground) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized)
|
||||
|| (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel))
|
||||
&& !(disablePanelShadowMaximized && dock.visibility.existsWindowMaximized)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hasExpandedApplet
|
||||
&& zoomFactor===1
|
||||
&& plasmoid.configuration.panelSize===100
|
||||
&& !(root.solidPanel && !plasmoid.configuration.panelShadows) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
property int appShadowOpacity: (plasmoid.configuration.shadowOpacity/100) * 255
|
||||
property int appShadowSize: enableShadows ? (0.4*root.iconSize) * (plasmoid.configuration.shadowSize/100) : 0
|
||||
@ -567,12 +582,12 @@ DragDrop.DropArea {
|
||||
return;
|
||||
}
|
||||
} else if (dock.mimeContainsPlasmoid(event.mimeData, "audoban.applet.separator")
|
||||
&& root.latteAppletContainer.containsPos(event)) {
|
||||
confirmedDragEntered = true
|
||||
dndSpacer.opacity = 0;
|
||||
dndSpacer.parent = root;
|
||||
return;
|
||||
}
|
||||
&& root.latteAppletContainer.containsPos(event)) {
|
||||
confirmedDragEntered = true
|
||||
dndSpacer.opacity = 0;
|
||||
dndSpacer.parent = root;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!latteApplet || (latteApplet && !dock.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) {
|
||||
@ -1774,8 +1789,8 @@ DragDrop.DropArea {
|
||||
readonly property color minimizedDotColor: themeTextColorLuma > 0.6 ? Qt.darker(theme.textColor, 1.7) : Qt.lighter(theme.textColor, 7)
|
||||
|
||||
property bool isShown: active && !forceSolidPanel
|
||||
//! when forceSemiTransparentPanel is enabled because of snapped or maximized etc. windows
|
||||
//! then the colorizer could be enabled for low panel transparency levels (<40%)
|
||||
//! when forceSemiTransparentPanel is enabled because of snapped or maximized etc. windows
|
||||
//! then the colorizer could be enabled for low panel transparency levels (<40%)
|
||||
&& (!userShowPanelBackground || !forceSemiTransparentPanel || (forceSemiTransparentPanel && root.panelTransparency<40))
|
||||
&& !maximizedWindowTitleBarBehavesAsPanelBackground
|
||||
&& (plasmoid.configuration.solidBackgroundForMaximized || plasmoid.configuration.backgroundOnlyOnMaximized)
|
||||
|
Loading…
x
Reference in New Issue
Block a user