From 1abd2c072b91482ffddeaccb421bc997c26d3c77 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Sat, 10 May 2014 12:23:45 +0200 Subject: Review the temperature label preferredWidth calculation in zoom item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is now more generic and can adapt to different localizations and temperature units if needed. Change-Id: I8b756cd117e5be8bfbf3cc538c62542a5c9e371c Reviewed-by: Jędrzej Nowacki --- qml/js/utils.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'qml/js') diff --git a/qml/js/utils.js b/qml/js/utils.js index 76dffe3..cf5948f 100644 --- a/qml/js/utils.js +++ b/qml/js/utils.js @@ -125,20 +125,6 @@ function getMaxMinTemp(dayModel) { return [minTemp, maxTemp] } -function getMaxTempLenght(cityModel) { - var maxLength = 1 - for (var indexDay = 0; indexDay < cityModel.daysCount(); indexDay++) { - var day = cityModel.getDayModel(indexDay) - var range = getMaxMinTemp(day) - maxLength = Math.max(range[0].toString().length, maxLength) - maxLength = Math.max(range[1].toString().length, maxLength) - } - var stringTemp = "555" // temperatures estimated between -55 and +55 - if (maxLength === 3) - stringTemp = "-" + stringTemp - return stringTemp.substring(0, maxLength) -} - // WeatherModel utils function getWindType(windspeed) -- cgit v1.2.3