fmeditor-slint/ui/tool_bar.slint

127 lines
2.2 KiB
Plaintext
Raw Normal View History

2024-04-10 12:28:43 +00:00
import { Metrics, DarkPalette } from "theme.slint";
import { Box, Button, HorizontalSeparator, VerticalBox } from "widgets/components.slint";
2024-04-09 19:47:10 +00:00
2024-04-14 12:02:12 +00:00
export enum ToolType {
Select,
Move,
Rotate,
Scale,
Brush,
Light,
Area,
Object,
Flow,
Room,
Texture,
Timeline,
Multibrush,
}
2024-04-10 15:44:23 +00:00
component ToolBarItem inherits Button {
width: Metrics.size-lg;
height: Metrics.size-lg;
2024-04-10 15:44:23 +00:00
p-elevation: 0;
2024-04-09 19:47:10 +00:00
}
2024-04-10 12:28:43 +00:00
export component ToolBar inherits VerticalBox {
width: Metrics.size-xl;
p-alignment: start;
2024-04-09 19:47:10 +00:00
2024-04-14 12:02:12 +00:00
out property <ToolType> p-current-tool: ToolType.Select;
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "s";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Select;
}
2024-04-10 12:28:43 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "m";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Move;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "r";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Rotate;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "s";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Scale;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 12:28:43 +00:00
HorizontalSeparator { }
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "b";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Brush;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "o";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Object;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "f";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Flow;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "r";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Room;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "l";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Light;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "a";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Area;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 12:28:43 +00:00
HorizontalSeparator { }
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "t";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Texture;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "t";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Timeline;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
2024-04-10 15:44:23 +00:00
ToolBarItem {
p-text: "m";
2024-04-14 12:02:12 +00:00
a-clicked => {
p-current-tool = ToolType.Multibrush;
}
2024-04-10 15:44:23 +00:00
}
2024-04-09 19:47:10 +00:00
}