Maldela 9 роки тому
батько
коміт
002cb7213b

+ 1 - 1
fancontrol-gui/package/contents/ui/ConfigfileTab.qml

@@ -28,7 +28,7 @@ ColumnLayout {
     property QtObject loader
 
     anchors.fill: parent
-    anchors.topMargin: 5
+    anchors.margins: 10
 
     Label {
         anchors.top: parent.top

+ 2 - 2
fancontrol-gui/package/contents/ui/PwmFansTab.qml

@@ -34,7 +34,7 @@ ColumnLayout {
 
     id: root
     anchors.fill: parent
-    anchors.topMargin: 5
+    anchors.margins: 10
 
     RowLayout {
         width: parent.width
@@ -61,7 +61,7 @@ ColumnLayout {
     Loader {
         Layout.fillHeight: true
         Layout.fillWidth: true
-        active: !!tempModel && !!systemdCom && pwmFans.length < fanComboBox.currentIndex
+        active: !!tempModel && !!systemdCom && pwmFans.length > fanComboBox.currentIndex
 
         sourceComponent: PwmFan {
             unit: !!baseObject ? baseObject.unit : 0

+ 1 - 2
fancontrol-gui/package/contents/ui/SensorsTab.qml

@@ -29,8 +29,7 @@ RowLayout {
 
     id: root
     anchors.fill: parent
-    anchors.margins: 2
-    anchors.topMargin: 10
+    anchors.margins: 10
 
     Repeater {
         model: !!loader ? loader.hwmons.length : 0

+ 1 - 1
fancontrol-gui/package/contents/ui/SettingsTab.qml

@@ -35,7 +35,7 @@ Item {
 
     id: root
     anchors.fill: parent
-    anchors.topMargin: 5
+    anchors.margins: 10
 
     Column {
         id: column

+ 7 - 6
import/qml/PwmFan.qml

@@ -114,15 +114,16 @@ Rectangle {
                 bottom: background.bottom
                 left: parent.left
             }
-            width: graph.fontSize * 3
+            width: MoreMath.maxWidth(children) + graph.fontSize
 
             Repeater {
+                id: verticalRepeater
+
                 model: graph.verticalScalaCount
 
                 Label {
-                    x: 0
-                    width: verticalScala.width - graph.fontSize / 3
-                    y: background.scaleY(255 / (graph.verticalScalaCount - 1) * index) - graph.fontSize / 2
+                    x: verticalScala.width - implicitWidth - graph.fontSize / 3
+                    y: background.height - background.height / (graph.verticalScalaCount - 1) * index - graph.fontSize / 2
                     horizontalAlignment: Text.AlignRight
                     color: graph.pal.text
                     text: index * (100 / (graph.verticalScalaCount - 1)) + "%"
@@ -144,8 +145,8 @@ Rectangle {
                 model: graph.horIntervals.length;
 
                 Label {
-                    x: Math.min(horizontalScala.width, background.scaleX(Units.toCelsius(graph.horIntervals[index]), root.unit)) - width / 2
-                    y: graph.fontSize / 2
+                    x: Math.min(horizontalScala.width, background.width / (graph.horIntervals.length - 1) * index) - width / 2
+                    y: horizontalScala.height / 2 - implicitHeight / 2
                     color: graph.pal.text
                     text: graph.horIntervals[index] + graph.suffix
                     font.pixelSize: graph.fontSize

+ 8 - 0
import/qml/math.js

@@ -35,3 +35,11 @@ function intervals(lower, upper, delta) {
     array.push(upper);
     return array;
 }
+
+function maxWidth(items) {
+    var maxWidth = 0;
+    for (var i=0; i<items.length; i++) {
+        maxWidth = Math.max(items[i].width, maxWidth);
+    }
+    return maxWidth;
+}