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:
Alexey 2026-04-08 11:12:49 +03:00
commit 1a1f6dde83
7 changed files with 190 additions and 160 deletions

View file

@ -1,33 +1,25 @@
import { VerticalBox, LineEdit, Button, ComboBox } from "std-widgets.slint";
import { Timeline } from "timeline.slint";
import { Timeline, TimelineState } from "timeline.slint";
export component RecordWidget inherits VerticalBox {
callback new-day-started <=> tl.new-day-started;
export component RecordWidget inherits VerticalLayout {
callback update-visible-time(string);
callback start-new-event(string);
callback chain-event(string);
callback stop-event;
callback get-previous-event();
in-out property visible-time <=> tl.visible-time;
in-out property updating <=> tl.updating;
in-out property offset <=> tl.offset;
in-out property events <=> tl.events;
in-out property<TimelineState> state;
in property<[string]> combo-spans: [];
in-out property<bool> in-progress: false;
property<string> event-name: "";
in property<string> previous-event-name: "";
property<bool> minimized: false;
property<int> combo-index: 0;
tl := Timeline {
preferred-height: 100%;
updating: true;
clicked => {
minimized = !minimized;
}
}
in-out property <bool> minimized;
if !minimized: GridLayout {
spacing-vertical: 8px;
spacing-horizontal: 16px;
padding: 8px;
le := LineEdit {
placeholder-text: "Event name";
text: event-name;
@ -56,7 +48,7 @@ export component RecordWidget inherits VerticalBox {
Button {
text: "Chain";
enabled: in-progress;
col: 3;
col: 2;
row: 1;
colspan: 2;
clicked => {
@ -67,7 +59,7 @@ export component RecordWidget inherits VerticalBox {
Button {
text: previous-event-name == "" ? "Chain previous event (None)" : "Chain previous event (\{previous-event-name})";
enabled: in-progress && previous-event-name != "";
col: 5;
col: 4;
row: 1;
colspan: 2;
clicked => {
@ -77,7 +69,7 @@ export component RecordWidget inherits VerticalBox {
}
}
Text {
text: "Span:";
text: "Span: ";
font-size: 24px;
row: 2;
colspan: 3;