summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-03-14 10:04:30 +0100
committerCaroline Chao <caroline.chao@digia.com>2014-03-14 10:50:17 +0100
commitcedf3bd41dd912267d9fc8b4a23b38ee530e4f4e (patch)
treedcab4df1bf1a0d2ed754048d641ae9ac315715ef
parent9ec069c5d4bfd8a3d4cca77d5a6e168f534cfed0 (diff)
Update zoomed item temperature preferredWidth
Now we are using other languages than English, we need to get the translated string of the temperature unit to calculate the expected size. Change-Id: I262d1f5aec4ed5bf316ebf75301073bac5934b67 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r--qml/js/utils.js2
-rw-r--r--qml/pages/OneDayZoomItem.qml3
2 files changed, 3 insertions, 2 deletions
diff --git a/qml/js/utils.js b/qml/js/utils.js
index 1326b89..69ab20c 100644
--- a/qml/js/utils.js
+++ b/qml/js/utils.js
@@ -126,7 +126,7 @@ function getMaxTempLenght(cityModel) {
var stringTemp = "555" // temperatures estimated between -55 and +55
if (maxLength === 3)
stringTemp = "-" + stringTemp
- return stringTemp.substring(0, maxLength) + "°C."
+ return stringTemp.substring(0, maxLength)
}
// WeatherModel utils
diff --git a/qml/pages/OneDayZoomItem.qml b/qml/pages/OneDayZoomItem.qml
index f1dff3b..3b5d853 100644
--- a/qml/pages/OneDayZoomItem.qml
+++ b/qml/pages/OneDayZoomItem.qml
@@ -119,7 +119,8 @@ GridLayout {
Layout.alignment: Qt.AlignCenter
}
TouchLabel {
- Layout.preferredWidth: expectedTextWidth(Utils.getMaxTempLenght(ApplicationInfo.currentCityModel))
+ Layout.preferredWidth: expectedTextWidth(Utils.getTempFormat(Utils.getMaxTempLenght(ApplicationInfo.currentCityModel)))
+ + 4 * ApplicationInfo.ratio
property int temp: Utils.getTemperature(root.slider.value, root.model)
text : Utils.getTempFormat(temp)
color: temp < 0 ? ApplicationInfo.colors.blue : ApplicationInfo.colors.doubleDarkGray