First commit
This commit is contained in:
commit
8585f5741f
13 changed files with 505 additions and 0 deletions
12
ui/utils.slint
Normal file
12
ui/utils.slint
Normal file
|
@ -0,0 +1,12 @@
|
|||
export global Utils {
|
||||
public pure function format-zero-padding(number: int) -> string {
|
||||
if (number < 10) {
|
||||
return "0\{number}";
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
public pure function format-countdown(countdown: int) -> string {
|
||||
return "\{format-zero-padding(countdown / 60)}:\{format-zero-padding(Math.mod(countdown, 60))}";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue