improve appearance of dock type buttons area

pull/2/head
Michail Vourlakos 7 years ago
parent fd99f8c325
commit d1a8d0a20f

@ -49,6 +49,9 @@ FocusScope {
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
property int subGroupSpacing: units.largeSpacing + units.smallSpacing * 1.5 property int subGroupSpacing: units.largeSpacing + units.smallSpacing * 1.5
property color bC: theme.backgroundColor
property color transparentBackgroundColor: Qt.rgba(bC.r, bC.g, bC.b, 0.7)
PlasmaCore.FrameSvgItem{ PlasmaCore.FrameSvgItem{
anchors.fill: parent anchors.fill: parent
imagePath: "dialogs/background" imagePath: "dialogs/background"
@ -56,7 +59,7 @@ FocusScope {
TypeSelection{ TypeSelection{
x: dialog.width/2 - width/2 x: dialog.width/2 - width/2
y: plasmoid.configuration.advanced ? 0 : -height-18 y: plasmoid.configuration.advanced ? -marginHeight : -height
Behavior on y { Behavior on y {
NumberAnimation { duration: plasmoid.configuration.durationTime*units.longDuration } NumberAnimation { duration: plasmoid.configuration.durationTime*units.longDuration }
@ -319,11 +322,7 @@ FocusScope {
width: maxWidth - units.smallSpacing width: maxWidth - units.smallSpacing
height: behaviorPage.Layout.maximumHeight + units.smallSpacing * 4 height: behaviorPage.Layout.maximumHeight + units.smallSpacing * 4
property color bC: theme.backgroundColor color: transparentBackgroundColor
property color transparentBack: Qt.rgba(bC.r, bC.g, bC.b, 0.7)
color: transparentBack
border.width: 1 border.width: 1
border.color: theme.backgroundColor border.color: theme.backgroundColor

@ -29,71 +29,86 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte import org.kde.latte 0.1 as Latte
Row { Rectangle {
id: typeRow width: typeRow.width + 2*marginWidth
spacing: 1 height: typeRow.height + 2*marginHeight
readonly property bool isPanel: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) property int marginHeight: 0.3 * typeRow.height
&& (plasmoid.configuration.useThemePanel) && (plasmoid.configuration.panelSize===100) property int marginWidth: 0.5 * typeRow.height
&& (plasmoid.configuration.zoomLevel === 0) && !plasmoid.configuration.autoDecreaseIconSize
layer.enabled: true color: transparentBackgroundColor
border.width: 1
border.color: theme.backgroundColor
Row {
id: typeRow
anchors.centerIn: parent
spacing: 1
readonly property bool isPanel: (plasmoid.configuration.panelPosition === Latte.Dock.Justify)
&& (plasmoid.configuration.useThemePanel) && (plasmoid.configuration.panelSize===100)
&& (plasmoid.configuration.zoomLevel === 0) && !plasmoid.configuration.autoDecreaseIconSize
/*layer.enabled: true
layer.effect: DropShadow { layer.effect: DropShadow {
radius: 6 radius: dockTypeButton.height / 10
samples: 2 * radius samples: radius
color: "#000000" color: "#0a0a0a"
horizontalOffset: -1 horizontalOffset: -1
} //opacity: 0.5
}*/
ExclusiveGroup { ExclusiveGroup {
id: dockTypeGroup id: dockTypeGroup
} }
PlasmaComponents.Button {
id: dockTypeButton
width: dialog.width / 6
checkable: true
checked: !typeRow.isPanel
text: i18nc("dock type","Dock")
exclusiveGroup: dockTypeGroup
tooltip: i18n("Change the behavior and appearance to Dock type")
PlasmaComponents.Button { onPressedChanged: {
id: dockTypeButton if (pressed && !checked) {
width: dialog.width / 6 dock.visibility.mode = Latte.Dock.DodgeActive;
checkable: true plasmoid.configuration.panelPosition = Latte.Dock.Center;
checked: !typeRow.isPanel plasmoid.configuration.useThemePanel = true;
text: i18nc("dock type","Dock") plasmoid.configuration.solidPanel = false;
exclusiveGroup: dockTypeGroup plasmoid.configuration.panelSize = 0;
tooltip: i18n("Change the behavior and appearance to Dock type") plasmoid.configuration.shadows = 2;
plasmoid.configuration.zoomLevel = 16;
onPressedChanged: { plasmoid.configuration.autoDecreaseIconSize = true;
if (pressed && !checked) { plasmoid.configuration.shrinkThickMargins = false;
dock.visibility.mode = Latte.Dock.DodgeActive; }
plasmoid.configuration.panelPosition = Latte.Dock.Center;
plasmoid.configuration.useThemePanel = true;
plasmoid.configuration.solidPanel = false;
plasmoid.configuration.panelSize = 0;
plasmoid.configuration.shadows = 2;
plasmoid.configuration.zoomLevel = 16;
plasmoid.configuration.autoDecreaseIconSize = true;
plasmoid.configuration.shrinkThickMargins = false;
} }
} }
}
PlasmaComponents.Button { PlasmaComponents.Button {
id: panelTypeButton id: panelTypeButton
width: dockTypeButton.width width: dockTypeButton.width
checkable: true checkable: true
checked: typeRow.isPanel checked: typeRow.isPanel
text: i18nc("panel type","Panel") text: i18nc("panel type","Panel")
exclusiveGroup: dockTypeGroup exclusiveGroup: dockTypeGroup
tooltip: i18n("Change the behavior and appearance to Panel type") tooltip: i18n("Change the behavior and appearance to Panel type")
onPressedChanged: { onPressedChanged: {
if (pressed && !checked) { if (pressed && !checked) {
dock.visibility.mode = Latte.Dock.AlwaysVisible; dock.visibility.mode = Latte.Dock.AlwaysVisible;
plasmoid.configuration.panelPosition = Latte.Dock.Justify; plasmoid.configuration.panelPosition = Latte.Dock.Justify;
plasmoid.configuration.useThemePanel = true; plasmoid.configuration.useThemePanel = true;
plasmoid.configuration.solidPanel = false; plasmoid.configuration.solidPanel = false;
plasmoid.configuration.panelSize = 100; plasmoid.configuration.panelSize = 100;
plasmoid.configuration.panelShadows = true; plasmoid.configuration.panelShadows = true;
plasmoid.configuration.shadows = 0; plasmoid.configuration.shadows = 0;
plasmoid.configuration.zoomLevel = 0; plasmoid.configuration.zoomLevel = 0;
plasmoid.configuration.autoDecreaseIconSize = false; plasmoid.configuration.autoDecreaseIconSize = false;
plasmoid.configuration.shrinkThickMargins = true; plasmoid.configuration.shrinkThickMargins = true;
}
} }
} }
} }

Loading…
Cancel
Save