mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-04 08:58:20 +03:00
fix #961,Semi-Tranparent Panels at ImproveVisibility
--update issue #957 in order to take into account semi-transparent panels. With semi-transparent panels contrast could be a puzzle. The changes that introduced with this patch are: 1. Enable Improve Visibility when also case [E] from #957 is enabled. 2. When a semi-transparent panel exists in combination with Improve Visibility option then add a threshold in order to indicate if the Colorizer will be applied or not. The threshold is 40% in order to indicate if a semi-transparent panel is solid or not.
This commit is contained in:
parent
5e4134b1ee
commit
2967eea11a
@ -85,6 +85,12 @@ DragDrop.DropArea {
|
||||
property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized && Latte.WindowSystem.compositingActive
|
||||
property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel && !visibilityManager.inTempHiding
|
||||
property bool editMode: editModeVisual.inEditMode
|
||||
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))
|
||||
&& Latte.WindowSystem.compositingActive
|
||||
|
||||
property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && dock && dock.visibility
|
||||
&& Latte.WindowSystem.compositingActive
|
||||
&&(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet)
|
||||
@ -93,7 +99,7 @@ DragDrop.DropArea {
|
||||
&& Latte.WindowSystem.compositingActive
|
||||
&& !(hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100)
|
||||
|
||||
property bool forceColorizer: plasmoid.configuration.colorizeTransparentPanels
|
||||
property bool forceColorizer: Latte.WindowSystem.compositingActive && plasmoid.configuration.colorizeTransparentPanels
|
||||
|
||||
readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) {
|
||||
return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.pluginName !== root.plasmoidName
|
||||
@ -1744,7 +1750,12 @@ DragDrop.DropArea {
|
||||
readonly property real themeBackgroundColorLuma: 0.2126*backColorRs + 0.7152*backColorGs + 0.0722*backColorBs
|
||||
readonly property real themeTextColorLuma: 0.2126*textColorRs + 0.7152*textColorGs + 0.0722*textColorBs
|
||||
|
||||
property bool isShown: active && !forceSolidPanel && plasmoid.configuration.solidBackgroundForMaximized && !root.editMode && Latte.WindowSystem.compositingActive
|
||||
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%)
|
||||
&& (!forceSemiTransparentPanel || (forceSemiTransparentPanel && root.panelTransparency<40))
|
||||
&& (plasmoid.configuration.solidBackgroundForMaximized || plasmoid.configuration.backgroundOnlyOnMaximized)
|
||||
&& !root.editMode && Latte.WindowSystem.compositingActive
|
||||
|
||||
property real currentBackgroundLuminas: -1000
|
||||
|
||||
|
@ -110,6 +110,18 @@ PlasmaComponents.Page {
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: onlyOnMaximizedChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Hide background for not maximized windows")
|
||||
checked: plasmoid.configuration.backgroundOnlyOnMaximized
|
||||
tooltip: i18n("The panel background becomes transparent except if \nthere is a maximized or snapped window")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.backgroundOnlyOnMaximized = checked;
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: colorizeTransparentPanelsChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
@ -120,25 +132,13 @@ PlasmaComponents.Page {
|
||||
tooltip: i18n("The panel contents are colorized in order to improve contrast \nwith the underlying desktop background when the panel is transparent")
|
||||
style: LatteCheckBoxStyle{}
|
||||
|
||||
enabled: solidForMaximizedChk.checked
|
||||
enabled: solidForMaximizedChk.checked || onlyOnMaximizedChk.checked
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.colorizeTransparentPanels = checked;
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: onlyOnMaximizedChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
text: i18n("Hide background for not maximized windows")
|
||||
checked: plasmoid.configuration.backgroundOnlyOnMaximized
|
||||
tooltip: i18n("The panel background becomes transparent except if \nthere is a maximized or snapped window")
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.backgroundOnlyOnMaximized = checked;
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: hideShadowsOnMaximizedChk
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user