@@ -37,6 +37,7 @@ ColumnLayout {
3737 property var parentLayout
3838 property alias cfg_FillMode: videoFillMode .currentValue
3939 property alias cfg_PauseMode: pauseModeCombo .currentValue
40+ property alias cfg_AlternativePlaybackRateMode: alternativePlaybackRateMode .currentValue
4041 property alias cfg_BackgroundColor: colorButton .color
4142 property alias cfg_PauseBatteryLevel: pauseBatteryLevel .value
4243 property alias cfg_BatteryPausesVideo: batteryPausesVideoCheckBox .checked
@@ -55,10 +56,12 @@ ColumnLayout {
5556 property alias cfg_EffectsPauseVideo: effectsPauseVideoInput .text
5657 property alias cfg_EffectsShowBlur: effectsShowBlurInput .text
5758 property alias cfg_EffectsHideBlur: effectsHideBlurInput .text
59+ property alias cfg_EffectsAlternativeSpeed: effectsAlternativeSpeedInput .text
5860 property alias cfg_BlurAnimationDuration: blurAnimationDurationSpinBox .value
5961 property alias cfg_CrossfadeEnabled: crossfadeEnabledCheckbox .checked
6062 property alias cfg_CrossfadeDuration: crossfadeDurationSpinBox .value
6163 property real cfg_PlaybackRate
64+ property real cfg_AlternativePlaybackRate
6265 property alias cfg_Volume: volumeSlider .value
6366 property alias cfg_RandomMode: randomModeCheckbox .checked
6467 property alias cfg_ResumeLastVideo: resumeLastVideoCheckbox .checked
@@ -166,6 +169,7 @@ ColumnLayout {
166169 duration: item .duration ,
167170 customDuration: item .customDuration ,
168171 playbackRate: item .playbackRate ,
172+ alternativePlaybackRate: item .alternativePlaybackRate ,
169173 loop: item .loop
170174 });
171175 }
@@ -336,9 +340,6 @@ ColumnLayout {
336340 valueFromText : function (text , locale ) {
337341 return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
338342 }
339- onDisplayTextChanged: {
340- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
341- }
342343 }
343344 Button {
344345 visible: root .cfg_FillBlurRadius > 64
@@ -418,9 +419,6 @@ ColumnLayout {
418419 valueFromText : function (text , locale ) {
419420 return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
420421 }
421- onDisplayTextChanged: {
422- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
423- }
424422 }
425423 SpinBox {
426424 id: wallpaperTimerMinutes
@@ -442,9 +440,6 @@ ColumnLayout {
442440 valueFromText : function (text , locale ) {
443441 return parseInt (text);
444442 }
445- onDisplayTextChanged: {
446- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
447- }
448443 }
449444 SpinBox {
450445 id: wallpaperTimerSeconds
@@ -466,9 +461,6 @@ ColumnLayout {
466461 valueFromText : function (text , locale ) {
467462 return Number .fromLocaleString (locale, reExtractNum .exec (text)[0 ]);
468463 }
469- onDisplayTextChanged: {
470- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
471- }
472464 }
473465 }
474466
@@ -488,7 +480,7 @@ ColumnLayout {
488480 Kirigami .FormData .label : i18n (" Speed:" )
489481 visible: root .currentTab === 1
490482 Components .DoubleSpinBox {
491- id: playbackRateSlider
483+ id: playbackRateGlobal
492484 from: 0.01 * multiplier
493485 to: 2 * multiplier
494486 value: root .cfg_PlaybackRate * multiplier
@@ -497,7 +489,7 @@ ColumnLayout {
497489 " tnum" : 1
498490 }
499491 onValueModified: {
500- root .cfg_PlaybackRate = value / playbackRateSlider .multiplier ;
492+ root .cfg_PlaybackRate = value / playbackRateGlobal .multiplier ;
501493 }
502494 }
503495 Button {
@@ -541,9 +533,6 @@ ColumnLayout {
541533 valueFromText : function (text , locale ) {
542534 return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
543535 }
544- onDisplayTextChanged: {
545- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
546- }
547536 }
548537 Button {
549538 icon .name : " dialog-information-symbolic"
@@ -640,6 +629,21 @@ ColumnLayout {
640629 id: blurRadiusSpinBox
641630 from: 0
642631 to: 145
632+ font .features : {
633+ " tnum" : 1
634+ }
635+ readonly property regexp reExtractNum: / \D *? (-? \d * \. ? \d * )\D * $ /
636+
637+ validator: RegularExpressionValidator {
638+ regularExpression: blurRadiusSpinBox .reExtractNum
639+ }
640+
641+ textFromValue : function (value , locale ) {
642+ return i18n (" %1px" , value);
643+ }
644+ valueFromText : function (text , locale ) {
645+ return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
646+ }
643647 }
644648 Button {
645649 visible: blurRadiusSpinBox .visible && root .cfg_BlurRadius > 64
@@ -661,6 +665,76 @@ ColumnLayout {
661665 from: 0
662666 to: 9999
663667 stepSize: 100
668+ font .features : {
669+ " tnum" : 1
670+ }
671+
672+ readonly property regexp reExtractNum: / \D *? (-? \d * \. ? \d * )\D * $ /
673+
674+ validator: RegularExpressionValidator {
675+ regularExpression: blurAnimationDurationSpinBox .reExtractNum
676+ }
677+
678+ textFromValue : function (value , locale ) {
679+ return i18nc (" animation duration" , " %1ms" , value);
680+ }
681+ valueFromText : function (text , locale ) {
682+ return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
683+ }
684+ }
685+ }
686+
687+ ComboBox {
688+ id: alternativePlaybackRateMode
689+ Kirigami .FormData .label : i18n (" Alternative speed:" )
690+ model: [
691+ {
692+ text: i18n (" Maximized or full-screen windows" ),
693+ value: Enum .PauseMode .MaximizedOrFullScreen
694+ },
695+ {
696+ text: i18n (" Active window" ),
697+ value: Enum .PauseMode .ActiveWindowPresent
698+ },
699+ {
700+ text: i18n (" At least one window is visible" ),
701+ value: Enum .PauseMode .WindowVisible
702+ },
703+ {
704+ text: i18n (" Never" ),
705+ value: Enum .PauseMode .Never
706+ }
707+ ]
708+ textRole: " text"
709+ valueRole: " value"
710+ visible: ! root .isLockScreenSettings && root .currentTab === 1
711+ }
712+
713+ RowLayout {
714+ visible: root .currentTab === 1 && root .cfg_AlternativePlaybackRateMode !== 3
715+ Label {
716+ text: i18n (" Speed:" )
717+ }
718+ Components .DoubleSpinBox {
719+ from: 0.01 * multiplier
720+ to: 2 * multiplier
721+ value: root .cfg_AlternativePlaybackRate * multiplier
722+ stepSize: 0.01 * multiplier
723+ font .features : {
724+ " tnum" : 1
725+ }
726+ onValueModified: {
727+ root .cfg_AlternativePlaybackRate = value / multiplier;
728+ }
729+ }
730+ Button {
731+ icon .name : " edit-undo-symbolic"
732+ flat: true
733+ onClicked: {
734+ root .cfg_AlternativePlaybackRate = 1.0 ;
735+ }
736+ ToolTip .text : i18n (" Reset to default" )
737+ ToolTip .visible : hovered
664738 }
665739 }
666740
@@ -686,9 +760,6 @@ ColumnLayout {
686760 valueFromText : function (text , locale ) {
687761 return Number .fromLocaleString (locale, reExtractNum .exec (text)[1 ]);
688762 }
689- onDisplayTextChanged: {
690- value = Number .fromLocaleString (Qt .locale (), reExtractNum .exec (displayText)[1 ]);
691- }
692763 }
693764 CheckBox {
694765 id: batteryPausesVideoCheckBox
@@ -779,6 +850,14 @@ ColumnLayout {
779850 model: effects .loadedEffects
780851 }
781852
853+ Components .CheckableValueListView {
854+ id: effectsAlternativeSpeedInput
855+ Layout .maximumWidth : 400
856+ Kirigami .FormData .label : i18n (" Alternative speed in:" )
857+ visible: root .currentTab === 2
858+ model: effects .loadedEffects
859+ }
860+
782861 Label {
783862 text: i18n (" Currently enabled and <u><strong><font color='%1'>active</font></strong></u> Desktop Effects:" , Kirigami .Theme .positiveTextColor )
784863 visible: root .currentTab === 2
@@ -976,6 +1055,7 @@ ColumnLayout {
9761055 required property string filename
9771056 required property bool enabled
9781057 required property real playbackRate
1058+ required property real alternativePlaybackRate
9791059 required property bool loop
9801060 implicitWidth: ListView .view .width
9811061 implicitHeight: delegate .height
@@ -1062,6 +1142,23 @@ ColumnLayout {
10621142 ToolTip .visible : hovered
10631143 ToolTip .text : i18n (" Playback speed for this video. Minimum accepted is 0.01, set to 0.0 to ignore this setting." )
10641144 }
1145+
1146+ Components .DoubleSpinBox {
1147+ from: 0
1148+ to: 2 * multiplier
1149+ value: itemDelegate .alternativePlaybackRate * multiplier
1150+ stepSize: 0.01 * multiplier
1151+ enabled: itemDelegate .enabled
1152+ font .features : {
1153+ " tnum" : 1
1154+ }
1155+ onValueModified: {
1156+ videosModel .updateItem (itemDelegate .index , " alternativePlaybackRate" , value / multiplier);
1157+ }
1158+ ToolTip .delay : 1000
1159+ ToolTip .visible : hovered
1160+ ToolTip .text : i18n (" Alternative playback speed for this video. Minimum accepted is 0.01, set to 0.0 to ignore this setting." )
1161+ }
10651162 Button {
10661163 icon .name : " media-repeat-single-symbolic"
10671164 checkable: true
0 commit comments