Skip to content

Commit 6ab46e0

Browse files
committed
[*] improve ui
1 parent 9a3b5c2 commit 6ab46e0

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

wayshot/src/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub static VERSION: &str = "v0.3.0";
1+
pub static VERSION: &str = "v0.3.1";

wayshot/ui/base/video-player.slint

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ export component VideoPlayer inherits Rectangle {
436436
spacing: Theme.padding * 2;
437437

438438
sound-btn := IconBtn {
439+
private property <int> current-sound-cache;
440+
439441
icon: root.current-sound <= 0 ? Icons.sound-off-fill : Icons.sound-on-fill;
440442
show-icon-hover-background: false;
441443
icon-size: Theme.icon-size;
@@ -444,10 +446,18 @@ export component VideoPlayer inherits Rectangle {
444446
changed has-hover => {
445447
mouse-on-controls = true;
446448
root.show-controls = true;
449+
root.show-sound-slider = true;
447450
}
448451

449452
clicked => {
450-
show-sound-slider = !show-sound-slider;
453+
if (root.current-sound == 0) {
454+
root.current-sound = current-sound-cache;
455+
sound-slider.value = current-sound-cache;
456+
} else {
457+
current-sound-cache = root.current-sound;
458+
root.current-sound = 0;
459+
sound-slider.value = 0;
460+
}
451461
}
452462
}
453463

@@ -477,6 +487,7 @@ export component VideoPlayer inherits Rectangle {
477487
changed has-hover => {
478488
mouse-on-controls = true;
479489
root.show-controls = true;
490+
root.show-sound-slider = true;
480491
}
481492

482493
released(v) => {

wayshot/ui/panel/desktop/main.slint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ component ControlPanel inherits HorizontalLayout {
439439
colorize: Theme.light-text-color;
440440

441441
clicked => {
442+
record-duration = 0;
442443
Logic.stop-recording();
443444
}
444445
}

0 commit comments

Comments
 (0)