slint/examples/plotter/plotter.60
Simon Hausmann 234dfd85b6 Minor cleanup in the plotter example
Use a horizontal box instead of a horizontal layout
2021-08-19 09:46:18 +02:00

41 lines
1.2 KiB
Text

/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
import { Slider, GroupBox, HorizontalBox, VerticalBox } from "sixtyfps_widgets.60";
export MainWindow := Window {
title: "SixtyFPS Plotter Integration Example";
preferred-width: 800px;
preferred-height: 600px;
callback render_plot(float) -> image;
VerticalBox {
Text {
font-size: 20px;
text: "2D Gaussian PDF";
horizontal-alignment: center;
}
Image {
source: root.render_plot(pitch-slider.value);
}
HorizontalBox {
Text {
text: "Pitch:";
font-weight: 600;
vertical-alignment: center;
}
pitch-slider := Slider {
minimum: 0;
maximum: 180;
value: 42;
}
}
}
}