mirror of
https://github.com/obhq/obliteration.git
synced 2025-04-02 11:02:08 -04:00
66 lines
1.3 KiB
Text
66 lines
1.3 KiB
Text
import { Palette, HorizontalBox, StandardButton } from "std-widgets.slint";
|
|
|
|
component Content inherits Rectangle {
|
|
in property <string> message;
|
|
|
|
background: Palette.background;
|
|
|
|
HorizontalBox {
|
|
VerticalLayout {
|
|
alignment: start;
|
|
|
|
Image {
|
|
source: @image-url("close-octagon-outline.svg");
|
|
colorize: Palette.foreground;
|
|
width: 50px;
|
|
height: 50px;
|
|
}
|
|
}
|
|
|
|
Text {
|
|
text: message;
|
|
wrap: word-wrap;
|
|
}
|
|
}
|
|
}
|
|
|
|
component ActionBar inherits Rectangle {
|
|
callback close();
|
|
|
|
background: Palette.alternate-background;
|
|
|
|
HorizontalBox {
|
|
alignment: end;
|
|
|
|
StandardButton {
|
|
kind: StandardButtonKind.close;
|
|
clicked => {
|
|
close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export component ErrorWindow inherits Window {
|
|
in property <string> message;
|
|
|
|
pure callback close();
|
|
|
|
title: "Obliteration";
|
|
icon: @image-url("@root/assets/icon.png");
|
|
min-width: 400px;
|
|
preferred-width: 400px; // Force word-wrap instead of expand the window.
|
|
|
|
VerticalLayout {
|
|
Content {
|
|
message: message;
|
|
vertical-stretch: 1;
|
|
}
|
|
|
|
ActionBar {
|
|
close => {
|
|
close();
|
|
}
|
|
}
|
|
}
|
|
}
|