mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-02 01:23:23 +00:00
Add Tasks and Calendar SVG icons + Fix ToggleButton
This commit is contained in:
parent
6ff7dd8ea8
commit
fe9e7106f1
2 changed files with 27 additions and 3 deletions
|
@ -6,8 +6,13 @@ export component ToggleButton inherits Rectangle {
|
|||
in property text <=> text-component.text;
|
||||
in property text-color <=> text-component.color;
|
||||
in property text-alignment <=> text-component.horizontal-alignment;
|
||||
in property<string> icon-svg;
|
||||
in property<length> icon-size: 1rem;
|
||||
in property<brush> icon-colorize: Palette.foreground;
|
||||
in property<length> icon-svg-stroke-width: 1px;
|
||||
in property<bool> active: false;
|
||||
callback clicked;
|
||||
callback right-clicked;
|
||||
|
||||
|
||||
background: root.active ? Palette.control-background
|
||||
|
@ -20,10 +25,29 @@ export component ToggleButton inherits Rectangle {
|
|||
clicked => {
|
||||
root.clicked();
|
||||
}
|
||||
pointer-event(e) => {
|
||||
if (e.button == PointerEventButton.right && e.kind == PointerEventKind.up) {
|
||||
root.right-clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
alignment: space-between;
|
||||
alignment: start;
|
||||
|
||||
//spacing: 16px;
|
||||
if icon-svg != "" : VerticalLayout {
|
||||
alignment: center;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
Path {
|
||||
commands: root.icon-svg;
|
||||
stroke: icon-colorize;
|
||||
stroke-width: icon-svg-stroke-width;
|
||||
width: icon-size;
|
||||
height: icon-size;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
padding: 8px;
|
||||
padding-top: 4px;
|
||||
|
@ -32,6 +56,5 @@ export component ToggleButton inherits Rectangle {
|
|||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
@children
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue