Basic theming applied
This commit is contained in:
parent
0788dd10d5
commit
b98741a35e
|
@ -1,17 +1,28 @@
|
|||
import { Metrics } from "theme.slint";
|
||||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { EditorBar } from "editor_bar.slint";
|
||||
import { StatusBar } from "status_bar.slint";
|
||||
import { ToolBar } from "tool_bar.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 {
|
||||
title: @tr("FM Editor");
|
||||
preferred-width: 1280px;
|
||||
preferred-height: 720px;
|
||||
VerticalLayout {
|
||||
VerticalBox {
|
||||
j-padding: Metrics.padding-sm;
|
||||
j-spacing: Metrics.spacing-sm;
|
||||
j-alignment: stretch;
|
||||
background: DarkPalette.background[0];
|
||||
EditorBar { }
|
||||
|
||||
HorizontalLayout {
|
||||
HorizontalBox {
|
||||
j-alignment: stretch;
|
||||
background: DarkPalette.background[0];
|
||||
j-padding: 0px;
|
||||
j-spacing: Metrics.spacing-sm;
|
||||
|
||||
ToolBar { }
|
||||
|
||||
ObjectToolPanel { }
|
||||
|
|
|
@ -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;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
j-spacing: Metrics.spacing-xl;
|
||||
j-rounding: Metrics.radius-md;
|
||||
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
padding: Metrics.padding-md;
|
||||
spacing: Metrics.padding-xl;
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
vertical-alignment: center;
|
||||
text: "Damn look at all the options and shit here it's like Hammer 2!!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,154 +1,143 @@
|
|||
import { Metrics } from "theme.slint";
|
||||
import { Metrics, DarkPalette } from "theme.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;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
j-rounding: Metrics.radius-md;
|
||||
j-alignment: stretch;
|
||||
|
||||
VerticalLayout {
|
||||
padding: Metrics.padding-md;
|
||||
spacing: Metrics.spacing-md;
|
||||
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-lg;
|
||||
text: @tr("Object Tool");
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
Panel {
|
||||
title: @tr("Favourites");
|
||||
j-elevation: 2;
|
||||
|
||||
Panel {
|
||||
title: "Group Name";
|
||||
title-alignment: center;
|
||||
content-padding: 0px;
|
||||
content-spacing: 0px;
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
j-spacing: 0px;
|
||||
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Panel {
|
||||
title: "Group Name";
|
||||
title-alignment: center;
|
||||
content-padding: 0px;
|
||||
content-spacing: 0px;
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
j-spacing: 0px;
|
||||
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
height: Metrics.size-md;
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: "Object Name";
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Panel {
|
||||
title: @tr("Hierarchy");
|
||||
HorizontalLayout {
|
||||
spacing: Metrics.spacing-md;
|
||||
j-elevation: 2;
|
||||
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;
|
||||
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
vertical-alignment: center;
|
||||
text: @tr("Name:");
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
HorizontalBox {
|
||||
j-alignment: stretch;
|
||||
j-rounding: Metrics.radius-md;
|
||||
j-padding: 0px;
|
||||
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
vertical-alignment: center;
|
||||
horizontal-alignment: left;
|
||||
horizontal-alignment: center;
|
||||
text: "VicHutch (-514)";
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
|
||||
HorizontalBox {
|
||||
width: Metrics.size-md;
|
||||
j-rounding: Metrics.radius-md;
|
||||
j-elevation: 3;
|
||||
|
||||
Rectangle { }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
|
||||
HorizontalBox {
|
||||
width: Metrics.size-md;
|
||||
j-rounding: Metrics.radius-md;
|
||||
j-elevation: 3;
|
||||
|
||||
Rectangle { }
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
clip: true;
|
||||
VerticalBox {
|
||||
j-alignment: stretch;
|
||||
j-rounding: Metrics.radius-md;
|
||||
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-lg;
|
||||
text: "INSERT TREE VIEW HERE";
|
||||
vertical-alignment: center;
|
||||
|
@ -157,4 +146,3 @@ export component ObjectToolPanel inherits Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
import { Metrics } from "theme.slint";
|
||||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { VerticalSeparator } from "widgets/separator.slint";
|
||||
import { HorizontalBox } from "widgets/layout.slint";
|
||||
|
||||
export component StatusBar inherits Rectangle {
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
export component StatusBar inherits HorizontalBox {
|
||||
height: Metrics.size-lg;
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
padding-left: Metrics.padding-lg;
|
||||
padding-right: Metrics.padding-lg;
|
||||
spacing: Metrics.padding-lg;
|
||||
j-rounding: Metrics.radius-md;
|
||||
j-spacing: Metrics.spacing-lg;
|
||||
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
vertical-alignment: center;
|
||||
text: "Last saved: 18:50";
|
||||
|
@ -19,6 +17,7 @@ export component StatusBar inherits Rectangle {
|
|||
VerticalSeparator { }
|
||||
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
vertical-alignment: center;
|
||||
text: "Saved by: Jayrude";
|
||||
|
@ -26,4 +25,3 @@ export component StatusBar inherits Rectangle {
|
|||
|
||||
VerticalSeparator { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
import { Metrics } from "theme.slint";
|
||||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { Button } from "std-widgets.slint";
|
||||
import { HorizontalSeparator } from "widgets/separator.slint";
|
||||
import { VerticalBox } from "widgets/layout.slint";
|
||||
|
||||
component ToolBarItem inherits Rectangle {
|
||||
width: Metrics.size-lg;
|
||||
height: Metrics.size-lg;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
background: DarkPalette.background[2];
|
||||
}
|
||||
|
||||
export component ToolBar inherits Rectangle {
|
||||
export component ToolBar inherits VerticalBox {
|
||||
width: Metrics.size-xl;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: Metrics.padding-md;
|
||||
spacing: Metrics.padding-md;
|
||||
j-rounding: Metrics.radius-md;
|
||||
|
||||
Button {
|
||||
checkable: true;
|
||||
|
@ -54,4 +48,3 @@ export component ToolBar inherits Rectangle {
|
|||
|
||||
ToolBarItem { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,15 @@ struct BorderStyle {
|
|||
|
||||
export component HorizontalBox inherits Rectangle {
|
||||
// TODO: border, shadow
|
||||
in property <int> j-elevation: 1;
|
||||
in property <length> j-rounding: 0px;
|
||||
in property <length> j-padding: Metrics.padding-md;
|
||||
in property <length> j-spacing: Metrics.spacing-md;
|
||||
in property <LayoutAlignment> j-alignment: start;
|
||||
|
||||
background: DarkPalette.background[1];
|
||||
background: DarkPalette.background[j-elevation];
|
||||
border-radius: j-rounding;
|
||||
clip: true;
|
||||
|
||||
HorizontalLayout {
|
||||
alignment: j-alignment;
|
||||
|
@ -26,13 +28,15 @@ export component HorizontalBox inherits Rectangle {
|
|||
|
||||
export component VerticalBox inherits Rectangle {
|
||||
// TODO: border, shadow
|
||||
in property <int> j-elevation: 1;
|
||||
in property <length> j-rounding: 0px;
|
||||
in property <length> j-padding: Metrics.padding-md;
|
||||
in property <length> j-spacing: Metrics.spacing-md;
|
||||
in property <LayoutAlignment> j-alignment: start;
|
||||
|
||||
background: DarkPalette.background[1];
|
||||
background: DarkPalette.background[j-elevation];
|
||||
border-radius: j-rounding;
|
||||
clip: true;
|
||||
|
||||
VerticalLayout {
|
||||
alignment: j-alignment;
|
||||
|
|
|
@ -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 <TextHorizontalAlignment> title-alignment: left;
|
||||
in property <length> content-padding: Metrics.padding-md;
|
||||
in property <length> content-spacing: Metrics.spacing-md;
|
||||
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
border-radius: Metrics.radius-md;
|
||||
clip: true;
|
||||
j-rounding: Metrics.radius-md;
|
||||
|
||||
VerticalLayout {
|
||||
Rectangle {
|
||||
height: Metrics.size-md;
|
||||
border-color: black;
|
||||
border-width: 1px;
|
||||
HorizontalLayout {
|
||||
padding-left: Metrics.padding-md;
|
||||
padding-right: Metrics.padding-md;
|
||||
Text {
|
||||
height: Metrics.size-md;
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-md;
|
||||
text: title;
|
||||
vertical-alignment: center;
|
||||
horizontal-alignment: title-alignment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
padding: content-padding;
|
||||
spacing: content-spacing;
|
||||
@children
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
import {DarkPalette} from "../theme.slint";
|
||||
|
||||
export component VerticalSeparator {
|
||||
width: 1px;
|
||||
Path {
|
||||
width: 1px;
|
||||
stroke: black;
|
||||
stroke: DarkPalette.background[0];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 0 1 Z";
|
||||
}
|
||||
}
|
||||
|
||||
export component HorizontalSeparator {
|
||||
height: 1px;
|
||||
Path {
|
||||
height: 1px;
|
||||
stroke: black;
|
||||
stroke: DarkPalette.background[0];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 1 0 Z";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue