mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-26 23:21:37 +03:00
support durationTime through the configuration
This commit is contained in:
parent
1d763d2652
commit
3723a2fd08
@ -66,5 +66,14 @@
|
||||
<entry name="reverseLinesPosition" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="durationTime" type="Enum">
|
||||
<choices>
|
||||
<choice name="None"/>
|
||||
<choice name="x1"/>
|
||||
<choice name="x2"/>
|
||||
<choice name="x3"/>
|
||||
</choices>
|
||||
<default>2</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
@ -82,7 +82,7 @@ DragDrop.DropArea {
|
||||
( plasmoid.configuration.panelPosition === Latte.Dock.Double ?
|
||||
Latte.Dock.Center :plasmoid.configuration.panelPosition )
|
||||
|
||||
property real zoomFactor: windowSystem.compositingActive ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
|
||||
property real zoomFactor: (windowSystem.compositingActive && durationTime>0) ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
|
||||
|
||||
readonly property string plasmoidName: "org.kde.latte.plasmoid"
|
||||
|
||||
@ -105,7 +105,7 @@ DragDrop.DropArea {
|
||||
property bool showGlow: plasmoid.configuration.showGlow
|
||||
property bool threeColorsWindows: plasmoid.configuration.threeColorsWindows
|
||||
|
||||
property int durationTime: nowDock ? nowDock.durationTime : 2
|
||||
property int durationTime: plasmoid.configuration.durationTime
|
||||
property int nowDockHoveredIndex: nowDock ? nowDock.hoveredIndex : -1
|
||||
property int iconMargin: nowDock ? nowDock.iconMargin : 0.12 * iconSize
|
||||
property int statesLineSize: nowDock ? nowDock.statesLineSize : 0
|
||||
|
@ -100,7 +100,7 @@ Item {
|
||||
property bool showGlow: nowDockPanel ? nowDockPanel.showGlow : plasmoid.configuration.showGlow
|
||||
property bool threeColorsWindows: nowDockPanel ? nowDockPanel.threeColorsWindows : plasmoid.configuration.threeColorsWindows
|
||||
|
||||
property int durationTime: plasmoid.configuration.durationTime
|
||||
property int durationTime: nowDockPanel ? nowDockPanel.durationTime : plasmoid.configuration.durationTime
|
||||
property int iconSize: nowDockPanel ? nowDockPanel.iconSize : Math.max(plasmoid.configuration.iconSize, 16)
|
||||
property int tasksHeight: mouseHandler.height
|
||||
property int tasksWidth: mouseHandler.width
|
||||
|
@ -90,6 +90,7 @@ PlasmaComponents.Page{
|
||||
Column{
|
||||
width: parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
enabled: plasmoid.configuration.durationTime > 0
|
||||
Header{
|
||||
text: i18n("Zoom On Hover")
|
||||
}
|
||||
@ -153,6 +154,114 @@ PlasmaComponents.Page{
|
||||
}
|
||||
}
|
||||
|
||||
/**Animations Speed***/
|
||||
|
||||
Column{
|
||||
width:parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
|
||||
Header{
|
||||
text: i18n("Animations")
|
||||
}
|
||||
|
||||
Flow{
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
|
||||
property bool inStartup: true
|
||||
property int duration: plasmoid.configuration.durationTime
|
||||
|
||||
onDurationChanged: updateDurationVisual();
|
||||
|
||||
Component.onCompleted: {
|
||||
updateDurationVisual();
|
||||
inStartup = false;
|
||||
}
|
||||
|
||||
function updateDurationVisual(){
|
||||
if(duration === 0){
|
||||
firstDuration.checked = true;
|
||||
secondDuration.checked = false;
|
||||
thirdDuration.checked = false;
|
||||
fourthDuration.checked = false;
|
||||
}
|
||||
else if(duration === 1){
|
||||
firstDuration.checked = false;
|
||||
secondDuration.checked = true;
|
||||
thirdDuration.checked = false;
|
||||
fourthDuration.checked = false;
|
||||
}
|
||||
else if(duration === 2){
|
||||
firstDuration.checked = false;
|
||||
secondDuration.checked = false;
|
||||
thirdDuration.checked = true;
|
||||
fourthDuration.checked = false;
|
||||
}
|
||||
else if(duration === 3){
|
||||
firstDuration.checked = false;
|
||||
secondDuration.checked = false;
|
||||
thirdDuration.checked = false;
|
||||
fourthDuration.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: firstDuration
|
||||
checkable: true
|
||||
text: i18n("None")
|
||||
width: (parent.width / 4) - 2
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 0;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: secondDuration
|
||||
checkable: true
|
||||
text: i18n("x1")
|
||||
width: (parent.width / 4) - 2
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 1;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: thirdDuration
|
||||
checkable: true
|
||||
text: i18n("x2")
|
||||
width: (parent.width / 4) - 2
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 2;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: fourthDuration
|
||||
checkable: true
|
||||
text: i18n("x3")
|
||||
width: (parent.width/4) - 1
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 3;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Column{
|
||||
width: parent.width
|
||||
@ -235,6 +344,7 @@ PlasmaComponents.Page{
|
||||
}
|
||||
}
|
||||
|
||||
/******Shadows**********/
|
||||
Column{
|
||||
width: parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
|
Loading…
Reference in New Issue
Block a user