diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index fe5d2e2fe..b24c304ee 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -407,9 +407,6 @@ DragDrop.DropArea { dock.onWidthChanged.connect(visibilityManager.updateMaskArea); dock.onHeightChanged.connect(visibilityManager.updateMaskArea); - dock.visibility.timerShow = 300; - dock.visibility.timerHide = 1000; - dock.visibility.onContainsMouseChanged.connect(visibilityManager.slotContainsMouseChanged); dock.visibility.onMustBeHide.connect(visibilityManager.slotMustBeHide); dock.visibility.onMustBeShown.connect(visibilityManager.slotMustBeShown); diff --git a/shell/contents/configuration/BehaviorConfig.qml b/shell/contents/configuration/BehaviorConfig.qml index 37b85801d..eeb135136 100644 --- a/shell/contents/configuration/BehaviorConfig.qml +++ b/shell/contents/configuration/BehaviorConfig.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 @@ -156,7 +156,7 @@ PlasmaComponents.Page{ spacing: 0.8*theme.defaultFont.pointSize Header{ - text: i18n("Applets Alignment") + text: i18n("Alignment") } //user set Panel Positions @@ -397,5 +397,65 @@ PlasmaComponents.Page{ } } } + + Column{ + width:parent.width + spacing: 0.8*theme.defaultFont.pointSize + Header{ + text: i18n("Delay") + } + + GridLayout{ + columns: 2 + columnSpacing: 0.3*theme.defaultFont.pointSize + width: parent.width + + Row{ + Layout.alignment: Qt.AlignHCenter + PlasmaComponents.Label{ + text: i18n("Hide:") + } + + LatteTextField{ + width: 9.5 * theme.defaultFont.pixelSize + property bool inStartup: true + + Component.onCompleted: { + value = dock.visibility.timerHide + inStartup = false; + } + + onValueChanged: { + if(!inStartup){ + dock.visibility.timerHide = value; + } + } + } + } + + Row{ + Layout.alignment: Qt.AlignHCenter + PlasmaComponents.Label{ + text: i18n("Show:") + } + + LatteTextField{ + width: 9.5 * theme.defaultFont.pixelSize + property bool inStartup: true + + Component.onCompleted: { + value = dock.visibility.timerShow + inStartup = false; + } + + onValueChanged: { + if(!inStartup){ + dock.visibility.timerShow = value; + } + } + } + } + } + } } } diff --git a/shell/contents/configuration/LatteDockConfiguration.qml.cmake b/shell/contents/configuration/LatteDockConfiguration.qml.cmake index 46505ff91..e069b7a9c 100644 --- a/shell/contents/configuration/LatteDockConfiguration.qml.cmake +++ b/shell/contents/configuration/LatteDockConfiguration.qml.cmake @@ -18,7 +18,7 @@ PlasmaCore.FrameSvgItem { //old way to count the dialog width //Math.max(420,appearancePage.noneShadow.width + appearancePage.lockedAppletsShadow.width + appearancePage.allAppletsShadow.width) - width: 31*theme.defaultFont.pixelSize + width: 33*theme.defaultFont.pixelSize height: 37*theme.defaultFont.pixelSize property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical @@ -60,16 +60,16 @@ PlasmaCore.FrameSvgItem { PlasmaComponents.Label{ id: verLabel - font.family: "serif" - font.pointSize: theme.defaultFont.pointSize - font.italic: true - opacity: 0.6 + font.family: "monospace" + font.pointSize: 0.8 * theme.defaultFont.pointSize + font.bold: true + opacity: 0.4 - Layout.alignment: Qt.AlignRight + Layout.alignment: Qt.AlignRight | Qt.AlignTop horizontalAlignment: Text.AlignRight Layout.fillWidth: true - text: i18n("ver: ") +"@VERSION@" + text: i18n("ver:") +"@VERSION@" } } diff --git a/shell/contents/configuration/LatteTextField.qml b/shell/contents/configuration/LatteTextField.qml new file mode 100644 index 000000000..30fe0e13d --- /dev/null +++ b/shell/contents/configuration/LatteTextField.qml @@ -0,0 +1,77 @@ +import QtQuick 2.0 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 1.4 + +import org.kde.plasma.components 2.0 as PlasmaComponents + +PlasmaComponents.TextField{ + id: textField + validator: IntValidator {bottom: minValue; top: maxValue;} + text: value === 0 ? "" : value + font.italic: true + placeholderText: i18n("") + + property int step: 100 + property int value: 0 + + property int minValue: 0 + property int maxValue: 3000 + + + function confirmValue(val){ + var fixedVal = Math.min(maxValue, val); + + if (fixedVal < minValue) { + return minValue; + } else { + return fixedVal; + } + } + + onTextChanged: text !== "" ? value = parseInt(text) : value = 0; + + + Row{ + // width: 4 * theme.defaultFont.pixelSize + anchors.right: parent.right + anchors.rightMargin: 2 + anchors.verticalCenter: parent.verticalCenter + PlasmaComponents.Label{ + text: i18n("ms.") + font.italic: true + opacity: (value === 0) ? 0 : 0.6 + } + PlasmaComponents.Label{ + text: " " + font.italic: true + } + PlasmaComponents.Button{ + width: 2*theme.defaultFont.pixelSize - 4 + height: width + text:"-" + onClicked: value = confirmValue(value - step); + } + PlasmaComponents.Button{ + width: 2*theme.defaultFont.pixelSize - 4 + height: width + text:"+" + onClicked: value = confirmValue(value + step); + } + } + + MouseArea{ + anchors.fill: parent + acceptedButtons: Qt.AllButtons + + onWheel: { + var angle = wheel.angleDelta.y / 8 + + if (angle>0) { + value = confirmValue(value + step); + } else if (angle<0){ + value = confirmValue(value - step); + } + } + } + +}