feat: Reworked configuration
- Added colors.aliases table - Colors can also be defined with aliases - Event color is calculated with priorities - Added paths table - Renamed log_path as paths.logs - Renamed colors.background_text as colors.text - Added colors.fallback field - Default values are now taken from source config.toml on compilation
This commit is contained in:
parent
a64ed277f6
commit
ba7bc67b6c
13 changed files with 347 additions and 256 deletions
|
|
@ -6,7 +6,8 @@ export struct TimelineEvent {
|
|||
duration: int,
|
||||
finished: bool,
|
||||
label: string,
|
||||
color-id: int,
|
||||
background-color: color,
|
||||
text-color: color,
|
||||
}
|
||||
|
||||
export struct TimelineState {
|
||||
|
|
@ -69,7 +70,7 @@ export component Timeline inherits Rectangle {
|
|||
visible: self.width > 0 && self.real-x < parent.width;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
background: Palette.event-colors[event.color-id];
|
||||
background: event.background-color;
|
||||
|
||||
Text {
|
||||
x: 0;
|
||||
|
|
@ -87,7 +88,7 @@ export component Timeline inherits Rectangle {
|
|||
visible: timeline-event.visible &&
|
||||
(self.width * 2 < timeline-event.width ||
|
||||
(!end-txt.visible && self.width < timeline-event.width));
|
||||
color: Palette.event-text[event.color-id];
|
||||
color: event.text-color;
|
||||
}
|
||||
end-txt := Text {
|
||||
x: timeline-event.width - self.width;
|
||||
|
|
@ -96,7 +97,7 @@ export component Timeline inherits Rectangle {
|
|||
TimeString.from(event.start + event.duration) :
|
||||
TimeString.from(visible-offset);
|
||||
visible: timeline-event.visible && timeline-event.width - self.width * 2 > 0;
|
||||
color: Palette.event-text[event.color-id];
|
||||
color: event.text-color;
|
||||
}
|
||||
}
|
||||
@children
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue