Compare commits
No commits in common. "e5472b867c89952f845c134cbf4873aad48a1ebc" and "35966bc8e3c1af07d6a01983f2784abce3c16e24" have entirely different histories.
e5472b867c
...
35966bc8e3
|
@ -1,10 +1,10 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { VerticalBox, HorizontalBox } from "widgets/components.slint";
|
||||
|
||||
import { EditorBar } from "editor_bar.slint";
|
||||
import { StatusBar } from "status_bar.slint";
|
||||
import { ToolBar, ToolType } from "tool_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");
|
||||
|
@ -14,17 +14,17 @@ export component AppWindow inherits Window {
|
|||
p-rounding: 0px;
|
||||
p-padding: Metrics.padding-sm;
|
||||
p-spacing: Metrics.spacing-sm;
|
||||
p-elevation: 0;
|
||||
background: DarkPalette.background[0];
|
||||
EditorBar { }
|
||||
|
||||
HorizontalBox {
|
||||
p-elevation: 0;
|
||||
background: DarkPalette.background[0];
|
||||
p-padding: 0px;
|
||||
p-spacing: Metrics.spacing-sm;
|
||||
|
||||
c-toolbar := ToolBar { }
|
||||
ToolBar { }
|
||||
|
||||
if (c-toolbar.p-current-tool == ToolType.Object): ObjectToolPanel { }
|
||||
ObjectToolPanel { }
|
||||
|
||||
Rectangle {
|
||||
Text {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { HorizontalBox } from "widgets/components.slint";
|
||||
import { HorizontalBox } from "widgets/layout.slint";
|
||||
|
||||
export component EditorBar inherits HorizontalBox {
|
||||
height: Metrics.size-xl;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { Box, HorizontalBox, VerticalBox, Panel } from "widgets/components.slint";
|
||||
import { Panel } from "widgets/panel.slint";
|
||||
import { Box, HorizontalBox, VerticalBox } from "widgets/layout.slint";
|
||||
|
||||
|
||||
export component ObjectToolPanel inherits VerticalBox {
|
||||
width: 280px;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { HorizontalBox, VerticalSeparator } from "widgets/components.slint";
|
||||
import { VerticalSeparator } from "widgets/separator.slint";
|
||||
import { HorizontalBox } from "widgets/layout.slint";
|
||||
|
||||
export component StatusBar inherits HorizontalBox {
|
||||
height: Metrics.size-lg;
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { Box, Button, HorizontalSeparator, VerticalBox } from "widgets/components.slint";
|
||||
|
||||
export enum ToolType {
|
||||
Select,
|
||||
Move,
|
||||
Rotate,
|
||||
Scale,
|
||||
Brush,
|
||||
Light,
|
||||
Area,
|
||||
Object,
|
||||
Flow,
|
||||
Room,
|
||||
Texture,
|
||||
Timeline,
|
||||
Multibrush,
|
||||
}
|
||||
import { HorizontalSeparator } from "widgets/separator.slint";
|
||||
import { Box, VerticalBox } from "widgets/layout.slint";
|
||||
import { Button } from "widgets/button.slint";
|
||||
|
||||
component ToolBarItem inherits Button {
|
||||
width: Metrics.size-lg;
|
||||
|
@ -27,50 +13,59 @@ export component ToolBar inherits VerticalBox {
|
|||
width: Metrics.size-xl;
|
||||
p-alignment: start;
|
||||
|
||||
out property <ToolType> p-current-tool: ToolType.Select;
|
||||
ToolBarItem {
|
||||
p-text: "s";
|
||||
}
|
||||
|
||||
private property <[{text: string, type: ToolType}]> p-transform-tools: [
|
||||
{ text: "s", type: ToolType.Select },
|
||||
{ text: "m", type: ToolType.Move },
|
||||
{ text: "r", type: ToolType.Rotate },
|
||||
{ text: "s", type: ToolType.Scale },
|
||||
];
|
||||
private property <[{text: string, type: ToolType}]> p-brush-tools: [
|
||||
{ text: "b", type: ToolType.Brush },
|
||||
{ text: "o", type: ToolType.Object },
|
||||
{ text: "f", type: ToolType.Flow },
|
||||
{ text: "r", type: ToolType.Room },
|
||||
{ text: "l", type: ToolType.Light },
|
||||
{ text: "a", type: ToolType.Area },
|
||||
];
|
||||
private property <[{text: string, type: ToolType}]> p-other-tools: [
|
||||
{ text: "t", type: ToolType.Texture },
|
||||
{ text: "t", type: ToolType.Timeline },
|
||||
{ text: "m", type: ToolType.Multibrush },
|
||||
];
|
||||
ToolBarItem {
|
||||
p-text: "m";
|
||||
}
|
||||
|
||||
for item[index] in root.p-transform-tools: ToolBarItem {
|
||||
p-text: item.text;
|
||||
a-clicked => {
|
||||
root.p-current-tool = item.type;
|
||||
}
|
||||
ToolBarItem {
|
||||
p-text: "r";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "s";
|
||||
}
|
||||
|
||||
HorizontalSeparator { }
|
||||
|
||||
for item[index] in root.p-brush-tools: ToolBarItem {
|
||||
p-text: item.text;
|
||||
a-clicked => {
|
||||
root.p-current-tool = item.type;
|
||||
}
|
||||
ToolBarItem {
|
||||
p-text: "b";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "o";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "f";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "r";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "l";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "a";
|
||||
}
|
||||
|
||||
HorizontalSeparator { }
|
||||
|
||||
for item[index] in root.p-other-tools: ToolBarItem {
|
||||
p-text: item.text;
|
||||
a-clicked => {
|
||||
root.p-current-tool = item.type;
|
||||
}
|
||||
ToolBarItem {
|
||||
p-text: "t";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "t";
|
||||
}
|
||||
|
||||
ToolBarItem {
|
||||
p-text: "m";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
import { Button } from "button.slint";
|
||||
import { VerticalBox, HorizontalBox, Box } from "layout.slint";
|
||||
import { Panel } from "panel.slint";
|
||||
import { VerticalSeparator, HorizontalSeparator } from "separator.slint";
|
||||
|
||||
export { Button, VerticalBox, HorizontalBox, Box, Panel, VerticalSeparator, HorizontalSeparator }
|
|
@ -1,19 +1,21 @@
|
|||
import {DarkPalette} from "../theme.slint";
|
||||
|
||||
export component VerticalSeparator inherits Path {
|
||||
in property <int> p-elevation: 0;
|
||||
|
||||
export component VerticalSeparator {
|
||||
width: 1px;
|
||||
stroke: DarkPalette.background[root.p-elevation];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 0 1 Z";
|
||||
Path {
|
||||
width: 1px;
|
||||
stroke: DarkPalette.background[0];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 0 1 Z";
|
||||
}
|
||||
}
|
||||
|
||||
export component HorizontalSeparator inherits Path {
|
||||
in property <int> p-elevation: 0;
|
||||
|
||||
export component HorizontalSeparator {
|
||||
height: 1px;
|
||||
stroke: DarkPalette.background[root.p-elevation];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 1 0 Z";
|
||||
Path {
|
||||
height: 1px;
|
||||
stroke: DarkPalette.background[0];
|
||||
stroke-width: 1px;
|
||||
commands: "M 0 0 L 1 0 Z";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue