Basic theming applied

This commit is contained in:
Jarrod Doyle 2024-04-10 13:28:43 +01:00
parent 0788dd10d5
commit b98741a35e
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
8 changed files with 228 additions and 250 deletions

View File

@ -1,17 +1,28 @@
import { Metrics } from "theme.slint"; import { Metrics, DarkPalette } from "theme.slint";
import { EditorBar } from "editor_bar.slint"; import { EditorBar } from "editor_bar.slint";
import { StatusBar } from "status_bar.slint"; import { StatusBar } from "status_bar.slint";
import { ToolBar } from "tool_bar.slint"; import { ToolBar } from "tool_bar.slint";
import { ObjectToolPanel } from "object_tool_panel.slint"; import { ObjectToolPanel } from "object_tool_panel.slint";
import { VerticalBox, HorizontalBox } from "widgets/layout.slint";
import { VerticalSeparator } from "widgets/separator.slint";
export component AppWindow inherits Window { export component AppWindow inherits Window {
title: @tr("FM Editor"); title: @tr("FM Editor");
preferred-width: 1280px; preferred-width: 1280px;
preferred-height: 720px; preferred-height: 720px;
VerticalLayout { VerticalBox {
j-padding: Metrics.padding-sm;
j-spacing: Metrics.spacing-sm;
j-alignment: stretch;
background: DarkPalette.background[0];
EditorBar { } EditorBar { }
HorizontalLayout { HorizontalBox {
j-alignment: stretch;
background: DarkPalette.background[0];
j-padding: 0px;
j-spacing: Metrics.spacing-sm;
ToolBar { } ToolBar { }
ObjectToolPanel { } ObjectToolPanel { }

View File

@ -1,18 +1,15 @@
import { Metrics } from "theme.slint"; import { Metrics, DarkPalette } from "theme.slint";
import { HorizontalBox } from "widgets/layout.slint";
export component EditorBar inherits Rectangle { export component EditorBar inherits HorizontalBox {
height: Metrics.size-xl; height: Metrics.size-xl;
border-color: black; j-spacing: Metrics.spacing-xl;
border-width: 1px; j-rounding: Metrics.radius-md;
HorizontalLayout {
alignment: start;
padding: Metrics.padding-md;
spacing: Metrics.padding-xl;
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
vertical-alignment: center; vertical-alignment: center;
text: "Damn look at all the options and shit here it's like Hammer 2!!"; text: "Damn look at all the options and shit here it's like Hammer 2!!";
} }
}
} }

View File

@ -1,154 +1,143 @@
import { Metrics } from "theme.slint"; import { Metrics, DarkPalette } from "theme.slint";
import { Panel } from "widgets/panel.slint"; import { Panel } from "widgets/panel.slint";
import { HorizontalBox, VerticalBox } from "widgets/layout.slint";
export component ObjectToolPanel inherits Rectangle {
export component ObjectToolPanel inherits VerticalBox {
width: 280px; width: 280px;
border-color: black; j-rounding: Metrics.radius-md;
border-width: 1px; j-alignment: stretch;
VerticalLayout {
padding: Metrics.padding-md;
spacing: Metrics.spacing-md;
HorizontalLayout {
height: Metrics.size-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-lg; font-size: Metrics.font-lg;
text: @tr("Object Tool"); text: @tr("Object Tool");
vertical-alignment: center; vertical-alignment: center;
} }
}
Panel { Panel {
title: @tr("Favourites"); title: @tr("Favourites");
j-elevation: 2;
Panel { Panel {
title: "Group Name"; title: "Group Name";
title-alignment: center; title-alignment: center;
content-padding: 0px; j-spacing: 0px;
content-spacing: 0px;
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
}
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
}
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
} }
}
Panel { Panel {
title: "Group Name"; title: "Group Name";
title-alignment: center; title-alignment: center;
content-padding: 0px; j-spacing: 0px;
content-spacing: 0px;
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
}
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
}
HorizontalLayout {
height: Metrics.size-md;
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: "Object Name"; text: "Object Name";
vertical-alignment: center; vertical-alignment: center;
} }
} }
} }
}
Panel { Panel {
title: @tr("Hierarchy"); title: @tr("Hierarchy");
HorizontalLayout { j-elevation: 2;
spacing: Metrics.spacing-md; j-alignment: stretch;
vertical-stretch: 1;
HorizontalBox {
j-alignment: stretch;
j-elevation: 2;
j-padding: 0px;
j-spacing: Metrics.spacing-md;
height: Metrics.size-md; height: Metrics.size-md;
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
vertical-alignment: center; vertical-alignment: center;
text: @tr("Name:"); text: @tr("Name:");
} }
Rectangle { HorizontalBox {
border-color: black; j-alignment: stretch;
border-width: 1px; j-rounding: Metrics.radius-md;
border-radius: Metrics.radius-md; j-padding: 0px;
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
vertical-alignment: center; vertical-alignment: center;
horizontal-alignment: left; horizontal-alignment: center;
text: "VicHutch (-514)"; text: "VicHutch (-514)";
} }
} }
Rectangle { HorizontalBox {
border-color: black;
border-width: 1px;
border-radius: Metrics.radius-md;
width: Metrics.size-md; width: Metrics.size-md;
j-rounding: Metrics.radius-md;
j-elevation: 3;
Rectangle { }
} }
Rectangle { HorizontalBox {
border-color: black;
border-width: 1px;
border-radius: Metrics.radius-md;
width: Metrics.size-md; width: Metrics.size-md;
j-rounding: Metrics.radius-md;
j-elevation: 3;
Rectangle { }
} }
} }
Rectangle { VerticalBox {
border-color: black; j-alignment: stretch;
border-width: 1px; j-rounding: Metrics.radius-md;
border-radius: Metrics.radius-md;
clip: true;
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-lg; font-size: Metrics.font-lg;
text: "INSERT TREE VIEW HERE"; text: "INSERT TREE VIEW HERE";
vertical-alignment: center; vertical-alignment: center;
@ -156,5 +145,4 @@ export component ObjectToolPanel inherits Rectangle {
} }
} }
} }
}
} }

