|
@@ -57,14 +57,8 @@ ApplicationWindow {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onErrorOccurred: function(error) {
|
|
onErrorOccurred: function(error) {
|
|
|
- // Use custom dialog on Pi 5 for proper rotation
|
|
|
|
|
- if (typeof rotateDisplay !== 'undefined' && rotateDisplay) {
|
|
|
|
|
- customErrorDialog.errorText = error
|
|
|
|
|
- customErrorDialog.open()
|
|
|
|
|
- } else {
|
|
|
|
|
- errorDialog.text = error
|
|
|
|
|
- errorDialog.open()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ errorDialog.text = error
|
|
|
|
|
+ errorDialog.open()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onScreenStateChanged: function(isOn) {
|
|
onScreenStateChanged: function(isOn) {
|
|
@@ -110,13 +104,6 @@ ApplicationWindow {
|
|
|
id: patternModel
|
|
id: patternModel
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Rotation container for Pi 5 linuxfb
|
|
|
|
|
- Item {
|
|
|
|
|
- id: rotationContainer
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- rotation: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 180 : 0
|
|
|
|
|
- transformOrigin: Item.Center
|
|
|
|
|
-
|
|
|
|
|
StackView {
|
|
StackView {
|
|
|
id: stackView
|
|
id: stackView
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
@@ -217,9 +204,8 @@ ApplicationWindow {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- } // End rotationContainer
|
|
|
|
|
|
|
|
|
|
- // Virtual Keyboard Support - outside rotation container for proper positioning
|
|
|
|
|
|
|
+ // Virtual Keyboard Support
|
|
|
InputPanel {
|
|
InputPanel {
|
|
|
id: inputPanel
|
|
id: inputPanel
|
|
|
z: 99999
|
|
z: 99999
|
|
@@ -227,16 +213,12 @@ ApplicationWindow {
|
|
|
anchors.left: parent.left
|
|
anchors.left: parent.left
|
|
|
anchors.right: parent.right
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
- // Rotate keyboard for Pi 5
|
|
|
|
|
- rotation: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 180 : 0
|
|
|
|
|
- transformOrigin: Item.Center
|
|
|
|
|
-
|
|
|
|
|
states: State {
|
|
states: State {
|
|
|
name: "visible"
|
|
name: "visible"
|
|
|
when: inputPanel.active
|
|
when: inputPanel.active
|
|
|
PropertyChanges {
|
|
PropertyChanges {
|
|
|
target: inputPanel
|
|
target: inputPanel
|
|
|
- y: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 0 : window.height - inputPanel.height
|
|
|
|
|
|
|
+ y: window.height - inputPanel.height
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -255,69 +237,9 @@ ApplicationWindow {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Error dialog - note: MessageDialog is a system dialog, rotation may not work
|
|
|
|
|
- // If rotation doesn't work, we'll need to replace with a custom Dialog
|
|
|
|
|
MessageDialog {
|
|
MessageDialog {
|
|
|
id: errorDialog
|
|
id: errorDialog
|
|
|
title: "Error"
|
|
title: "Error"
|
|
|
buttons: MessageDialog.Ok
|
|
buttons: MessageDialog.Ok
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // Custom error dialog as fallback for Pi 5 rotation
|
|
|
|
|
- Popup {
|
|
|
|
|
- id: customErrorDialog
|
|
|
|
|
- modal: true
|
|
|
|
|
- x: (window.width - width) / 2
|
|
|
|
|
- y: (window.height - height) / 2
|
|
|
|
|
- width: 320
|
|
|
|
|
- height: 180
|
|
|
|
|
- closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
|
|
-
|
|
|
|
|
- property string errorText: ""
|
|
|
|
|
-
|
|
|
|
|
- background: Rectangle {
|
|
|
|
|
- color: "#2d2d2d"
|
|
|
|
|
- radius: 12
|
|
|
|
|
- border.color: "#404040"
|
|
|
|
|
- border.width: 1
|
|
|
|
|
-
|
|
|
|
|
- // Rotate the entire dialog content for Pi 5
|
|
|
|
|
- rotation: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 180 : 0
|
|
|
|
|
- transformOrigin: Item.Center
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- contentItem: Item {
|
|
|
|
|
- rotation: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 180 : 0
|
|
|
|
|
- transformOrigin: Item.Center
|
|
|
|
|
-
|
|
|
|
|
- Column {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- anchors.margins: 20
|
|
|
|
|
- spacing: 15
|
|
|
|
|
-
|
|
|
|
|
- Label {
|
|
|
|
|
- text: "Error"
|
|
|
|
|
- font.pixelSize: 18
|
|
|
|
|
- font.bold: true
|
|
|
|
|
- color: "#ff6b6b"
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Label {
|
|
|
|
|
- text: customErrorDialog.errorText
|
|
|
|
|
- wrapMode: Text.WordWrap
|
|
|
|
|
- width: parent.width
|
|
|
|
|
- horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
- color: "#ffffff"
|
|
|
|
|
- font.pixelSize: 14
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Button {
|
|
|
|
|
- text: "OK"
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- onClicked: customErrorDialog.close()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|