Add box layout widget
This commit is contained in:
parent
c67f6efb32
commit
61f20f228e
|
@ -1,6 +1,6 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { Panel } from "widgets/panel.slint";
|
||||
import { HorizontalBox, VerticalBox } from "widgets/layout.slint";
|
||||
import { Box, HorizontalBox, VerticalBox } from "widgets/layout.slint";
|
||||
|
||||
|
||||
export component ObjectToolPanel inherits VerticalBox {
|
||||
|
@ -98,7 +98,7 @@ export component ObjectToolPanel inherits VerticalBox {
|
|||
text: @tr("Name:");
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
Box {
|
||||
j-padding: 0px;
|
||||
|
||||
Text {
|
||||
|
@ -110,14 +110,14 @@ export component ObjectToolPanel inherits VerticalBox {
|
|||
}
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
Box {
|
||||
width: Metrics.size-md;
|
||||
j-elevation: 3;
|
||||
|
||||
Rectangle { }
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
Box {
|
||||
width: Metrics.size-md;
|
||||
j-elevation: 3;
|
||||
|
||||
|
@ -125,7 +125,7 @@ export component ObjectToolPanel inherits VerticalBox {
|
|||
}
|
||||
}
|
||||
|
||||
VerticalBox {
|
||||
Box {
|
||||
Text {
|
||||
color: DarkPalette.text[4];
|
||||
font-size: Metrics.font-lg;
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import { Metrics, DarkPalette } from "theme.slint";
|
||||
import { Button } from "std-widgets.slint";
|
||||
import { HorizontalSeparator } from "widgets/separator.slint";
|
||||
import { VerticalBox } from "widgets/layout.slint";
|
||||
import { Box, VerticalBox } from "widgets/layout.slint";
|
||||
|
||||
component ToolBarItem inherits Rectangle {
|
||||
component ToolBarItem inherits Box {
|
||||
width: Metrics.size-lg;
|
||||
height: Metrics.size-lg;
|
||||
border-radius: Metrics.radius-md;
|
||||
background: DarkPalette.background[2];
|
||||
j-elevation: 2;
|
||||
}
|
||||
|
||||
export component ToolBar inherits VerticalBox {
|
||||
|
|
|
@ -45,3 +45,16 @@ export component VerticalBox inherits Rectangle {
|
|||
@children
|
||||
}
|
||||
}
|
||||
|
||||
export component Box inherits Rectangle {
|
||||
in property <int> j-elevation: 1;
|
||||
in property <length> j-rounding: Metrics.radius-md;
|
||||
in property <length> j-padding: Metrics.padding-md;
|
||||
|
||||
background: DarkPalette.background[j-elevation];
|
||||
border-radius: j-rounding;
|
||||
clip: true;
|
||||
padding: j-padding;
|
||||
|
||||
@children
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue