diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml
index 92048dc6..fe842a9e 100644
--- a/containment/package/contents/config/main.xml
+++ b/containment/package/contents/config/main.xml
@@ -1,261 +1,269 @@
0
10
64
15
true
-1
true
0
true
false
100
false
true
true
true
true
false
false
false
-1
-1
2
70
30
080808
false
1
false
30
1
0
100
0
2
0
1
0
false
false
+
+ 100
+
+
+
+ 100
+
+
false
false
false
2
0
true
false
false
false
false
true
false
false
true
true
true
true
true
diff --git a/shell/package/contents/configuration/AppearanceConfig.qml b/shell/package/contents/configuration/AppearanceConfig.qml
index 3f870cde..11796a26 100644
--- a/shell/package/contents/configuration/AppearanceConfig.qml
+++ b/shell/package/contents/configuration/AppearanceConfig.qml
@@ -1,1270 +1,1270 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import QtQuick.Dialogs 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
import "../controls" as LatteExtraControls
PlasmaComponents.Page {
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
Timer {
id: syncGeometry
running: false
repeat: false
interval: 400
onTriggered: dockConfig.syncGeometry()
}
ColumnLayout {
id: content
- width: dialog.maxWidth - Layout.leftMargin * 2
+ width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
spacing: dialog.subGroupSpacing
anchors.horizontalCenter: parent.horizontalCenter
Layout.leftMargin: units.smallSpacing * 2
//! BEGIN: Layout
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.topMargin: units.smallSpacing
visible: plasmoid.configuration.advanced
Header {
text: i18n("Layout")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
PlasmaComponents3.ComboBox {
id: layoutCmb
Layout.fillWidth: true
property var layoutTexts: [];
property var layouts;
Component.onCompleted: loadLayouts();
Connections {
target:layoutManager
onMenuLayoutsChanged: layoutCmb.loadLayouts();
}
function loadLayouts(){
layouts = layoutManager.menuLayouts;
layoutTexts = [];
//if current layout isnt at the menu layouts
if (layouts.indexOf(layoutManager.currentLayoutName) === -1) {
if (Qt.application.layoutDirection === Qt.RightToLeft) {
layoutTexts.push( layoutManager.currentLayoutName + " ✔ ");
} else {
layoutTexts.push( " ✔ "+layoutManager.currentLayoutName);
}
}
var activeLayout = 0;
for(var i=0; i128) {
to = plasmoid.configuration.iconSize + 64
} else {
to = 128
}
}
Component.onDestruction: {
valueChanged.disconnect(updateIconSize);
}
}
PlasmaComponents.Label {
text: appletsSizeSlider.value + " px."
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
enabled: plasmoid.configuration.durationTime > 0
PlasmaComponents.Label {
text: i18n("Zoom On Hover")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
Layout.fillWidth: true
id: zoomSlider
value: Number(1 + plasmoid.configuration.zoomLevel / 20).toFixed(2)
from: 1
to: 2
stepSize: 0.05
wheelEnabled: false
function updateZoomLevel() {
if (!pressed) {
var result = Math.round((value - 1) * 20)
plasmoid.configuration.zoomLevel = result
}
}
onPressedChanged: {
updateZoomLevel()
}
Component.onCompleted: {
valueChanged.connect(updateZoomLevel)
}
Component.onDestruction: {
valueChanged.disconnect(updateZoomLevel)
}
}
PlasmaComponents.Label {
text: Number((zoomSlider.value * 100) - 100).toFixed(0) + "%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced || plasmoid.configuration.proportionIconSize>0
PlasmaComponents.Label {
text: i18n("Screen Height Proportion")
horizontalAlignment: Text.AlignLeft
enabled: proportionSizeSlider.value !== proportionSizeSlider.from
}
LatteExtraControls.Slider {
id: proportionSizeSlider
Layout.fillWidth: true
value: plasmoid.configuration.proportionIconSize
from: 1.0
to: 10
stepSize: 0.5
wheelEnabled: false
function updateProportionIconSize() {
if (!pressed) {
if(value===1) {
plasmoid.configuration.proportionIconSize = -1;
} else {
plasmoid.configuration.proportionIconSize = value;
}
}
}
onPressedChanged: {
updateProportionIconSize();
}
Component.onCompleted: {
valueChanged.connect(updateProportionIconSize)
}
Component.onDestruction: {
valueChanged.disconnect(updateProportionIconSize)
}
}
PlasmaComponents.Label {
text: proportionSizeSlider.value !== proportionSizeSlider.from ?
proportionSizeSlider.value.toFixed(1) + "%" : "---%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
enabled: proportionSizeSlider.value !== proportionSizeSlider.from
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced
PlasmaComponents.Label {
text: i18n("Applets Distance")
horizontalAlignment: Text.AlignLeft
enabled: iconMarginSlider.value > 0
}
LatteExtraControls.Slider {
id: iconMarginSlider
Layout.fillWidth: true
value: plasmoid.configuration.iconMargin
from: 0
to: 100
stepSize: 5
wheelEnabled: false
onPressedChanged: {
if (!pressed) {
plasmoid.configuration.iconMargin = value;
}
}
}
PlasmaComponents.Label {
text: iconMarginSlider.value.toFixed(1) + "%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
enabled: iconMarginSlider.value > 0
}
}
}
//! END: Applet Size
//! BEGIN: Background
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
enabled: Latte.WindowSystem.compositingActive
Header {
text: i18n("Background")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
PlasmaComponents.CheckBox {
id: showBackground
text: i18nc("show panel","Show")
checked: plasmoid.configuration.useThemePanel
onClicked: {
plasmoid.configuration.useThemePanel = checked
}
}
PlasmaComponents.Label {
text: " | "
horizontalAlignment: Text.AlignLeft
opacity: 0.35
}
PlasmaComponents.Label {
enabled: showBackground.checked
text: i18n("Size")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
id: panelSizeSlider
Layout.fillWidth: true
enabled: showBackground.checked
value: plasmoid.configuration.panelSize
from: 0
to: 100
stepSize: 5
wheelEnabled: false
function updatePanelSize() {
if (!pressed)
plasmoid.configuration.panelSize = value
}
onPressedChanged: {
updatePanelSize();
}
Component.onCompleted: {
valueChanged.connect(updatePanelSize)
}
Component.onDestruction: {
valueChanged.disconnect(updatePanelSize)
}
}
PlasmaComponents.Label {
enabled: showBackground.checked
text: panelSizeSlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
visible: plasmoid.configuration.advanced
PlasmaComponents.Label {
text: i18n("Opacity")
horizontalAlignment: Text.AlignLeft
enabled: transparencySlider.enabled
}
LatteExtraControls.Slider {
id: transparencySlider
Layout.fillWidth: true
//! transparency can be set when the user doesnt want solidness all the time
//! or when the user wants solidness only for maximized windows
enabled: showBackground.checked && !blockOpacityAdjustment
value: plasmoid.configuration.panelTransparency
from: 0
to: 100
stepSize: 5
wheelEnabled: false
property bool blockOpacityAdjustment: (plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized)
|| (solidBackground.checked
&& !plasmoid.configuration.solidBackgroundForMaximized
&& !plasmoid.configuration.backgroundOnlyOnMaximized)
function updatePanelTransparency() {
if (!pressed)
plasmoid.configuration.panelTransparency = value
}
onPressedChanged: {
updatePanelTransparency();
}
Component.onCompleted: {
valueChanged.connect(updatePanelTransparency);
}
Component.onDestruction: {
valueChanged.disconnect(updatePanelTransparency);
}
}
PlasmaComponents.Label {
enabled: transparencySlider.enabled
text: transparencySlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 2
visible: plasmoid.configuration.advanced
PlasmaComponents.Button {
id: panelShadows
Layout.fillWidth: true
text: i18n("Shadows")
checked: plasmoid.configuration.panelShadows
checkable: true
enabled: showBackground.checked
onClicked: {
plasmoid.configuration.panelShadows = checked
}
}
PlasmaComponents.Button {
id: solidBackground
Layout.fillWidth: true
text: i18n("Solid")
checked: plasmoid.configuration.solidPanel
checkable: true
enabled: showBackground.checked
onClicked: {
plasmoid.configuration.solidPanel = checked
}
}
}
}
//! END: Background
//! BEGIN: Animations
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
enabled: Latte.WindowSystem.compositingActive
Header {
text: i18n("Animations")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 2
property int duration: plasmoid.configuration.durationTime
ExclusiveGroup {
id: animationsGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.durationTime = current.duration
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("None")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 0
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x1")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 1
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x2")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 2
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x3")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 3
}
}
}
//! END: Animations
//! BEGIN: Active Indicator
ColumnLayout{
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Active Indicator")
}
GridLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
rowSpacing: units.smallSpacing * 2
columnSpacing: 1
columns: 5
property int indicatorType: plasmoid.configuration.activeIndicatorType
property int activeIndicator: plasmoid.configuration.activeIndicator
ExclusiveGroup {
id: activeIndicatorTypeGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.activeIndicatorType = current.indicatorType;
}
}
ExclusiveGroup {
id: activeIndicatorGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.activeIndicator = current.activeIndicator
}
}
PlasmaComponents.Label {
text: i18nc("active indicator style","Style")
horizontalAlignment: Text.AlignLeft
visible: plasmoid.configuration.advanced
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("line indicator","Line")
checked: parent.indicatorType === indicatorType
checkable: true
exclusiveGroup: activeIndicatorTypeGroup
tooltip: i18n("Show a line indicator for active tasks/applets")
readonly property int indicatorType: Latte.Dock.LineIndicator
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("dot indicator", "Dot")
checked: parent.indicatorType === indicatorType
checkable: true
exclusiveGroup: activeIndicatorTypeGroup
tooltip: i18n("Show a dot indicator for active tasks/applets")
readonly property int indicatorType: Latte.Dock.DotIndicator
}
PlasmaComponents.Label{
text:" | "
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("reverse the position of the active indicator e.g. from bottom to top", "Reverse")
checked: plasmoid.configuration.reverseLinesPosition
checkable: true
tooltip: i18n("Reverse the position of the active indicator e.g. from bottom to top")
onClicked: {
plasmoid.configuration.reverseLinesPosition = checked;
}
}
PlasmaComponents.Label {
text: i18n("Applets") + " "
horizontalAlignment: Text.AlignLeft
visible: plasmoid.configuration.advanced
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("active indicator to no applets", "None")
checked: parent.activeIndicator === activeIndicator
checkable: true
exclusiveGroup: activeIndicatorGroup
visible: plasmoid.configuration.advanced
tooltip: i18n("Latte will not show any active applet indicator on its own\n except those the plasma theme provides")
readonly property int activeIndicator: Latte.Dock.NoneIndicator
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("active indicator only to in-house latte applets", "Internals")
checked: parent.activeIndicator === activeIndicator
checkable: true
exclusiveGroup: activeIndicatorGroup
visible: plasmoid.configuration.advanced
tooltip: i18n("Latte will show active applet indicators only for applets that have been adjusted\n by it for hovering capabilities e.g. folderview")
readonly property int activeIndicator: Latte.Dock.InternalsIndicator
}
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.columnSpan: 2
text: i18nc("active indicator to all applets", "All")
checked: parent.activeIndicator === activeIndicator
checkable: true
exclusiveGroup: activeIndicatorGroup
visible: plasmoid.configuration.advanced
tooltip: i18n("Latte will show active applet indicators for all applets")
readonly property int activeIndicator: Latte.Dock.AllIndicator
}
}
}
//! END: Active Indicator
//! BEGIN: Glow
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced
Header {
text: i18n("Glow")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 2
ColumnLayout{
RowLayout {
Layout.fillWidth: true
spacing: 2
PlasmaComponents.CheckBox {
id: showGlowChk
text: i18nc("show glow","Show")
checked: plasmoid.configuration.showGlow
onClicked: {
plasmoid.configuration.showGlow = checked
}
}
PlasmaComponents.Label {
text: " | "
horizontalAlignment: Text.AlignLeft
opacity: 0.35
enabled: showGlowChk.checked
}
property int option: plasmoid.configuration.glowOption
ExclusiveGroup {
id: glowGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.glowOption = current.option
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("add glow only to active task/applet indicators","Only On Active")
checked: parent.option === option
checkable: true
enabled: showGlowChk.checked
exclusiveGroup: glowGroup
tooltip: i18n("Add glow only to active task/applet indicator")
readonly property int option: Latte.Dock.GlowOnlyOnActive
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("Add glow to all task/applet indicators","All")
checked: parent.option === option
checkable: true
enabled: showGlowChk.checked
exclusiveGroup: glowGroup
tooltip: i18n("Add glow to all task/applet indicators")
readonly property int option: Latte.Dock.GlowAll
}
}
RowLayout{
PlasmaComponents.Label {
enabled: showGlowChk.checked
text: i18n("Opacity")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
id: glowOpacitySlider
Layout.fillWidth: true
enabled: showGlowChk.checked
value: plasmoid.configuration.glowOpacity
from: 0
to: 100
stepSize: 5
wheelEnabled: false
function updateGlowOpacity() {
if (!pressed)
plasmoid.configuration.glowOpacity = value;
}
onPressedChanged: {
updateGlowOpacity();
}
Component.onCompleted: {
valueChanged.connect(updateGlowOpacity);
}
Component.onDestruction: {
valueChanged.disconnect(updateGlowOpacity);
}
}
PlasmaComponents.Label {
enabled: showGlowChk.checked
text: glowOpacitySlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
PlasmaComponents.Label {
text: " | "
horizontalAlignment: Text.AlignLeft
enabled: showGlowChk.checked
opacity: 0.35
}
PlasmaComponents.CheckBox {
id: showGlow3D
Layout.leftMargin: units.smallSpacing * 2
text: " " + i18n("3D")
checked: plasmoid.configuration.glow3D
enabled: showGlowChk.checked
tooltip: i18n("Use a 3D style glow")
onClicked: {
plasmoid.configuration.glow3D = checked;
}
}
}
}
}
}
//! END: Glow
//! BEGIN: Shadows
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced
Header {
text: i18n("Applet shadows")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 2
ColumnLayout{
PlasmaComponents.CheckBox {
id: showAppletShadow
text: i18nc("show applet shadow","Show")
checked: plasmoid.configuration.shadows>0
onClicked: {
if (checked)
plasmoid.configuration.shadows = 2;
else
plasmoid.configuration.shadows = 0;
}
}
PlasmaComponents.Button{
id: backColorBtn
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.maximumWidth: showAppletShadow.width
text:" "
enabled: showAppletShadow.checked
PlasmaComponents3.ComboBox {
id: restoreCmb
anchors.fill: parent
enabled: backColorBtn.enabled
function addModel() {
var actions = [];
actions.push(i18nc("Use theme shadow","Theme"));
actions.push(i18nc("Clear applet shadow settings","Clear"));
restoreCmb.model = actions;
restoreCmb.currentIndex = -1;
}
function emptyModel() {
var actions = []
actions.push(" ");
restoreCmb.model = actions;
restoreCmb.currentIndex = -1;
}
Component.onCompleted:{
addModel();
}
onActivated: {
if (index===0) {
var strC = String(theme.textColor);
if (strC.indexOf("#") === 0)
plasmoid.configuration.shadowColor = strC.substr(1);
}else if (index===1){
plasmoid.configuration.shadowColor = "080808";
}
if (index===0 || index===1) {
plasmoid.configuration.shadowSize = 20;
plasmoid.configuration.shadowOpacity = 100;
}
restoreCmb.currentIndex = -1;
}
onCurrentIndexChanged: {
if (currentIndex === 0)
currentIndex = -1;
}
onEnabledChanged: {
if (enabled)
addModel();
else
emptyModel();
}
}
//overlayed button
PlasmaComponents.Button {
id: colorBtn
width: parent.width - units.iconSizes.medium + 2*units.smallSpacing
height: parent.height
text: " "
enabled: showAppletShadow.checked
onClicked: {
dockConfig.setSticker(true);
colorDialogLoader.showDialog = true;
}
Rectangle{
anchors.fill: parent
anchors.margins: 1.5*units.smallSpacing
color: "#" + plasmoid.configuration.shadowColor;
opacity: colorBtn.enabled ? 1 : 0.4
Rectangle{
anchors.fill: parent
color: "transparent"
border.width: 1
border.color: theme.textColor
opacity: 0.7
}
}
Loader{
id:colorDialogLoader
property bool showDialog: false
active: showDialog
sourceComponent: ColorDialog {
title: i18n("Please choose shadow color")
showAlphaChannel: false
onAccepted: {
//console.log("You chose: " + String(color));
var strC = String(color);
if (strC.indexOf("#") === 0)
plasmoid.configuration.shadowColor = strC.substr(1);
colorDialogLoader.showDialog = false;
dockConfig.setSticker(false);
}
onRejected: {
colorDialogLoader.showDialog = false;
dockConfig.setSticker(false);
}
Component.onCompleted: {
color = String("#" + plasmoid.configuration.shadowColor);
visible = true;
}
}
}
}
}
}
ColumnLayout {
RowLayout{
PlasmaComponents.Label {
text: " | "
horizontalAlignment: Text.AlignLeft
opacity: 0.35
}
PlasmaComponents.Label {
enabled: showAppletShadow.checked
text: i18n("Opacity")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
id: shadowOpacitySlider
Layout.fillWidth: true
enabled: showAppletShadow.checked
value: plasmoid.configuration.shadowOpacity
from: 0
to: 100
stepSize: 5
wheelEnabled: false
function updateShadowOpacity() {
if (!pressed)
plasmoid.configuration.shadowOpacity = value;
}
onPressedChanged: {
updateShadowOpacity();
}
Component.onCompleted: {
valueChanged.connect(updateShadowOpacity);
}
Component.onDestruction: {
valueChanged.disconnect(updateShadowOpacity);
}
}
PlasmaComponents.Label {
enabled: showAppletShadow.checked
text: shadowOpacitySlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout{
PlasmaComponents.Label {
text: " | "
horizontalAlignment: Text.AlignLeft
opacity: 0.35
}
PlasmaComponents.Label {
enabled: showAppletShadow.checked
text: i18n("Size")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
id: shadowSizeSlider
Layout.fillWidth: true
enabled: showAppletShadow.checked
value: plasmoid.configuration.shadowSize
from: 0
to: 100
stepSize: 5
wheelEnabled: false
function updateShadowSize() {
if (!pressed)
plasmoid.configuration.shadowSize = value;
}
onPressedChanged: {
updateShadowSize();
}
Component.onCompleted: {
valueChanged.connect(updateShadowSize);
}
Component.onDestruction: {
valueChanged.disconnect(updateShadowSize);
}
}
PlasmaComponents.Label {
enabled: showAppletShadow.checked
text: shadowSizeSlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
}
}
}
//! END: Shadows
//! BEGIN: Length
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced
Header {
text: i18n("Length")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
PlasmaComponents.Label {
text: i18n("Maximum")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
Layout.fillWidth: true
id: maxLengthSlider
value: plasmoid.configuration.maxLength
from: 30
to: 100
stepSize: 2
wheelEnabled: false
function updateMaxLength() {
if (!pressed) {
plasmoid.configuration.maxLength = value;
var newTotal = Math.abs(plasmoid.configuration.offset) + value;
//centered and justify alignments based on offset and get out of the screen in some cases
var centeredCheck = ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify))
&& ((Math.abs(plasmoid.configuration.offset) + value/2) > 50);
if (newTotal > 100 || centeredCheck) {
if ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify)) {
var suggestedValue = (plasmoid.configuration.offset<0) ? Math.min(0, -(100-value)): Math.max(0, 100-value);
if ((Math.abs(suggestedValue) + value/2) > 50) {
if (suggestedValue < 0) {
suggestedValue = - (50 - value/2);
} else {
suggestedValue = 50 - value/2;
}
}
plasmoid.configuration.offset = suggestedValue;
} else {
plasmoid.configuration.offset = Math.max(0, 100-value);
}
}
}
}
onPressedChanged: {
updateMaxLength();
}
Component.onCompleted: {
valueChanged.connect(updateMaxLength)
}
Component.onDestruction: {
valueChanged.disconnect(updateMaxLength)
}
}
PlasmaComponents.Label {
text: maxLengthSlider.value + "%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
PlasmaComponents.Label {
text: i18n("Offset")
horizontalAlignment: Text.AlignLeft
}
LatteExtraControls.Slider {
Layout.fillWidth: true
id: offsetSlider
value: plasmoid.configuration.offset
from: ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify)) ? -20 : 0
to: ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify)) ? 20 : 40
stepSize: 2
wheelEnabled: false
function updateOffset() {
if (!pressed) {
plasmoid.configuration.offset = value;
var newTotal = Math.abs(value) + plasmoid.configuration.maxLength;
//centered and justify alignments based on offset and get out of the screen in some cases
var centeredCheck = ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify))
&& ((Math.abs(value) + plasmoid.configuration.maxLength/2) > 50);
if (newTotal > 100 || centeredCheck) {
plasmoid.configuration.maxLength = ((plasmoid.configuration.panelPosition === Latte.Dock.Center)
|| (plasmoid.configuration.panelPosition === Latte.Dock.Justify)) ?
2*(50 - Math.abs(value)) :100 - Math.abs(value);
}
}
}
onPressedChanged: {
updateOffset();
}
Component.onCompleted: {
valueChanged.connect(updateOffset);
}
Component.onDestruction: {
valueChanged.disconnect(updateOffset);
}
}
PlasmaComponents.Label {
text: offsetSlider.value + "%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
}
}
}
//! END: Length
PlasmaComponents.Label{
id: bottomMarginSpacer
text:" "
}
}
}
diff --git a/shell/package/contents/configuration/BehaviorConfig.qml b/shell/package/contents/configuration/BehaviorConfig.qml
index 2d7f03bc..d9339fab 100644
--- a/shell/package/contents/configuration/BehaviorConfig.qml
+++ b/shell/package/contents/configuration/BehaviorConfig.qml
@@ -1,508 +1,508 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
import "../controls" as LatteExtraControls
PlasmaComponents.Page {
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
property alias dockTypeSelection: _dockTypeSelection
ColumnLayout {
id: content
- width: dialog.maxWidth - 2 * Layout.leftMargin
+ width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
spacing: dialog.subGroupSpacing
anchors.horizontalCenter: parent.horizontalCenter
Layout.leftMargin: units.smallSpacing * 2
//! BEGIN: Inline Dock/Panel Type, it is used only when the secondary window
//! overlaps the main dock config window
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
visible: plasmoid.configuration.advanced && dockConfig.showInlineProperties
Header {
text: i18n("Type")
}
TypeSelection{
id: _dockTypeSelection
horizontal: true
}
}
//! END: Inline Dock/Panel Type
//! BEGIN: Location
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
Header {
text: i18n("Location")
}
RowLayout {
id: screenRow
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 1
visible: true
function updateScreens() {
if (dock.screens.length > 1)
screenRow.visible = true;
else
screenRow.visible = false;
var screens = []
var rtlSpace = Qt.application.layoutDirection === Qt.RightToLeft ? " " : "";
screens.push(rtlSpace + i18n("On Primary"));
//check if the screen exists, it is used in cases Latte is moving
//the dock automatically to primaryScreen in order for the user
//to has always a dock with tasks shown
var screenExists = false
for (var i = 0; i < dock.screens.length; i++) {
if (dock.screens[i].name === dock.currentScreen)
screenExists = true;
}
if (!screenExists && !dock.onPrimary)
screens.push(rtlSpace + dock.currentScreen);
for (var i = 0; i < dock.screens.length; i++) {
screens.push(rtlSpace + dock.screens[i].name)
}
screenCmb.model = screens;
if (dock.onPrimary) {
screenCmb.currentIndex = 0;
} else {
screenCmb.currentIndex = screenCmb.find(dock.currentScreen);
}
console.log(dock.currentScreen);
}
Connections{
target: dockConfig
onShowSignal: screenRow.updateScreens();
}
PlasmaComponents.Label {
text: i18n("Screen:")
Layout.alignment: Qt.AlignRight
}
PlasmaComponents3.ComboBox {
id: screenCmb
Layout.fillWidth: true
Component.onCompleted: screenRow.updateScreens();
//they are used to restore the index when the screen edge
//is occuppied
property bool acceptedIndex: true
property int previousIndex: -1
onCurrentIndexChanged: {
//it is used to restore the index when the screen edge
//is occuppied
if (!acceptedIndex) {
acceptedIndex = true;
currentIndex = previousIndex;
}
}
onActivated: {
previousIndex = currentIndex;
if (index === 0) {
var succeed = dock.setCurrentScreen("primary");
dock.onPrimary = true;
acceptedIndex = true;
} else if (index>0 && (index !== find(dock.currentScreen) || dock.onPrimary)) {
console.log("current index changed!!! :"+ index);
console.log("screen must be changed...");
var succeed = dock.setCurrentScreen(textAt(index));
if(succeed) {
dock.onPrimary = false;
} else {
console.log("the edge is already occupied!!!");
acceptedIndex = false;
}
}
}
}
}
RowLayout {
id: locationLayout
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
LayoutMirroring.enabled: false
spacing: 1
Connections{
target: dock
onDockLocationChanged: locationLayout.lockReservedEdges();
onDocksCountChanged: locationLayout.lockReservedEdges();
}
ExclusiveGroup {
id: locationGroup
property bool inStartup: true
onCurrentChanged: {
if (current.checked && !inStartup) {
dock.hideDockDuringLocationChange(current.edge);
}
inStartup = false;
}
}
function lockReservedEdges() {
var buttons = visibleChildren
var edges = dock.freeEdges()
for (var i = 0; i < buttons.length; i++) {
buttons[i].enabled = buttons[i].checked || freeEdge(buttons[i].edge, edges)
}
}
function freeEdge(edge, edges) {
for (var i = 0; i < edges.length; i++) {
if (edges[i] === edge)
return true
}
return false
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("bottom location", "Bottom")
iconSource: "arrow-down"
checked: dock.location === edge
checkable: true
enabled: checked || locationLayout.freeEdge(edge, dock.freeEdges())
exclusiveGroup: locationGroup
readonly property int edge: PlasmaCore.Types.BottomEdge
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("left location", "Left")
iconSource: "arrow-left"
checked: dock.location === edge
checkable: true
enabled: checked || locationLayout.freeEdge(edge, dock.freeEdges())
exclusiveGroup: locationGroup
readonly property int edge: PlasmaCore.Types.LeftEdge
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("top location", "Top")
iconSource: "arrow-up"
checked: dock.location === edge
checkable: true
enabled: checked || locationLayout.freeEdge(edge, dock.freeEdges())
exclusiveGroup: locationGroup
readonly property int edge: PlasmaCore.Types.TopEdge
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("right location", "Right")
iconSource: "arrow-right"
checked: dock.location === edge
checkable: true
enabled: checked || locationLayout.freeEdge(edge, dock.freeEdges())
exclusiveGroup: locationGroup
readonly property int edge: PlasmaCore.Types.RightEdge
}
}
}
//! END: Location
//! BEGIN: Alignment
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Alignment")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
LayoutMirroring.enabled: false
spacing: 1
property int panelPosition: plasmoid.configuration.panelPosition
onPanelPositionChanged: {
if (panelPosition === Latte.Dock.Justify)
dock.addInternalViewSplitter()
else
dock.removeInternalViewSplitter()
}
Component.onCompleted: {
if (panelPosition === Latte.Dock.Justify)
dock.addInternalViewSplitter()
else
dock.removeInternalViewSplitter()
}
ExclusiveGroup {
id: alignmentGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.panelPosition = current.position
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: panelIsVertical ? i18nc("top alignment", "Top") : i18nc("left alignment", "Left")
iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: panelIsVertical ? Latte.Dock.Top : Latte.Dock.Left
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("center alignment", "Center")
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: Latte.Dock.Center
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: panelIsVertical ? i18nc("bottom alignment", "Bottom") : i18nc("right alignment", "Right")
iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: panelIsVertical ? Latte.Dock.Bottom : Latte.Dock.Right
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("justify alignment", "Justify")
iconSource: "format-justify-fill"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: Latte.Dock.Justify
}
}
}
//! END: Alignment
//! BEGIN: Visibility
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Visibility")
}
GridLayout {
width: parent.width
rowSpacing: 1
columnSpacing: 1
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
columns: 2
property int mode: dock.visibility.mode
ExclusiveGroup {
id: visibilityGroup
onCurrentChanged: {
if (current.checked)
dock.visibility.mode = current.mode
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Always Visible")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.AlwaysVisible
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Auto Hide")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.AutoHide
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge Active")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.DodgeActive
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge Maximized")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.DodgeMaximized
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge All Windows")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.DodgeAllWindows
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Windows Go Below")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Dock.WindowsGoBelow
}
}
}
//! END: Visibility
//! BEGIN: Delay
ColumnLayout {
Layout.fillWidth: true
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
enabled: !(dock.visibility.mode === Latte.Dock.AlwaysVisible
|| dock.visibility.mode === Latte.Dock.WindowsGoBelow)
Header {
Layout.fillWidth: true
text: i18n("Delay")
}
RowLayout {
Layout.fillWidth: false
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
Layout.alignment: Qt.AlignHCenter
spacing: 2
PlasmaComponents.Label {
Layout.fillWidth: false
Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing
Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0
horizontalAlignment: Text.AlignRight
text: i18n("Show")
}
LatteExtraControls.TextField {
Layout.preferredWidth: width
text: dock.visibility.timerShow
onValueChanged: {
dock.visibility.timerShow = value
}
}
PlasmaComponents.Label {
Layout.fillWidth: false
Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ?
units.smallSpacing : units.largeSpacing
Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ?
units.largeSpacing : units.smallSpacing
horizontalAlignment: Text.AlignRight
text: i18n("Hide")
}
LatteExtraControls.TextField{
Layout.preferredWidth: width
text: dock.visibility.timerHide
onValueChanged: {
dock.visibility.timerHide = value
}
}
}
}
//! END: Delay
PlasmaComponents.Label{
id: bottomMarginSpacer
text:" "
}
}
}
diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml
index 82c640fb..771f1e6c 100644
--- a/shell/package/contents/configuration/LatteDockConfiguration.qml
+++ b/shell/package/contents/configuration/LatteDockConfiguration.qml
@@ -1,531 +1,595 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import QtQuick.Controls.Styles.Plasma 2.0 as Styles
import org.kde.plasma.plasmoid 2.0
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons
import org.kde.latte 0.1 as Latte
import "../controls" as LatteExtraControls
FocusScope {
id: dialog
- property int maxWidth: Math.max(200, 0.87 * proposedHeight)
+ property int proposedWidth: Math.max(200, 0.87 * proposedHeight) + units.smallSpacing * 2
property int proposedHeight: Math.min(dock.screenGeometry.height - dock.normalThickness - 2*units.largeSpacing,
Math.max(400, 36 * theme.mSize(theme.defaultFont).height))
- width: maxWidth + units.smallSpacing * 2
- height: proposedHeight
+ property int userScaleWidth: plasmoid.configuration.windowWidthScale
+ property int userScaleHeight: plasmoid.configuration.windowHeightScale
+
+ property int appliedWidth: userScaleWidth !== 100 ? Math.max(200, (userScaleWidth/100) * proposedWidth) : proposedWidth
+ property int appliedHeight: userScaleHeight !== 100 ? Math.max(400, (userScaleHeight/100) * proposedHeight) : proposedHeight
+
+ width: appliedWidth
+ height: appliedHeight
Layout.minimumWidth: width
Layout.minimumHeight: height
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
readonly property bool dockIsPanel: behaviorPage.dockTypeSelection.isPanel
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
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{
anchors.fill: parent
imagePath: "dialogs/background"
enabledBorders: dockConfig.enabledBorders
}
+ MouseArea{
+ id: backgroundMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ property bool blockWheel: false
+ property bool wheelTriggeredOnce: false
+ property int scaleStep: 4
+
+ onContainsMouseChanged: {
+ if (!containsMouse) {
+ wheelTriggeredOnce = false;
+ }
+ }
+
+ onWheel: {
+ if (blockWheel || !(wheel.modifiers & Qt.MetaModifier)){
+ return;
+ }
+
+ blockWheel = true;
+ wheelTriggeredOnce = true;
+ scrollDelayer.start();
+
+ var angle = wheel.angleDelta.y / 8;
+
+ //positive direction
+ if (angle > 12) {
+ plasmoid.configuration.windowWidthScale = plasmoid.configuration.windowWidthScale + scaleStep;
+ plasmoid.configuration.windowHeightScale = plasmoid.configuration.windowHeightScale + scaleStep;
+ dockConfig.syncGeometry();
+ //negative direction
+ } else if (angle < -12) {
+ plasmoid.configuration.windowWidthScale = plasmoid.configuration.windowWidthScale - scaleStep;
+ plasmoid.configuration.windowHeightScale = plasmoid.configuration.windowHeightScale - scaleStep;
+ dockConfig.syncGeometry();
+ }
+ }
+ }
+
+ PlasmaComponents.Label{
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: i18nc("dock settings window scale","Window scale at %0%").arg(userScaleWidth)
+ visible: backgroundMouseArea.containsMouse && backgroundMouseArea.wheelTriggeredOnce
+ }
+
+ //! A timer is needed in order to handle also touchpads that probably
+ //! send too many signals very fast. This way the signals per sec are limited.
+ //! The user needs to have a steady normal scroll in order to not
+ //! notice a annoying delay
+ Timer{
+ id: scrollDelayer
+
+ interval: 300
+ onTriggered: backgroundMouseArea.blockWheel = false;
+ }
+
ColumnLayout {
id: content
Layout.minimumWidth: width
Layout.minimumHeight: calculatedHeight
Layout.preferredWidth: width
Layout.preferredHeight: calculatedHeight
- width: dialog.maxWidth
+ width: (dialog.appliedWidth - units.smallSpacing * 2)
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: units.smallSpacing
property int calculatedHeight: header.height + headerSpacer.height+ tabBar.height + pagesBackground.height + actionButtons.height + spacing * 3
Keys.onPressed: {
if (event.key === Qt.Key_Escape) {
dockConfig.hideConfigWindow();
} else if (event.key === Qt.Key_Left) {
//
if (tabGroup.currentTab === behaviorPage) {
if (plasmoid.configuration.advanced) {
tabGroup.currentTab = tweaksPage;
tabBar.currentTab = tweaksTabBtn;
} else if (tasksTabBtn.visible) {
tabGroup.currentTab = tasksPage;
tabBar.currentTab = tasksTabBtn;
} else {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
}
} else if (tabGroup.currentTab === tweaksPage) {
if (tasksTabBtn.visible) {
tabGroup.currentTab = tasksPage;
tabBar.currentTab = tasksTabBtn;
} else {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
}
} else if (tabGroup.currentTab === tasksPage) {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
} else if (tabGroup.currentTab === appearancePage) {
tabGroup.currentTab = behaviorPage;
tabBar.currentTab = behaviorTabBtn;
}
//
} else if (event.key === Qt.Key_Right) {
//
if (tabGroup.currentTab === behaviorPage) {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
} else if (tabGroup.currentTab === appearancePage) {
if (tasksTabBtn.visible) {
tabGroup.currentTab = tasksPage;
tabBar.currentTab = tasksTabBtn;
} else if (plasmoid.configuration.advanced) {
tabGroup.currentTab = tweaksPage;
tabBar.currentTab = tweaksTabBtn;
} else {
tabGroup.currentTab = behaviorPage;
tabBar.currentTab = behaviorTabBtn;
}
} else if (tabGroup.currentTab === tasksPage) {
if (plasmoid.configuration.advanced) {
tabGroup.currentTab = tweaksPage;
tabBar.currentTab = tweaksTabBtn;
} else {
tabGroup.currentTab = behaviorPage;
tabBar.currentTab = behaviorTabBtn;
}
} else if (tabGroup.currentTab === tweaksPage) {
tabGroup.currentTab = behaviorPage;
tabBar.currentTab = behaviorTabBtn;
}
//
}
}
Component.onCompleted: forceActiveFocus();
RowLayout {
id: header
Layout.fillWidth: true
spacing: 0
Item {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: false
Layout.topMargin: units.smallSpacing
Layout.preferredWidth: width
Layout.preferredHeight: height
width: Qt.application.layoutDirection !== Qt.RightToLeft ? logo.width + latteTxt.width + units.smallSpacing : logo.width + units.smallSpacing
height: logo.height
LatteExtraControls.ToolTip{
parent: logo
text: i18n("Open Latte settings window")
visible: aboutMouseArea.containsMouse
delay: 7 * units.longDuration
}
Latte.IconItem {
id: logo
width: Math.round(1.4 * latteTxtMetrics.font.pixelSize)
height: width
smooth: true
source: "latte-dock"
// animated: true
usesPlasmaTheme: false
active: aboutMouseArea.containsMouse
}
PlasmaComponents.Label {
id: latteTxtMetrics
text: "Latte"
width: 0
font.pointSize: 2 * theme.defaultFont.pointSize
visible: false
}
PlasmaCore.SvgItem{
id: latteTxt
width: 2.2 * height
height: 0.4 * latteTxtMetrics.font.pixelSize
visible: Qt.application.layoutDirection !== Qt.RightToLeft
anchors.left: logo.right
anchors.verticalCenter: logo.verticalCenter
svg: PlasmaCore.Svg{
imagePath: universalSettings.trademarkIconPath()
}
}
MouseArea {
id: aboutMouseArea
acceptedButtons: Qt.LeftButton
anchors.fill: parent
hoverEnabled: true
readonly property int preferencesPage: Latte.Dock.PreferencesPage
onClicked: layoutManager.showLatteSettingsDialog(preferencesPage)
}
}
Item{
id: headerSpacer
Layout.minimumHeight: advancedSettings.height + 2*units.smallSpacing
}
ColumnLayout {
PlasmaComponents.ToolButton {
id: pinButton
Layout.fillWidth: false
Layout.fillHeight: false
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.bottomMargin: units.smallSpacing * 3
//!avoid editMode box shadow
Layout.topMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing
iconSource: "window-pin"
checkable: true
width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onClicked: {
plasmoid.configuration.configurationSticker = checked
dockConfig.setSticker(checked)
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker
dockConfig.setSticker(plasmoid.configuration.configurationSticker)
}
}
RowLayout {
id: advancedSettings
Layout.fillWidth: true
Layout.rightMargin: units.smallSpacing * 2
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
PlasmaComponents.Label {
Layout.fillWidth: true
Layout.alignment: Qt.AlignRight
}
PlasmaComponents.Label {
text: i18n("Advanced")
Layout.alignment: Qt.AlignRight
opacity: plasmoid.configuration.advanced ? 1 : 0.3
MouseArea {
anchors.fill: parent
onClicked: {
plasmoid.configuration.advanced = !advancedSwitch.checked;
advancedSwitch.checked = plasmoid.configuration.advanced;
}
}
}
Switch {
id: advancedSwitch
checked: plasmoid.configuration.advanced
onPressedChanged: {
if(pressed)
plasmoid.configuration.advanced = !checked;
}
style: Styles.SwitchStyle {
property bool checked: advancedSwitch.checked
}
onCheckedChanged: {
if (!checked && tabGroup.currentTab === tweaksPage) {
if (tasksTabBtn.visible) {
tabGroup.currentTab = tasksPage;
tabBar.currentTab = tasksTabBtn;
} else {
tabGroup.currentTab = appearancePage;
tabBar.currentTab = appearanceTabBtn;
}
}
if (checked) {
dockConfig.createSecondaryWindow();
} else {
dockConfig.deleteSecondaryWindow();
}
}
}
}
}
}
PlasmaComponents.TabBar {
id: tabBar
Layout.fillWidth: true
- Layout.maximumWidth: maxWidth
+ Layout.maximumWidth: (dialog.appliedWidth - units.smallSpacing * 2)
PlasmaComponents.TabButton {
id: behaviorTabBtn
text: i18n("Behavior")
tab: behaviorPage
}
PlasmaComponents.TabButton {
id: appearanceTabBtn
text: i18n("Appearance")
tab: appearancePage
}
PlasmaComponents.TabButton {
id: tasksTabBtn
text: i18n("Tasks")
tab: tasksPage
visible: dock.latteTasksPresent()
}
PlasmaComponents.TabButton {
id: tweaksTabBtn
text: i18n("Tweaks")
tab: tweaksPage
visible: plasmoid.configuration.advanced
}
}
Rectangle {
id: pagesBackground
Layout.fillWidth: true
Layout.fillHeight: false
- Layout.minimumWidth: maxWidth - 2*units.smallSpacing
+ Layout.minimumWidth: dialog.appliedWidth - units.smallSpacing * 4
Layout.minimumHeight: height
Layout.maximumHeight: height
- width: maxWidth - units.smallSpacing
+ width: dialog.appliedWidth - units.smallSpacing * 3
height: availableFreeHeight + units.smallSpacing * 4
color: transparentBackgroundColor
border.width: 1
border.color: theme.backgroundColor
//fix the height binding loop when showing the configuration window
- property int availableFreeHeight: dialog.proposedHeight - header.height - headerSpacer.height - tabBar.height - actionButtons.height - 2 * units.smallSpacing
+ property int availableFreeHeight: dialog.appliedHeight - header.height - headerSpacer.height - tabBar.height - actionButtons.height - 2 * units.smallSpacing
PlasmaExtras.ScrollArea {
id: scrollArea
anchors.fill: parent
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
flickableItem.flickableDirection: Flickable.VerticalFlick
PlasmaComponents.TabGroup {
id: tabGroup
width: currentTab.Layout.maximumWidth
height: currentTab.Layout.maximumHeight
BehaviorConfig {
id: behaviorPage
}
AppearanceConfig {
id: appearancePage
}
TasksConfig {
id: tasksPage
}
TweaksConfig {
id: tweaksPage
}
}
}
}
RowLayout {
id: actionButtons
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
spacing: units.largeSpacing
Connections{
target: dock
onDocksCountChanged: actionButtons.updateEnabled();
}
function updateEnabled() {
addDock.enabled = dock.docksCount < 4 && dock.freeEdges().length > 0
removeDock.enabled = dock.docksCount>1 && !(dock.docksWithTasks()===1 && dock.tasksPresent())
}
PlasmaComponents.Button {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
text:" "
PlasmaComponents3.ComboBox {
id: actionsCmb
anchors.fill: parent
enabled: addDock.enabled
property var activeLayoutsNames;
function addModel() {
var actions = []
actions.push(" " + i18n("Copy Dock"));
var tempActiveLayouts = layoutManager.activeLayoutsNames();
var currentLayoutIndex = tempActiveLayouts.indexOf(dock.managedLayout.name);
tempActiveLayouts.splice(currentLayoutIndex,1);
if (tempActiveLayouts.length > 0) {
activeLayoutsNames = tempActiveLayouts;
actions.push(" ------ ");
for(var i=0; i=2) {
dock.hideDockDuringMovingToLayout(activeLayoutsNames[index-2]);
}
actionsCmb.currentIndex = -1;
}
onEnabledChanged: {
if (enabled)
addModel();
else
emptyModel();
}
}
//overlayed button
PlasmaComponents.Button {
id: addDock
anchors.left: Qt.application.layoutDirection === Qt.RightToLeft ? undefined : parent.left
anchors.right: Qt.application.layoutDirection === Qt.RightToLeft ? parent.right : undefined
LayoutMirroring.enabled: false
width: parent.width - units.iconSizes.medium + 2*units.smallSpacing
height: parent.height
text: i18n("New Dock")
iconSource: "list-add"
tooltip: i18n("Add a new dock")
onClicked: dock.addNewDock()
Component.onCompleted: {
enabled = dock.freeEdges().length > 0
}
}
}
PlasmaComponents.Button {
id: removeDock
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
text: i18n("Remove")
iconSource: "edit-delete"
opacity: dock.totalDocksCount > 1 ? 1 : 0
tooltip: i18n("Remove current dock")
onClicked: dock.removeDock()
}
PlasmaComponents.Button {
id: closeButton
Layout.fillWidth: true
Layout.alignment: Qt.AlignRight
text: i18n("Close")
iconSource: "dialog-close"
tooltip: i18n("Close settings window")
onClicked: dockConfig.hideConfigWindow();
}
}
}
}
diff --git a/shell/package/contents/configuration/TasksConfig.qml b/shell/package/contents/configuration/TasksConfig.qml
index 1605258f..9819ff74 100644
--- a/shell/package/contents/configuration/TasksConfig.qml
+++ b/shell/package/contents/configuration/TasksConfig.qml
@@ -1,390 +1,390 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page {
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
property bool disableAllWindowsFunctionality: plasmoid.configuration.showWindowsOnlyFromLaunchers
&& plasmoid.configuration.activeIndicator === Latte.Dock.NoneIndicator
ColumnLayout {
id: content
- width: dialog.maxWidth - Layout.leftMargin * 2
+ width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
spacing: dialog.subGroupSpacing
anchors.horizontalCenter: parent.horizontalCenter
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
//! BEGIN: Tasks Appearance
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
enabled: !disableAllWindowsFunctionality
Header {
text: i18n("Appearance")
}
PlasmaComponents.CheckBox {
id: threeColorsWindows
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Different color for minimized windows")
checked: plasmoid.configuration.threeColorsWindows
onClicked: {
plasmoid.configuration.threeColorsWindows = checked
}
}
PlasmaComponents.CheckBox {
id: dotsOnActive
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Indicator for active window group")
checked: plasmoid.configuration.dotsOnActive
tooltip: i18n("Grouped windows show both a line and a dot when \none of them is active and the Line Active Indicator \nis enabled")
visible: plasmoid.configuration.advanced
enabled: plasmoid.configuration.activeIndicatorType === Latte.Dock.LineIndicator
onClicked: {
plasmoid.configuration.dotsOnActive = checked
}
}
}
//! END: Tasks Appearance
//! BEGIN: Tasks Interaction
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Interaction")
}
PlasmaComponents.CheckBox {
id: showPreviewsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Preview windows on hovering")
checked: plasmoid.configuration.showToolTips
enabled: !disableAllWindowsFunctionality
onClicked: {
plasmoid.configuration.showToolTips = checked;
}
}
PlasmaComponents.CheckBox {
id: highlightWindowsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Highlight windows on hovering")
checked: plasmoid.configuration.highlightWindows
visible: plasmoid.configuration.advanced
enabled: !disableAllWindowsFunctionality
onClicked: {
plasmoid.configuration.highlightWindows = checked
}
}
PlasmaComponents.CheckBox {
id: smartLaunchersChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show progress information for tasks")
checked: plasmoid.configuration.smartLaunchersEnabled
tooltip: i18n("Show a beautiful progress animation e.g. when copying \nfiles with Dolphin")
onClicked: {
plasmoid.configuration.smartLaunchersEnabled = checked
}
}
PlasmaComponents.CheckBox {
id: windowActionsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show window actions in the context menu")
checked: plasmoid.configuration.showWindowActions
visible: plasmoid.configuration.advanced
enabled: !disableAllWindowsFunctionality
onClicked: {
plasmoid.configuration.showWindowActions = checked
}
}
PlasmaComponents.CheckBox {
id: audioIndicatorChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show indicator for audio streams")
checked: plasmoid.configuration.indicateAudioStreams
tooltip: i18n("Audio indicator from which the user can mute/unmute an app")
visible: plasmoid.configuration.advanced
onClicked: {
plasmoid.configuration.indicateAudioStreams = checked
}
}
PlasmaComponents.CheckBox {
id: groupTasksChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Group tasks of the same application")
checked: plasmoid.configuration.groupTasksByDefault
tooltip: i18n("By default group tasks of the same application")
visible: plasmoid.configuration.advanced
onClicked: {
plasmoid.configuration.groupTasksByDefault = checked
}
}
PlasmaComponents.CheckBox {
id: unifyGlobalShortcutsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Unify global shortcuts with applets")
checked: plasmoid.configuration.unifiedGlobalShortcuts
tooltip: i18n("Global shortcuts are used both from applets and tasks")
visible: plasmoid.configuration.advanced
onClicked: {
plasmoid.configuration.unifiedGlobalShortcuts = checked
}
}
PlasmaComponents.CheckBox {
id: mouseWheelChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Activate tasks through mouse wheel")
checked: plasmoid.configuration.mouseWheelActions
tooltip: i18n("Enable/Disable the mouse wheel actions in order to cycle through tasks")
visible: plasmoid.configuration.advanced
onClicked: {
plasmoid.configuration.mouseWheelActions = checked
}
}
RowLayout {
Layout.leftMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing * 3
visible: plasmoid.configuration.advanced
enabled: !disableAllWindowsFunctionality
PlasmaComponents.Label {
text: i18n("On middle-click")
Layout.alignment: Qt.AlignRight
}
PlasmaComponents3.ComboBox {
id: middleClickAction
Layout.fillWidth: true
model: [i18nc("The click action", "None"), i18n("Close Window or Group"),
i18n("New Instance"), i18n("Minimize/Restore Window or Group"), i18n("Cycle Through Tasks"), i18n("Toggle Task Grouping")]
currentIndex: plasmoid.configuration.middleClickAction
onCurrentIndexChanged: plasmoid.configuration.middleClickAction = currentIndex
}
}
RowLayout {
Layout.leftMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
spacing: units.smallSpacing
visible: plasmoid.configuration.advanced
enabled: !disableAllWindowsFunctionality
PlasmaComponents3.ComboBox {
id: modifier
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 5
model: ["Shift", "Ctrl", "Alt", "Meta"]
currentIndex: plasmoid.configuration.modifier
onCurrentIndexChanged: plasmoid.configuration.modifier = currentIndex
}
PlasmaComponents.Label {
text: "+"
}
PlasmaComponents3.ComboBox {
id: modifierClick
Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 10
model: [i18n("Left Click"), i18n("Middle Click"), i18n("Right Click")]
currentIndex: plasmoid.configuration.modifierClick
onCurrentIndexChanged: plasmoid.configuration.modifierClick = currentIndex
}
PlasmaComponents.Label {
text: "="
}
PlasmaComponents3.ComboBox {
id: modifierClickAction
Layout.fillWidth: true
model: [i18nc("The click action", "None"), i18n("Close Window or Group"),
i18n("New Instance"), i18n("Minimize/Restore Window or Group"), i18n("Cycle Through Tasks"), i18n("Toggle Task Grouping")]
currentIndex: plasmoid.configuration.modifierClickAction
onCurrentIndexChanged: plasmoid.configuration.modifierClickAction = currentIndex
}
}
}
//! END: Tasks Interaction
//! BEGIN: Launchers Group
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Launchers Group")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 2
property int group: plasmoid.configuration.launchersGroup
ExclusiveGroup {
id: launchersGroup
onCurrentChanged: {
if (current.checked) {
dockConfig.updateLaunchersForGroup(current.group);
plasmoid.configuration.launchersGroup = current.group;
}
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("unique launchers group","Unique")
checked: parent.group === group
checkable: true
exclusiveGroup: launchersGroup
tooltip: i18n("Use a unique set of launchers for this dock which is independent from any other dock")
readonly property int group: Latte.Dock.UniqueLaunchers
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("layout launchers group","Layout")
checked: parent.group === group
checkable: true
exclusiveGroup: launchersGroup
tooltip: i18n("Use the current layout set of launchers for this dock. This group provides launchers synchronization between different docks in the same layout")
visible: plasmoid.configuration.advanced || plasmoid.configuration.launchersGroup === group;
readonly property int group: Latte.Dock.LayoutLaunchers
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("global launchers group","Global")
checked: parent.group === group
checkable: true
exclusiveGroup: launchersGroup
tooltip: i18n("Use the global set of launchers for this dock. This group provides launchers synchronization between different docks and between different layouts")
readonly property int group: Latte.Dock.GlobalLaunchers
}
}
}
//! END: Launchers Group
//! BEGIN: Tasks Filters
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Filters")
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentScreen
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show only tasks from the current screen")
checked: plasmoid.configuration.showOnlyCurrentScreen
onClicked: {
plasmoid.configuration.showOnlyCurrentScreen = checked
}
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentDesktop
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show only tasks from the current desktop")
checked: plasmoid.configuration.showOnlyCurrentDesktop
onClicked: {
plasmoid.configuration.showOnlyCurrentDesktop = checked
}
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentActivity
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show only tasks from the current activity")
checked: plasmoid.configuration.showOnlyCurrentActivity
onClicked: {
plasmoid.configuration.showOnlyCurrentActivity = checked
}
}
PlasmaComponents.CheckBox {
id: showWindowsOnlyFromLaunchersChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show only tasks from launchers")
checked: plasmoid.configuration.showWindowsOnlyFromLaunchers
visible: plasmoid.configuration.advanced
onClicked: {
plasmoid.configuration.showWindowsOnlyFromLaunchers = checked
}
}
}
//! END: Tasks Filters
PlasmaComponents.Label{
id: bottomMarginSpacer
text:" "
}
}
}
diff --git a/shell/package/contents/configuration/TweaksConfig.qml b/shell/package/contents/configuration/TweaksConfig.qml
index bd5639fb..4697d7ad 100644
--- a/shell/package/contents/configuration/TweaksConfig.qml
+++ b/shell/package/contents/configuration/TweaksConfig.qml
@@ -1,283 +1,283 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page {
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
ColumnLayout {
id: content
- width: dialog.maxWidth - Layout.leftMargin * 2
+ width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
spacing: dialog.subGroupSpacing
anchors.horizontalCenter: parent.horizontalCenter
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
//! BEGIN: Appearance
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
Header {
text: i18n("Appearance")
}
PlasmaComponents.CheckBox {
id: blurPanel
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Blur for panel background")
checked: plasmoid.configuration.blurEnabled
onClicked: {
plasmoid.configuration.blurEnabled = checked
}
}
PlasmaComponents.CheckBox {
id: titleTooltipsChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show applets/task title tooltips on hovering")
checked: plasmoid.configuration.titleTooltips
onClicked: {
plasmoid.configuration.titleTooltips = checked;
}
}
PlasmaComponents.CheckBox {
id: shrinkThickness
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Shrink thickness margins to minimum")
checked: plasmoid.configuration.shrinkThickMargins
onClicked: {
plasmoid.configuration.shrinkThickMargins = checked
}
}
}
//! END: Appearance
//! BEGIN: Dynamic Background
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
enabled: Latte.WindowSystem.compositingActive
Header {
text: i18n("Dynamic Background")
}
PlasmaComponents.CheckBox {
id: solidForMaximizedChk
Layout.leftMargin: units.smallSpacing * 2
- Layout.maximumWidth: dialog.maxWidth - 3*units.smallSpacing
+ Layout.maximumWidth: (dialog.appliedWidth - units.smallSpacing * 2) - 3*units.smallSpacing
text: i18n("Force solid background for maximized or snapped windows")
checked: plasmoid.configuration.solidBackgroundForMaximized
tooltip: i18n("The panel background removes its transparency setting \n when there is a maximized or snapped window")
style: LatteCheckBoxStyle{}
onClicked: {
plasmoid.configuration.solidBackgroundForMaximized = 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: colorizeTransparentPanelsChk
Layout.leftMargin: units.smallSpacing * 2
Layout.bottomMargin: units.smallSpacing
- Layout.maximumWidth: dialog.maxWidth - 3*units.smallSpacing
+ Layout.maximumWidth: (dialog.appliedWidth - units.smallSpacing * 2) - units.smallSpacing * 3
text: i18n("Monochrome 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{}
enabled: solidForMaximizedChk.checked || onlyOnMaximizedChk.checked
onClicked: {
plasmoid.configuration.colorizeTransparentPanels = checked;
}
}
PlasmaComponents.CheckBox {
id: hideShadowsOnMaximizedChk
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Hide panel shadow for maximized windows")
checked: plasmoid.configuration.disablePanelShadowForMaximized
onClicked: {
plasmoid.configuration.disablePanelShadowForMaximized = checked;
}
}
}
//! END: Dynamic Background
//! BEGIN: Behavior
ColumnLayout {
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Behavior")
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Activate KWin edge after hiding")
checked: dock.visibility.enableKWinEdges
onCheckedChanged: {
dock.visibility.enableKWinEdges = checked;
}
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Decrease applets size when it is needed")
checked: plasmoid.configuration.autoDecreaseIconSize
tooltip: i18n("Applets size is decreased automatically when the contents \nexceed the maximum length \n\nHint: this option is disabled when only plasma taskmanagers are present")
enabled: !(dock.tasksPresent() && !dock.latteTasksPresent());
onClicked: {
plasmoid.configuration.autoDecreaseIconSize = checked
}
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Add launchers only in the corresponding area")
checked: plasmoid.configuration.addLaunchersInTaskManager
tooltip: i18n("Launchers are added only in the taskmanager and not as plasma applets")
onClicked: {
plasmoid.configuration.addLaunchersInTaskManager = checked;
}
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Behave as a normal dock window")
checked: dock.dockWinBehavior
enabled: !(dock.visibility.mode === Latte.Dock.AlwaysVisible
|| dock.visibility.mode === Latte.Dock.WindowsGoBelow)
tooltip: i18n("Remove the BypassWindowManagerHint flag from the window.\nThe dock wont be above windows which are set at 'Always On Top'")
onCheckedChanged: {
dock.dockWinBehavior = checked
}
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Raise on desktop change")
checked: dock.visibility.raiseOnDesktop
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
onClicked: {
dock.visibility.raiseOnDesktop = checked
}
}
PlasmaComponents.CheckBox {
Layout.leftMargin: units.smallSpacing * 2
text: i18n("Raise on activity change")
checked: dock.visibility.raiseOnActivity
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
onClicked: {
dock.visibility.raiseOnActivity = checked
}
}
}
//! END: Behavior
//! BEGIN: Extra Actions
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.rightMargin: units.smallSpacing * 2
Header {
text: i18n("Extra Actions")
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
spacing: units.smallSpacing
PlasmaComponents.Button {
iconSource: "distribute-horizontal-x"
text: i18n("Add Spacer")
Layout.minimumWidth: 0.5 * (content.width - 5 * units.smallSpacing)
Layout.maximumWidth: Layout.minimumWidth
Layout.alignment: Qt.AlignLeft
tooltip: i18n("Add a spacer to separate applets")
onClicked: {
dockConfig.addPanelSpacer()
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
iconSource: "edit-delete"
text: i18n("Remove Tasks Applet")
enabled: dock.tasksPresent()
tooltip: i18n("Remove Latte Tasks plasmoid")
onClicked: {
dock.removeTasksPlasmoid();
}
}
}
}
//! END: Extra Actions
PlasmaComponents.Label{
id: bottomMarginSpacer
text:" "
}
}
}