mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
38 lines
1.1 KiB
Text
38 lines
1.1 KiB
Text
/* LICENSE BEGIN
|
|
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
|
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
|
Copyright (c) 2020 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 { LineEdit } from "sixtyfps_widgets.60";
|
|
|
|
TempConv := Window {
|
|
preferred-height: 64px;
|
|
layout := HorizontalLayout {
|
|
spacing: 7px;
|
|
padding: spacing;
|
|
c := LineEdit {
|
|
text: "0";
|
|
edited(text) => {
|
|
if (text.is-float()) {
|
|
f.text = (text.to-float() * 9 / 5) + 32;
|
|
}
|
|
}
|
|
}
|
|
Text { text: "Celcius = "; }
|
|
f := LineEdit {
|
|
text: "32";
|
|
edited(text) => {
|
|
if (text.is-float()) {
|
|
c.text = (text.to-float() - 32) * (5 / 9);
|
|
}
|
|
}
|
|
}
|
|
Text { text: "Fahrenheit"; }
|
|
}
|
|
}
|
|
|