First commit
This commit is contained in:
commit
8585f5741f
13 changed files with 505 additions and 0 deletions
54
ui/app-window.slint
Normal file
54
ui/app-window.slint
Normal file
|
@ -0,0 +1,54 @@
|
|||
import { State, SessionStep, CountdownStatus } from "./state.slint";
|
||||
import { VText, VButton, VActionButton, Svg, Palette } from "@selenite";
|
||||
import { CountdownView } from "./countdown-view.slint";
|
||||
import { SettingsView } from "settings-view.slint";
|
||||
|
||||
enum CurrentView {
|
||||
Countdown,
|
||||
Settings
|
||||
}
|
||||
|
||||
export component AppWindow inherits Window {
|
||||
title: "Focus";
|
||||
callback start-stop;
|
||||
property <CurrentView> current-view: CurrentView.Countdown;
|
||||
|
||||
background: Palette.background;
|
||||
default-font-size: 16px;
|
||||
padding: 0px;
|
||||
|
||||
VerticalLayout {
|
||||
width: parent.width;
|
||||
height: parent.height;
|
||||
|
||||
HorizontalLayout {
|
||||
padding: 8px;
|
||||
vertical-stretch: 0;
|
||||
alignment: start;
|
||||
settingsButtons := VActionButton {
|
||||
icon-svg: Svg.burger;
|
||||
background: Palette.background.transparentize(1);
|
||||
clicked => {
|
||||
if (current-view == CurrentView.Countdown) {
|
||||
current-view = CurrentView.Settings;
|
||||
} else if (current-view == CurrentView.Settings) {
|
||||
current-view = CurrentView.Countdown;
|
||||
State.config-changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if current-view == CurrentView.Countdown : countdown-view := CountdownView {
|
||||
start-stop => { root.start-stop() }
|
||||
vertical-stretch: 1;
|
||||
padding: 32px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
if current-view == CurrentView.Settings : settings-view := SettingsView {
|
||||
vertical-stretch: 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { State }
|
Loading…
Add table
Add a link
Reference in a new issue