- Replaced TabWidget mode selection with ComboBox - Moved Timeline out of record/review widgets - Added TimelineState struct - Set slint style to cosmic
21 lines
649 B
Text
21 lines
649 B
Text
export global TimeString {
|
|
pure function pad-mh(seconds: int, param: int) -> string {
|
|
if seconds / param < 10 {
|
|
return "0\{floor(seconds / param)}";
|
|
}
|
|
return "\{floor(seconds / param)}";
|
|
}
|
|
pure function pad-s(seconds: int) -> string {
|
|
if mod(seconds, 60) < 10 {
|
|
return "0\{mod(seconds, 60)}";
|
|
}
|
|
return "\{mod(seconds, 60)}";
|
|
}
|
|
public pure function from(seconds: int) -> string {
|
|
return "\{pad-mh(seconds, 3600)}:\{pad-mh(mod(seconds, 3600), 60)}:\{pad-s(seconds)}";
|
|
}
|
|
}
|
|
|
|
export global Const {
|
|
out property <int> max-offset: 24 * 3600 - 1;
|
|
}
|