View File

@ -1,16 +1,14 @@
import { Metrics } from "theme.slint"; import { Metrics, DarkPalette } from "theme.slint";
import { VerticalSeparator } from "widgets/separator.slint"; import { VerticalSeparator } from "widgets/separator.slint";
import { HorizontalBox } from "widgets/layout.slint";
export component StatusBar inherits Rectangle { export component StatusBar inherits HorizontalBox {
border-color: black;
border-width: 1px;
height: Metrics.size-lg; height: Metrics.size-lg;
HorizontalLayout { j-rounding: Metrics.radius-md;
alignment: start; j-spacing: Metrics.spacing-lg;
padding-left: Metrics.padding-lg;
padding-right: Metrics.padding-lg;
spacing: Metrics.padding-lg;
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
vertical-alignment: center; vertical-alignment: center;
text: "Last saved: 18:50"; text: "Last saved: 18:50";
@ -19,11 +17,11 @@ export component StatusBar inherits Rectangle {
VerticalSeparator { } VerticalSeparator { }
Text { Text {
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
vertical-alignment: center; vertical-alignment: center;
text: "Saved by: Jayrude"; text: "Saved by: Jayrude";
} }
VerticalSeparator { } VerticalSeparator { }
}
} }

View File

@ -1,24 +1,18 @@
import { Metrics } from "theme.slint"; import { Metrics, DarkPalette } from "theme.slint";
import { Button } from "std-widgets.slint"; import { Button } from "std-widgets.slint";
import { HorizontalSeparator } from "widgets/separator.slint"; import { HorizontalSeparator } from "widgets/separator.slint";
import { VerticalBox } from "widgets/layout.slint";
component ToolBarItem inherits Rectangle { component ToolBarItem inherits Rectangle {
width: Metrics.size-lg; width: Metrics.size-lg;
height: Metrics.size-lg; height: Metrics.size-lg;
border-color: black;
border-width: 1px;
border-radius: Metrics.radius-md; border-radius: Metrics.radius-md;
background: DarkPalette.background[2];
} }
export component ToolBar inherits Rectangle { export component ToolBar inherits VerticalBox {
width: Metrics.size-xl; width: Metrics.size-xl;
border-color: black; j-rounding: Metrics.radius-md;
border-width: 1px;
VerticalLayout {
alignment: start;
padding: Metrics.padding-md;
spacing: Metrics.padding-md;
Button { Button {
checkable: true; checkable: true;
@ -53,5 +47,4 @@ export component ToolBar inherits Rectangle {
ToolBarItem { } ToolBarItem { }
ToolBarItem { } ToolBarItem { }
}
} }

View File

@ -8,13 +8,15 @@ struct BorderStyle {
export component HorizontalBox inherits Rectangle { export component HorizontalBox inherits Rectangle {
// TODO: border, shadow // TODO: border, shadow
in property <int> j-elevation: 1;
in property <length> j-rounding: 0px; in property <length> j-rounding: 0px;
in property <length> j-padding: Metrics.padding-md; in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md; in property <length> j-spacing: Metrics.spacing-md;
in property <LayoutAlignment> j-alignment: start; in property <LayoutAlignment> j-alignment: start;
background: DarkPalette.background[1]; background: DarkPalette.background[j-elevation];
border-radius: j-rounding; border-radius: j-rounding;
clip: true;
HorizontalLayout { HorizontalLayout {
alignment: j-alignment; alignment: j-alignment;
@ -26,13 +28,15 @@ export component HorizontalBox inherits Rectangle {
export component VerticalBox inherits Rectangle { export component VerticalBox inherits Rectangle {
// TODO: border, shadow // TODO: border, shadow
in property <int> j-elevation: 1;
in property <length> j-rounding: 0px; in property <length> j-rounding: 0px;
in property <length> j-padding: Metrics.padding-md; in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md; in property <length> j-spacing: Metrics.spacing-md;
in property <LayoutAlignment> j-alignment: start; in property <LayoutAlignment> j-alignment: start;
background: DarkPalette.background[1]; background: DarkPalette.background[j-elevation];
border-radius: j-rounding; border-radius: j-rounding;
clip: true;
VerticalLayout { VerticalLayout {
alignment: j-alignment; alignment: j-alignment;

View File

@ -1,37 +1,20 @@
import { Metrics } from "../theme.slint"; import { Metrics, DarkPalette } from "../theme.slint";
import { HorizontalBox, VerticalBox } from "layout.slint";
export component Panel inherits Rectangle { export component Panel inherits VerticalBox {
in property <string> title: "Title"; in property <string> title: "Title";
in property <TextHorizontalAlignment> title-alignment: left; in property <TextHorizontalAlignment> title-alignment: left;
in property <length> content-padding: Metrics.padding-md;
in property <length> content-spacing: Metrics.spacing-md;
border-color: black; j-rounding: Metrics.radius-md;
border-width: 1px;
border-radius: Metrics.radius-md;
clip: true;
VerticalLayout {
Rectangle {
height: Metrics.size-md;
border-color: black;
border-width: 1px;
HorizontalLayout {
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
Text { Text {
height: Metrics.size-md;
color: DarkPalette.text[4];
font-size: Metrics.font-md; font-size: Metrics.font-md;
text: title; text: title;
vertical-alignment: center; vertical-alignment: center;
horizontal-alignment: title-alignment; horizontal-alignment: title-alignment;
} }
}
}
VerticalLayout {
padding: content-padding;
spacing: content-spacing;
@children @children
}
}
} }

View File

@ -1,16 +1,20 @@
import {DarkPalette} from "../theme.slint";
export component VerticalSeparator { export component VerticalSeparator {
width: 1px;
Path { Path {
width: 1px; width: 1px;
stroke: black; stroke: DarkPalette.background[0];
stroke-width: 1px; stroke-width: 1px;
commands: "M 0 0 L 0 1 Z"; commands: "M 0 0 L 0 1 Z";
} }
} }
export component HorizontalSeparator { export component HorizontalSeparator {
height: 1px;
Path { Path {
height: 1px; height: 1px;
stroke: black; stroke: DarkPalette.background[0];
stroke-width: 1px; stroke-width: 1px;
commands: "M 0 0 L 1 0 Z"; commands: "M 0 0 L 1 0 Z";
} }