瀏覽代碼

fixed padding in sensors tab

Malte Veerman 7 年之前
父節點
當前提交
2fbbde8921
共有 1 個文件被更改,包括 10 次插入8 次删除
  1. 10 8
      fancontrol-gui/package/contents/ui/SensorsTab.qml

+ 10 - 8
fancontrol-gui/package/contents/ui/SensorsTab.qml

@@ -25,9 +25,11 @@ import Fancontrol.Qml 1.0 as Fancontrol
 
 
 RowLayout {
+    id: root
+
+    property int padding: 10
     property QtObject loader: Fancontrol.base.loader
 
-    id: root
     anchors.fill: parent
     anchors.margins: 10
 
@@ -36,7 +38,6 @@ RowLayout {
 
         Rectangle {
             property QtObject hwmon: loader.hwmons[index]
-            property int padding: 10
 
             Layout.preferredWidth: root.width / loader.hwmons.length - root.spacing
             Layout.maximumWidth: 500
@@ -45,6 +46,7 @@ RowLayout {
             border.width: 1
             border.color: "black"
             radius: 5
+            clip: true
 
             Column {
                 id: column
@@ -65,15 +67,15 @@ RowLayout {
 
                         Label {
                             anchors.left: parent.left
-                            anchors.leftMargin: padding
-                            Layout.maximumWidth: parent.width - rpmValue.width - padding*2
+                            anchors.leftMargin: root.padding
+                            Layout.maximumWidth: parent.width - rpmValue.width - root.padding*2
                             clip: true
                             text: "Fan " + (index+1) + ":"
                         }
                         Label {
                             id: rpmValue
                             anchors.right: parent.right
-                            anchors.rightMargin: padding
+                            anchors.rightMargin: root.padding
                             text: hwmon.fans[index].rpm + " " + i18n("rpm")
                         }
                     }
@@ -86,15 +88,15 @@ RowLayout {
 
                         Label {
                             anchors.left: parent.left
-                            anchors.leftMargin: padding
+                            anchors.leftMargin: root.padding
                             text: hwmon.temps[index].name + ": "
-                            Layout.maximumWidth: parent.width - tempValue.width - padding*2
+                            Layout.maximumWidth: parent.width - tempValue.width - root.padding*2
                             clip: true
                         }
                         Label {
                             id: tempValue
                             anchors.right: parent.right
-                            anchors.rightMargin: padding
+                            anchors.rightMargin: root.padding
                             text: Units.fromCelsius(hwmon.temps[index].value, Fancontrol.base.unit) + " " + i18n(Fancontrol.base.unit)
                         }
                     }