Browse Source

All widgets are currently labels; make this more consistent

Change-Id: If29f9a6e24ae0a7f703a48697a7a1a24af48f254
Donald Carr 8 years ago
parent
commit
41bf64f401

+ 3 - 13
qml/widgets/Clock.qml

@@ -3,8 +3,7 @@ import QtQuick 2.6
 Widget {
     id: root
 
-    width: childrenRect.width
-    height: clockLabel.height
+    text: d.timeString
 
     QtObject {
         id: d
@@ -25,15 +24,7 @@ Widget {
         onTriggered: d.timeChanged()
     }
 
-    Text {
-        //anchors.centerIn: parent
-        id: clockLabel
-        color: "white"
-        font.bold: true
-        font.pixelSize: 100
-        text: d.timeString
-    }
-    Item {
+    /*Item {
         anchors { left: clockLabel.right; leftMargin: 20 }
         height: root.height
         width: childrenRect.width
@@ -64,6 +55,5 @@ Widget {
                 text: d.month
             }
         }
-
-    }
+    }*/
 }

+ 1 - 10
qml/widgets/FPS.qml

@@ -7,16 +7,7 @@ Widget {
     property real t
     property int frame: 0
 
-    height: fpsText.height
-    width: fpsText.width
-
-    Text {
-        id: fpsText
-
-        font.pixelSize: widgetProperties.fontPixelSize
-        color: "white"
-        text: "FPS:" + fpsTimer.fps
-    }
+    text: "FPS:" + fpsTimer.fps
 
     Timer {
         id: fpsTimer

+ 1 - 9
qml/widgets/ItemCount.qml

@@ -1,13 +1,5 @@
 import QtQuick 2.6
 
 Widget {
-    width: itemCountLabel.width
-    height: itemCountLabel.height
-
-    Text {
-        id: itemCountLabel
-        font.pixelSize: widgetProperties.fontPixelSize
-        text: "Items:" + globalUtil.itemCount
-        color: "white"
-    }
+    text: "Items:" + globalUtil.itemCount
 }

+ 1 - 9
qml/widgets/Resolution.qml

@@ -1,13 +1,5 @@
 import QtQuick 2.6
 
 Widget {
-    width: resolutionLabel.width
-    height: resolutionLabel.height
-
-    Text {
-        id: resolutionLabel
-        font.pixelSize: 100
-        text: screenSize.width + "x" + screenSize.height
-        color: "white"
-    }
+    text: screenSize.width + "x" + screenSize.height
 }

+ 10 - 2
qml/widgets/Widget.qml

@@ -1,7 +1,15 @@
 import QtQuick 2.6
 
 Item {
-    property variant widgetProperties: QtObject {
-        property int fontPixelSize: 40
+    width: childrenRect.width
+    height: childrenRect.height
+
+    property alias text: label.text
+
+    Text {
+        id: label
+        font.pixelSize: 40
+        font.bold: true
+        color: "white"
     }
 }

+ 2 - 0
qml/widgets/WidgetTray.qml

@@ -12,6 +12,8 @@ Item {
 
     Row {
         spacing: 10.0
+        Resolution {
+        }
         ItemCount {
         }
         FPS {