mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-09 05:57:39 +03:00
fix #22, expose timers through settings
This commit is contained in:
parent
cd66ede669
commit
935fb8c10d
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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@"
|
||||
}
|
||||
}
|
||||
|
||||
|
77
shell/contents/configuration/LatteTextField.qml
Normal file
77
shell/contents/configuration/LatteTextField.qml
Normal file
@ -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("<none>")
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user