Minimizable record options
This commit is contained in:
parent
31281295bb
commit
8df3893baa
2 changed files with 20 additions and 4 deletions
|
@ -13,21 +13,30 @@ export component RecordWidget inherits VerticalBox {
|
|||
in-out property events <=> tl.events;
|
||||
in property<[string]> combo-spans: [];
|
||||
in-out property<bool> in-progress: false;
|
||||
property<string> event-name <=> le.text;
|
||||
property<string> event-name: "";
|
||||
property<bool> minimized: false;
|
||||
property<int> combo-index: 0;
|
||||
|
||||
tl := Timeline {
|
||||
preferred-height: 100%;
|
||||
updating: true;
|
||||
clicked => {
|
||||
minimized = !minimized;
|
||||
}
|
||||
}
|
||||
GridLayout {
|
||||
if !minimized: GridLayout {
|
||||
spacing-vertical: 8px;
|
||||
spacing-horizontal: 16px;
|
||||
le := LineEdit {
|
||||
placeholder-text: "Event name";
|
||||
text: "Event name";
|
||||
text: event-name;
|
||||
font-size: 24px;
|
||||
horizontal-alignment: center;
|
||||
colspan: 2;
|
||||
row: 0;
|
||||
edited(text) => {
|
||||
event-name = text;
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: in-progress ? "Stop" : "Start";
|
||||
|
@ -58,11 +67,12 @@ export component RecordWidget inherits VerticalBox {
|
|||
}
|
||||
ComboBox {
|
||||
model: combo-spans;
|
||||
current-index: 0;
|
||||
current-index: combo-index;
|
||||
row: 2;
|
||||
col: 1;
|
||||
selected(current-value) => {
|
||||
root.update-visible-time(current-value);
|
||||
combo-index = self.current-index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ global TimeString {
|
|||
|
||||
export component Timeline inherits Rectangle {
|
||||
callback new-day-started;
|
||||
callback clicked <=> ta.clicked;
|
||||
|
||||
in-out property<bool> updating: true;
|
||||
in-out property<[TimelineEvent]> events: [];
|
||||
|
@ -46,6 +47,11 @@ export component Timeline inherits Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
ta := TouchArea {
|
||||
preferred-width: 100%;
|
||||
preferred-height: 100%;
|
||||
}
|
||||
|
||||
background: gray;
|
||||
border-width: 1px;
|
||||
border-color: black;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue