ui: Mass layout refactor
- Replaced TabWidget mode selection with ComboBox - Moved Timeline out of record/review widgets - Added TimelineState struct - Set slint style to cosmic
This commit is contained in:
parent
365f77056e
commit
1a1f6dde83
7 changed files with 190 additions and 160 deletions
21
ui/global.slint
Normal file
21
ui/global.slint
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue