瀏覽代碼

improved tooltips of movable points in the graphs

Malte Veerman 10 年之前
父節點
當前提交
85cd5473c0
共有 2 個文件被更改,包括 8 次插入6 次删除
  1. 5 4
      package/contents/ui/PwmFan.qml
  2. 3 2
      package/contents/ui/PwmPoint.qml

+ 5 - 4
package/contents/ui/PwmFan.qml

@@ -224,8 +224,8 @@ Rectangle {
             visible: parent.contains(Coordinates.centerOf(this)) && parent.height > 0
             visible: parent.contains(Coordinates.centerOf(this)) && parent.height > 0
             drag.onActiveChanged: {
             drag.onActiveChanged: {
                 if (!drag.active) {
                 if (!drag.active) {
-                    fan.minStop = canvas.scalePwm(centerY);
-                    fan.minTemp = canvas.scaleTemp(centerX);
+                    fan.minStop = Math.round(canvas.scalePwm(centerY));
+                    fan.minTemp = Math.round(canvas.scaleTemp(centerX));
                     if (!fanOffCheckBox.checked) fan.minPwm = fan.minStop;
                     if (!fanOffCheckBox.checked) fan.minPwm = fan.minStop;
                 }
                 }
             }
             }
@@ -242,8 +242,8 @@ Rectangle {
             visible: parent.contains(Coordinates.centerOf(this)) && parent.height > 0
             visible: parent.contains(Coordinates.centerOf(this)) && parent.height > 0
             drag.onActiveChanged: {
             drag.onActiveChanged: {
                 if (!drag.active) {
                 if (!drag.active) {
-                    fan.maxPwm = canvas.scalePwm(centerY);
-                    fan.maxTemp = canvas.scaleTemp(centerX);
+                    fan.maxPwm = Math.round(canvas.scalePwm(centerY));
+                    fan.maxTemp = Math.round(canvas.scaleTemp(centerX));
                 }
                 }
             }
             }
         }
         }
@@ -423,6 +423,7 @@ Rectangle {
 
 
                 id: testButton
                 id: testButton
                 text: fan.testing ? i18n("Abort test") : i18n("Test start and stop values")
                 text: fan.testing ? i18n("Abort test") : i18n("Test start and stop values")
+                iconName: "dialog-password"
                 anchors.right: parent.right
                 anchors.right: parent.right
                 onClicked: {
                 onClicked: {
                     if (fan.testing) {
                     if (fan.testing) {

+ 3 - 2
package/contents/ui/PwmPoint.qml

@@ -31,6 +31,7 @@ Rectangle {
     property alias drag: pwmMouse.drag
     property alias drag: pwmMouse.drag
     property alias size: root.width
     property alias size: root.width
     property int unit: 0
     property int unit: 0
+    property var locale: Qt.locale()
 
 
     id: root
     id: root
     width: 10
     width: 10
@@ -70,14 +71,14 @@ Rectangle {
             Label {
             Label {
                 id: pwm
                 id: pwm
                 font.pixelSize: root.size * 1.5
                 font.pixelSize: root.size * 1.5
-                text: Number(Units.fromCelsius(canvas.scalePwm(root.centerY) / 2.55)).toLocaleString() + '%'
+                text: Number(Math.round(Units.fromCelsius(canvas.scalePwm(root.centerY))) / 2.55).toLocaleString(locale, 'f', 1) + '%'
             }
             }
             Label {
             Label {
                 property string suffix: (unit == 0) ? "°C" : (unit == 1) ? "K" : "°F"
                 property string suffix: (unit == 0) ? "°C" : (unit == 1) ? "K" : "°F"
                 
                 
                 id: temp
                 id: temp
                 font.pixelSize: root.size * 1.5
                 font.pixelSize: root.size * 1.5
-                text: Number(Units.fromCelsius(canvas.scaleTemp(root.centerX), unit)).toLocaleString() + suffix                      
+                text: Math.round(Units.fromCelsius(canvas.scaleTemp(root.centerX), unit)) + suffix                      
             }
             }
         }
         }
     }
     }