1
0
Эх сурвалжийг харах

rotate screen & fix buttons

tuanchris 3 сар өмнө
parent
commit
e65a5ed82d

+ 18 - 16
dune-weaver-touch/qml/components/ModernControlButton.qml

@@ -4,35 +4,36 @@ import QtQuick.Layouts 1.15
 import QtQuick.Effects
 
 Rectangle {
+    id: root
     property alias text: buttonLabel.text
     property string icon: ""
     property color buttonColor: "#2196F3"
     property bool enabled: true
     property int fontSize: 16
-    
+
     signal clicked()
-    
+
     radius: 12
     color: enabled ? buttonColor : "#E0E0E0"
     opacity: enabled ? 1.0 : 0.6
-    
+
     // Gradient effect
     gradient: Gradient {
-        GradientStop { position: 0; color: Qt.lighter(buttonColor, 1.1) }
-        GradientStop { position: 1; color: buttonColor }
+        GradientStop { position: 0; color: Qt.lighter(root.buttonColor, 1.1) }
+        GradientStop { position: 1; color: root.buttonColor }
     }
-    
+
     // Press animation
     scale: mouseArea.pressed ? 0.95 : (mouseArea.containsMouse ? 1.02 : 1.0)
-    
+
     Behavior on scale {
         NumberAnimation { duration: 150; easing.type: Easing.OutQuad }
     }
-    
+
     Behavior on color {
         ColorAnimation { duration: 200 }
     }
-    
+
     // Shadow effect
     layer.enabled: true
     layer.effect: MultiEffect {
@@ -41,21 +42,22 @@ Rectangle {
         shadowBlur: 0.8
         shadowVerticalOffset: 2
     }
-    
+
     RowLayout {
         anchors.centerIn: parent
         spacing: 8
-        
+
         Text {
-            text: parent.parent.icon
-            font.pixelSize: parent.parent.fontSize + 2
-            visible: parent.parent.icon !== ""
+            text: root.icon
+            font.pixelSize: root.fontSize + 2
+            color: "white"
+            visible: root.icon !== ""
         }
-        
+
         Label {
             id: buttonLabel
             color: "white"
-            font.pixelSize: parent.parent.fontSize
+            font.pixelSize: root.fontSize
             font.bold: true
         }
     }

+ 4 - 2
dune-weaver-touch/setup_kiosk.sh

@@ -88,6 +88,7 @@ gpu_mem=128
 max_framebuffers=2
 display_auto_detect=1
 disable_overscan=1
+display_lcd_rotate=2
 EOF
     else
         # Pi 4/5 configuration
@@ -100,6 +101,7 @@ gpu_mem=128
 max_framebuffers=2
 display_auto_detect=1
 disable_overscan=1
+display_lcd_rotate=2
 EOF
     fi
     
@@ -189,7 +191,7 @@ run_linuxfb() {
     export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
     export QT_QPA_FONTDIR=/usr/share/fonts/truetype
     export QT_QPA_FB_HIDECURSOR=1
-    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=0
+    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=180
     
     # Enable Virtual Keyboard
     export QT_IM_MODULE=qtvirtualkeyboard
@@ -208,7 +210,7 @@ run_eglfs() {
     export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
     export QT_QPA_EGLFS_KMS_ATOMIC=1
     export QT_QPA_EGLFS_HIDECURSOR=1
-    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=0
+    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=180
     
     # Enable Virtual Keyboard
     export QT_IM_MODULE=qtvirtualkeyboard