Save configuration and allow custom script to execute when timer ends

This commit is contained in:
Vyn 2024-10-17 14:04:47 +02:00
parent 8585f5741f
commit da32449075
6 changed files with 24879 additions and 19 deletions

View file

@ -1,6 +1,7 @@
import { State, SessionStep, CountdownStatus } from "./state.slint";
import { VText, VButton, VSlider, Palette } from "@selenite";
import { VText, VButton, VSlider, VTextInput, Palette } from "@selenite";
import { Utils } from "utils.slint";
import { ComboBox } from "std-widgets.slint";
export component SettingsView inherits Rectangle {
VerticalLayout {
@ -40,5 +41,13 @@ export component SettingsView inherits Rectangle {
format-value(value) => { return Math.round(value); }
released(value) => { State.max-session-count = Math.round(value); }
}
VTextInput {
label: "Timer ending script";
label-size: 1.25rem;
label-alignment: TextHorizontalAlignment.center;
placeholder: "Default";
text <=> State.timer-ending-script;
}
}
}

View file

@ -19,6 +19,7 @@ export global State {
in-out property <CountdownStatus> countdown-status;
in-out property <int> current-session;
in-out property <int> max-session-count;
in-out property <string> timer-ending-script;
callback config-changed();
}