Browse Source

New weather icons & style
Added .gitignore

Bernd Weimer 8 years ago
parent
commit
d286b2f5c0
24 changed files with 88 additions and 20 deletions
  1. 18 0
      .gitignore
  2. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Chance_Of_Showers.png
  3. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Clear.png
  4. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Cloudy_Period.png
  5. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Cloudy_With_Dizzle.png
  6. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Few_Flurries_Night.png
  7. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Freezing_Rain.png
  8. 2 0
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/README
  9. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Thunder_Showers.png
  10. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_rain.png
  11. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_snow.png
  12. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_storm.png
  13. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/cloudy.png
  14. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/flurries.png
  15. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mist.png
  16. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mostly_cloudy.png
  17. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mostly_sunny.png
  18. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/partly_cloudy.png
  19. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/rain.png
  20. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/rain_snow.png
  21. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/snow.png
  22. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/sunny.png
  23. BIN
      hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/thunderstorm.png
  24. 68 20
      hub/skins/confluence/720/WeatherWindow.qml

+ 18 - 0
.gitignore

@@ -0,0 +1,18 @@
+*~
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.swp
+*.rej
+*.so
+.qmake.cache
+Makefile
+*.user
+*.log
+hub/qtmediahub
+hub/qmh
+hub/resources/lib/lib*
+.directory

BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Chance_Of_Showers.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Clear.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Cloudy_Period.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Cloudy_With_Dizzle.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Few_Flurries_Night.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Freezing_Rain.png


+ 2 - 0
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/README

@@ -0,0 +1,2 @@
+Weather icons dervied from:
+http://browse.deviantart.com/?qh=&section=&global=1&q=weather+icons#/djlw6l

BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/Thunder_Showers.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_rain.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_snow.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/chance_of_storm.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/cloudy.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/flurries.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mist.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mostly_cloudy.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/mostly_sunny.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/partly_cloudy.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/rain.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/rain_snow.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/snow.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/sunny.png


BIN
hub/skins/confluence/3rdparty/skin.confluence/media/weathericons/thunderstorm.png


+ 68 - 20
hub/skins/confluence/720/WeatherWindow.qml

@@ -18,7 +18,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 ****************************************************************************/
 
 import QtQuick 1.0
-import confluence.components 1.0
+import "../components"
 
 Window {
     id: root
@@ -30,18 +30,42 @@ Window {
     }
 
     function showCast(name) {
-        city=name
-        weather.opacity=1.0
-        cityListView.state = "hide"
-        root.forceActiveFocus()
+        city=name;
+        weather.opacity=1.0;
+        cityListView.state = "hide";
+        root.forceActiveFocus();
     }
 
     function showList() {
-        cityListView.state = ""
-        weather.opacity=0.5
-        listView.forceActiveFocus()
+        cityListView.state = "";
+        weather.opacity=0.5;
+        listView.forceActiveFocus();
     }
 
+    function fullWeekDay(name) {
+        var map = {
+            "Mon" : "MONDAY",
+            "Tue" : "TUESDAY",
+            "Wed" : "WEDNESDAY",
+            "Thu" : "THURSDAY",
+            "Fri" : "FRIDAY",
+            "Sat" : "SATURDAY",
+            "Sun" : "SUNDAY",
+        };
+        return map[name];
+    }
+
+    function mapIcon(name) {
+        var i = name.lastIndexOf("/")+1;
+        var sn = themeResourcePath+"/media/weathericons/"+name.substr(i, name.length-i-4)+".png";
+        return sn;
+    }
+
+    function stripLast5(string) {
+        return (string.substr(0, string.length-5))
+    }
+
+
     Keys.onSpacePressed: {
         showList()
         event.accepted = true
@@ -55,7 +79,7 @@ Window {
         Panel {
             Item {
                 id: currentWeather
-                width: 480
+                width: 440
                 height: 600
 
                 Column {
@@ -80,7 +104,7 @@ Window {
                         color: "grey"
                         font.pointSize: 12
                         anchors.horizontalCenter: parent.horizontalCenter
-                        text: weatherModel.count > 0 ? "Last Updated - " + weatherModel.get(0).current_date_time : ""
+                        text: weatherModel.count > 0 ? "Last Updated - " + stripLast5(weatherModel.get(0).current_date_time) : ""
                     }
 
                     Item {
@@ -109,7 +133,7 @@ Window {
                             height: width
                             smooth: true
                             asynchronous: true
-                            source: weatherMeasurements.count > 0 ? "http://www.google.com" + weatherMeasurements.get(0).icon : ""
+                            source: weatherMeasurements.count > 0 ? mapIcon(weatherMeasurements.get(0).icon) : ""
                             anchors.right: parent.right
                             anchors.verticalCenter: parent.verticalCenter
                         }
@@ -142,9 +166,9 @@ Window {
         Panel {
             Column {
                 anchors.centerIn: parent
-                width: 480
+                width: 440
                 height: 600
-                anchors.margins: 40
+                anchors.margins: 50
                 spacing: 40
 
                 ConfluenceText {
@@ -176,30 +200,54 @@ Window {
                             id: dayofweek
                             anchors.horizontalCenter: parent.horizontalCenter
                             anchors.top: sep.bottom; anchors.topMargin: 8
-                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? weatherForecast.get(index).day_of_week : ""
+                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? fullWeekDay(weatherForecast.get(index).day_of_week) : ""
+                        }
+
+                        Text {
+                            id: hightemptext
+                            anchors.top: dayofweek.bottom
+                            smooth: true
+                            font.pointSize: 20
+                            color: "grey"
+                            text: "High: "
                         }
                         ConfluenceText {
-                            id: hightemp
+                            id: hightempvalue
                             anchors.top: dayofweek.bottom
-                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? "High: " + root.fahrenheit2celsius(weatherForecast.get(index).high_f) + " °C" : ""
+                            anchors.left: hightemptext.right
+                            font.weight: Font.Normal
+                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? root.fahrenheit2celsius(weatherForecast.get(index).high_f) + " °C" : ""
                         }
 
+                        Text {
+                            id: lowtemptext
+                            anchors.top: dayofweek.bottom
+                            anchors.left: hightempvalue.right; anchors.leftMargin: 25
+                            smooth: true
+                            font.pointSize: 20
+                            color: "grey"
+                            text: "Low: "
+                        }
                         ConfluenceText {
-                            anchors.left: hightemp.right; anchors.leftMargin: 25
+                            anchors.left: lowtemptext.right;
                             anchors.top: dayofweek.bottom
-                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? "Low: " + root.fahrenheit2celsius(weatherForecast.get(index).low_f)  + " °C" : ""
+                            font.weight: Font.Normal
+                            text: weatherForecast.count > 0 && weatherForecast.get(index) ? root.fahrenheit2celsius(weatherForecast.get(index).low_f)  + " °C" : ""
                         }
+
                         ConfluenceText {
                             id: condition
-                            anchors.top: hightemp.bottom
+                            anchors.top: hightemptext.bottom
+                            font.weight: Font.Normal
                             text: weatherForecast.count > 0 && weatherForecast.get(index) ? weatherForecast.get(index).condition : ""
                         }
+
                         Image {
                             width: parent.height/1.5
                             height: width
                             smooth: true
                             asynchronous: true
-                            source: weatherForecast.count > 0 && weatherForecast.get(index)  ? "http://www.google.com" + weatherForecast.get(index).icon : ""
+                            source: weatherForecast.count > 0 && weatherForecast.get(index) ? mapIcon(weatherForecast.get(index).icon) : ""
                             anchors.right: parent.right
                             anchors.bottom: condition.bottom
                         }