enable monochrome panel for transparent panels

-- in dynamic background it might be important for
the user to increase the contrast because the textColor
from plasma theme and the background might not provide
readable contrast. This feature adds this by giving
to the user the choice to have as monochrome layout
when the panel is transparent to theme.backgroundColor
pull/2/head
Michail Vourlakos 7 years ago
parent 5db8c37cbf
commit 198ce090ef

@ -75,6 +75,9 @@
<entry name="solidBackgroundForMaximized" type="Bool">
<default>false</default>
</entry>
<entry name="colorizeTransparentPanels" type="Bool">
<default>false</default>
</entry>
<entry name="splitterPosition" type="Int">
<default>-1</default>
</entry>

@ -21,6 +21,7 @@
import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
@ -86,12 +87,14 @@ DragDrop.DropArea {
property bool editMode: editModeVisual.inEditMode
property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && dock && dock.visibility
&& Latte.WindowSystem.compositingActive
&&(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped)
&&(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet)
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
&& !(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped)
&& Latte.WindowSystem.compositingActive
&& !(hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100)
property bool forceColorizer: plasmoid.configuration.colorizeTransparentPanels
readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) {
return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.pluginName !== root.plasmoidName
&& item.status !== PlasmaCore.Types.HiddenStatus);
@ -1622,7 +1625,35 @@ DragDrop.DropArea {
VisibilityManager{ id: visibilityManager }
LayoutsContainer { id: layoutsContainer }
LayoutsContainer {
id: layoutsContainer
opacity: !layoutsColorizer.isShown ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
}
Loader{
id: layoutsColorizer
anchors.fill: layoutsContainer
active: forceColorizer
z: layoutsContainer.z + 1
property bool isShown: active && !forceSolidPanel && plasmoid.configuration.solidBackgroundForMaximized && !root.editMode
sourceComponent: ColorOverlay {
source: layoutsContainer
opacity: layoutsColorizer.isShown ? 1 : 0
color: theme.backgroundColor
}
}
///////////////END UI elements

@ -122,6 +122,20 @@ PlasmaComponents.Page {
}
}
PlasmaComponents.CheckBox {
id: colorizeTransparentPanelsChk
Layout.leftMargin: units.smallSpacing * 2
Layout.maximumWidth: dialog.maxWidth - 3*units.smallSpacing
text: i18n("Background color for contents when panel is transparent")
checked: plasmoid.configuration.colorizeTransparentPanels
tooltip: i18n("The panel contents are colorized in order to improve contrast \nwith the underlying desktop background when the panel is transparent")
style: LatteCheckBoxStyle{}
onClicked: {
plasmoid.configuration.colorizeTransparentPanels = checked;
}
}
PlasmaComponents.CheckBox {
id: hideShadowsOnMaximizedChk
Layout.leftMargin: units.smallSpacing * 2

Loading…
Cancel
Save