[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeplasma-addons/plasma/luisgabriellima/weatherstation-qml] applets/weatherstation/package/contents
From: Luís_Gabriel_Lima <lampih () gmail ! com>
Date: 2012-06-30 20:45:54
Message-ID: 20120630204554.89D98A60C6 () git ! kde ! org
[Download RAW message or body]
Git commit 7bdac1df7d3e0270ca4899a2e19a630ecd1eb580 by Luís Gabriel Lima.
Committed on 17/06/2012 at 20:43.
Pushed by luisgabriellima into branch 'plasma/luisgabriellima/weatherstation-qml'.
Renaming some properties
Signed-off-by: Luís Gabriel Lima <lampih@gmail.com>
M +5 -9 applets/weatherstation/package/contents/ui/LCDDigit.qml
M +4 -4 applets/weatherstation/package/contents/ui/LCDDisplay.qml
M +4 -4 applets/weatherstation/package/contents/ui/Wind.qml
M +25 -25 applets/weatherstation/package/contents/ui/main.qml
http://commits.kde.org/kdeplasma-addons/7bdac1df7d3e0270ca4899a2e19a630ecd1eb580
diff --git a/applets/weatherstation/package/contents/ui/LCDDigit.qml \
b/applets/weatherstation/package/contents/ui/LCDDigit.qml index 87da183..b64a121 \
100644
--- a/applets/weatherstation/package/contents/ui/LCDDigit.qml
+++ b/applets/weatherstation/package/contents/ui/LCDDigit.qml
@@ -24,14 +24,14 @@ Item {
property int value: 0
property alias dotVisible: dot.visible
- implicitWidth: all.naturalSize.width
- implicitHeight: all.naturalSize.height
+ implicitWidth: dummy.naturalSize.width
+ implicitHeight: dummy.naturalSize.height
QtObject {
id: internal
- property real dotWidthRate: dot.naturalSize.width / all.naturalSize.width
+ property real dotWidthRate: dot.naturalSize.width / dummy.naturalSize.width
property real digitWidthRate: digit.naturalSize.width /
- (all.naturalSize.width - \
dot.naturalSize.width) + \
(dummy.naturalSize.width - dot.naturalSize.width) property variant values: ["zero", \
"one", "two", "three", "four",
"five", "six", "seven", "eight", "nine"]
}
@@ -42,11 +42,7 @@ Item {
}
// Used just to get the size hints of digit + dot
- PlasmaCore.SvgItem {
- id: all
- svg: digitSvg
- visible: false
- }
+ PlasmaCore.SvgItem { id: dummy; svg: digitSvg; visible: false }
Item {
id: item
diff --git a/applets/weatherstation/package/contents/ui/LCDDisplay.qml \
b/applets/weatherstation/package/contents/ui/LCDDisplay.qml index 124a0a3..8c626c9 \
100644
--- a/applets/weatherstation/package/contents/ui/LCDDisplay.qml
+++ b/applets/weatherstation/package/contents/ui/LCDDisplay.qml
@@ -33,7 +33,7 @@ Item {
property bool decimal: display.number.indexOf(".") > 0
property int dotIndex: display.number.length - 3
- property real resizeRate: display.height / dummy.implicitHeight
+ property real hScaleFactor: display.height / dummy.implicitHeight
function numberToDigits(numberStr) {
digits = [];
@@ -51,14 +51,14 @@ Item {
Row {
id: row
anchors.centerIn: parent
- spacing: 2 * internal.resizeRate
+ spacing: 2 * internal.hScaleFactor
Repeater {
model: internal.numberToDigits(display.number);
LCDDigit {
- height: implicitHeight * internal.resizeRate
- width: implicitWidth * internal.resizeRate
+ height: implicitHeight * internal.hScaleFactor
+ width: implicitWidth * internal.hScaleFactor
value: modelData
dotVisible: internal.decimal && (index == internal.dotIndex)
}
diff --git a/applets/weatherstation/package/contents/ui/Wind.qml \
b/applets/weatherstation/package/contents/ui/Wind.qml index f77da2d..dd12955 100644
--- a/applets/weatherstation/package/contents/ui/Wind.qml
+++ b/applets/weatherstation/package/contents/ui/Wind.qml
@@ -30,7 +30,7 @@ Item {
QtObject {
id: resizeOpts
- property real rate: root.height / root.implicitHeight
+ property real hScaleFactor: root.height / root.implicitHeight
}
PlasmaCore.Svg {
@@ -48,19 +48,19 @@ Item {
LCDDisplay {
id: speedDisplay
anchors.centerIn: parent
- height: Math.round(0.8 * implicitHeight * resizeOpts.rate)
+ height: Math.round(0.8 * implicitHeight * resizeOpts.hScaleFactor)
}
Text {
id: unitLabel
anchors{
top: speedDisplay.bottom
- topMargin: Math.round(3 * resizeOpts.rate)
+ topMargin: Math.round(3 * resizeOpts.hScaleFactor)
horizontalCenter: parent.horizontalCenter
}
font {
family: "Bitstream Vera Sans"
- pixelSize: 9 * resizeOpts.rate
+ pixelSize: 9 * resizeOpts.hScaleFactor
}
color: "#202020"
}
diff --git a/applets/weatherstation/package/contents/ui/main.qml \
b/applets/weatherstation/package/contents/ui/main.qml index 868ac3b..3af6a89 100644
--- a/applets/weatherstation/package/contents/ui/main.qml
+++ b/applets/weatherstation/package/contents/ui/main.qml
@@ -26,8 +26,8 @@ Item {
QtObject {
id: resizeOpts
- property real widthRate: root.width / root.minimumWidth
- property real heightRate: root.height / root.minimumHeight
+ property real wScaleFactor: root.width / root.minimumWidth
+ property real hScaleFactor: root.height / root.minimumHeight
}
Connections {
@@ -86,12 +86,12 @@ Item {
anchors {
top: parent.top
left: parent.left
- topMargin: 12 * resizeOpts.heightRate
- leftMargin: 5 * resizeOpts.widthRate
+ topMargin: 12 * resizeOpts.hScaleFactor
+ leftMargin: 5 * resizeOpts.wScaleFactor
}
font {
family: "DejaVu Sans"
- pixelSize: Math.round(8 * resizeOpts.widthRate)
+ pixelSize: Math.round(8 * resizeOpts.wScaleFactor)
}
color: "#202020"
smooth: true
@@ -102,11 +102,11 @@ Item {
id: condition
anchors {
top: parent.top
- topMargin: 26 * resizeOpts.heightRate
+ topMargin: 26 * resizeOpts.hScaleFactor
horizontalCenter: parent.horizontalCenter
}
- height: naturalSize.height * resizeOpts.heightRate
- width: naturalSize.width * resizeOpts.widthRate
+ height: naturalSize.height * resizeOpts.hScaleFactor
+ width: naturalSize.width * resizeOpts.wScaleFactor
visible: elementId != ""
svg: iconsSvg
}
@@ -116,7 +116,7 @@ Item {
anchors {
top: parent.top
left: weatherLabel.left
- topMargin: 127 * resizeOpts.heightRate
+ topMargin: 127 * resizeOpts.hScaleFactor
}
font: weatherLabel.font
color: weatherLabel.color
@@ -128,11 +128,11 @@ Item {
id: pressureDirection
anchors {
left: parent.left
- leftMargin: 84 * resizeOpts.widthRate
+ leftMargin: 84 * resizeOpts.wScaleFactor
verticalCenter: pressureDisplay.verticalCenter
}
- height: naturalSize.height * resizeOpts.heightRate
- width: naturalSize.width * resizeOpts.widthRate
+ height: naturalSize.height * resizeOpts.hScaleFactor
+ width: naturalSize.width * resizeOpts.wScaleFactor
visible: elementId != ""
svg: lcdSvg
}
@@ -142,9 +142,9 @@ Item {
anchors {
right: parent.right
bottom: pressureLabel.bottom
- rightMargin: 24 * resizeOpts.widthRate
+ rightMargin: 24 * resizeOpts.wScaleFactor
}
- height: 23 * resizeOpts.heightRate
+ height: 23 * resizeOpts.hScaleFactor
superscriptFont: weatherLabel.font
}
@@ -153,7 +153,7 @@ Item {
anchors {
top: parent.top
left: weatherLabel.left
- topMargin: 152 * resizeOpts.heightRate
+ topMargin: 152 * resizeOpts.hScaleFactor
}
font: weatherLabel.font
color: weatherLabel.color
@@ -166,10 +166,10 @@ Item {
anchors {
right: parent.right
bottom: windWidget.top
- rightMargin: 97 * resizeOpts.widthRate
- bottomMargin: 16 * resizeOpts.heightRate
+ rightMargin: 97 * resizeOpts.wScaleFactor
+ bottomMargin: 16 * resizeOpts.hScaleFactor
}
- height: implicitHeight * resizeOpts.heightRate
+ height: implicitHeight * resizeOpts.hScaleFactor
superscriptFont: weatherLabel.font
}
@@ -178,7 +178,7 @@ Item {
anchors {
top: temperatureLabel.top
right: parent.right
- rightMargin: 5 * resizeOpts.widthRate
+ rightMargin: 5 * resizeOpts.wScaleFactor
}
font: weatherLabel.font
color: weatherLabel.color
@@ -191,7 +191,7 @@ Item {
anchors {
top: temperatureDisplay.top
right: parent.right
- rightMargin: 12 * resizeOpts.widthRate
+ rightMargin: 12 * resizeOpts.wScaleFactor
}
height: temperatureDisplay.height
superscript: "%"
@@ -203,7 +203,7 @@ Item {
anchors {
top: temperatureLabel.top
left: weatherLabel.left
- topMargin: 60 * resizeOpts.heightRate
+ topMargin: 60 * resizeOpts.hScaleFactor
}
font: weatherLabel.font
color: weatherLabel.color
@@ -215,11 +215,11 @@ Item {
id: windWidget
anchors {
bottom: parent.bottom
- bottomMargin: 10 * resizeOpts.heightRate
+ bottomMargin: 10 * resizeOpts.hScaleFactor
horizontalCenter: parent.horizontalCenter
}
- width: implicitWidth * resizeOpts.widthRate
- height: implicitHeight * resizeOpts.heightRate
+ width: implicitWidth * resizeOpts.wScaleFactor
+ height: implicitHeight * resizeOpts.hScaleFactor
}
Text {
@@ -230,7 +230,7 @@ Item {
}
font {
family: "DejaVu Sans"
- pixelSize: 7 * resizeOpts.heightRate
+ pixelSize: 7 * resizeOpts.hScaleFactor
}
color: weatherLabel.color
smooth: true
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic