Use the new FishUI API

main 0.3
reionwong 4 years ago
parent d4a5298a1f
commit 44a8797cf4

@ -11,8 +11,8 @@ Item {
GridLayout { GridLayout {
id: _mainLayout id: _mainLayout
anchors.fill: parent anchors.fill: parent
columnSpacing: 2 columnSpacing: 1
rowSpacing: 2 rowSpacing: 1
columns: 4 columns: 4
StandardButton { text: "C"; onClicked: control.pressed(text) } StandardButton { text: "C"; onClicked: control.pressed(text) }

@ -53,7 +53,7 @@ Item {
TextField { TextField {
id: textField id: textField
height: 50 Layout.preferredHeight: 50
Layout.fillWidth: true Layout.fillWidth: true
Keys.onReturnPressed: appendToTextField('=') Keys.onReturnPressed: appendToTextField('=')
Keys.onEnterPressed: appendToTextField('=') Keys.onEnterPressed: appendToTextField('=')

@ -5,16 +5,23 @@ import Cutefish.Calculator 1.0
import FishUI 1.0 as FishUI import FishUI 1.0 as FishUI
FishUI.Window { FishUI.Window {
visible: true id: rootWindow
width: 350 width: 350
height: 550 height: 550
minimumWidth: 350 minimumWidth: 350
minimumHeight: 550 minimumHeight: 550
title: qsTr("Calculator") title: qsTr("Calculator")
id: rootWindow
backgroundColor: FishUI.Theme.darkMode ? Qt.rgba(46 / 255, 46 / 255, 46 / 255, 1.0) background.color: FishUI.Theme.darkMode ? Qt.rgba(46 / 255, 46 / 255, 46 / 255, 1.0)
: Qt.rgba(240 / 255, 238 / 255, 241 / 255, 1.0) : Qt.rgba(240 / 255, 238 / 255, 241 / 255, 1.0)
background.opacity: rootWindow.compositing ? 0.9 : 1.0
FishUI.WindowBlur {
view: rootWindow
geometry: Qt.rect(rootWindow.x, rootWindow.y, rootWindow.width, rootWindow.height)
windowRadius: rootWindow.background.radius
enabled: true
}
CalcEngine { CalcEngine {
id: calcEngine id: calcEngine
@ -37,6 +44,14 @@ FishUI.Window {
StandardPad { StandardPad {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Rectangle {
z: -1
anchors.fill: parent
color: rootWindow.background.color
opacity: 0.4
}
onPressed: zone.appendToTextField(text) onPressed: zone.appendToTextField(text)
} }
} }

Loading…
Cancel
Save