فهرست منبع

Add rotated custom error dialog for Pi 5

MessageDialog is a system dialog that can't be rotated.
Added a custom Dialog component with rotation for Pi 5.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 1 ماه پیش
والد
کامیت
462693edfe
1فایلهای تغییر یافته به همراه37 افزوده شده و 2 حذف شده
  1. 37 2
      dune-weaver-touch/qml/main.qml

+ 37 - 2
dune-weaver-touch/qml/main.qml

@@ -57,8 +57,14 @@ ApplicationWindow {
         }
         }
         
         
         onErrorOccurred: function(error) {
         onErrorOccurred: function(error) {
-            errorDialog.text = error
-            errorDialog.open()
+            // 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()
+            }
         }
         }
         
         
         onScreenStateChanged: function(isOn) {
         onScreenStateChanged: function(isOn) {
@@ -249,9 +255,38 @@ 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
+    Dialog {
+        id: customErrorDialog
+        title: "Error"
+        modal: true
+        anchors.centerIn: parent
+        width: 300
+        height: 150
+        visible: false
+
+        // Rotate for Pi 5
+        rotation: typeof rotateDisplay !== 'undefined' && rotateDisplay ? 180 : 0
+        transformOrigin: Item.Center
+
+        property string errorText: ""
+
+        Label {
+            anchors.centerIn: parent
+            text: customErrorDialog.errorText
+            wrapMode: Text.WordWrap
+            width: parent.width - 40
+            horizontalAlignment: Text.AlignHCenter
+        }
+
+        standardButtons: Dialog.Ok
+    }
 }
 }