Prechádzať zdrojové kódy

Made tooltips stay inside FanItem

Malte Veerman 6 rokov pred
rodič
commit
afb5825c8c

+ 2 - 0
fancontrol-gui/package/contents/ui/Application.qml

@@ -40,6 +40,8 @@ Kirigami.ApplicationWindow {
     }
 
     title: i18n("Fancontrol-GUI")
+    minimumWidth: Kirigami.Units.gridUnit * 20
+    minimumHeight: Kirigami.Units.gridUnit * 15
     reachableModeEnabled: false
     pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25
 

+ 0 - 3
import/qml/FanItem.qml

@@ -124,7 +124,6 @@ Item {
             color: Kirigami.Theme.backgroundColor
             border.color: Kirigami.Theme.textColor
             border.width: 2
-            radius: 1
 
             anchors {
                 top: parent.top
@@ -132,9 +131,7 @@ Item {
                 bottom: horizontalScala.top
                 right: parent.right
                 topMargin: parent.fontSize
-                bottomMargin: 0
                 rightMargin: parent.fontSize * 2
-                leftMargin: 0
             }
 
             function scaleX(temp) {

+ 2 - 2
import/qml/PwmPoint.qml

@@ -78,8 +78,8 @@ Rectangle {
         id: tooltip
 
         parent: root.parent
-        x: root.width + root.x
-        y: root.y - height
+        x: Math.min(root.width + root.x, background.width - width + background.anchors.rightMargin)
+        y: Math.max(root.y - height, -background.anchors.topMargin)
         z: 2
         width: column.width
         height: column.height

+ 2 - 2
import/qml/StatusPoint.qml

@@ -79,8 +79,8 @@ Rectangle {
         id: tooltip
 
         parent: root.parent
-        x: root.width + root.x
-        y: root.y - height
+        x: Math.min(root.width + root.x, background.width - width + background.anchors.rightMargin)
+        y: Math.max(root.y - height, -background.anchors.topMargin)
         z: 2
         width: column.width
         height: column.height