Fixed some more stuff. weatherinfo works now
This commit is contained in:
parent
2dca04fe35
commit
92456d99d4
6 changed files with 13 additions and 59 deletions
|
@ -30,8 +30,6 @@ ApplicationWindow {
|
|||
width: 360
|
||||
height: 480
|
||||
color: "black"
|
||||
border.color: "grey"
|
||||
border.width: 0
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,12 @@ import QtQuick 2.0
|
|||
import net.frozentux.weatherinfo 1.0
|
||||
|
||||
|
||||
Rectangle {
|
||||
width: 360
|
||||
height: 600
|
||||
color: "black"
|
||||
WeatherInfo {
|
||||
|
||||
id: weatherdata
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,43 +96,6 @@ Item {
|
|||
topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 25
|
||||
color: "lightgrey"
|
||||
|
||||
Text {
|
||||
text: (model.hasValidCity ? model.city : "Unknown location") + (model.useGps ? " (GPS)" : "")
|
||||
anchors.fill: parent
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (model.useGps) {
|
||||
model.useGps = false
|
||||
model.city = "Brisbane"
|
||||
} else {
|
||||
switch (model.city) {
|
||||
case "Brisbane":
|
||||
model.city = "Oslo"
|
||||
break
|
||||
case "Oslo":
|
||||
model.city = "Helsinki"
|
||||
break
|
||||
case "Helsinki":
|
||||
model.city = "New York"
|
||||
break
|
||||
case "New York":
|
||||
model.useGps = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! [3]
|
||||
BigForecastIcon {
|
||||
|
|
|
@ -51,6 +51,7 @@ Item {
|
|||
Text {
|
||||
text: current.topText
|
||||
font.pointSize: 28
|
||||
color: "white"
|
||||
anchors {
|
||||
top: current.top
|
||||
left: current.left
|
||||
|
@ -70,6 +71,7 @@ Item {
|
|||
|
||||
Text {
|
||||
text: current.bottomText
|
||||
color: "white"
|
||||
font.pointSize: 23
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
|
|
|
@ -52,6 +52,8 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
width: top.width
|
||||
text: top.topText
|
||||
color: "white"
|
||||
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: top.height / 5 - dayText.paintedHeight
|
||||
|
@ -81,6 +83,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
width: top.width
|
||||
text: top.bottomText
|
||||
color: "white"
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: top.height / 5 - tempText.paintedHeight
|
||||
|
|
|
@ -15,24 +15,6 @@ INSTALLS += target
|
|||
uri=net.frozentux.weatherinfo
|
||||
|
||||
|
||||
OTHER_FILES += \
|
||||
components/BigForecastIcon.qml \
|
||||
components/ForecastIcon.qml \
|
||||
components/WeatherIcon.qml \
|
||||
icons/weather-few-clouds.xcf \
|
||||
icons/weather-fog.xcf \
|
||||
icons/weather-haze.xcf \
|
||||
icons/weather-icy.xcf \
|
||||
icons/weather-overcast.xcf \
|
||||
icons/weather-showers.xcf \
|
||||
icons/weather-sleet.xcf \
|
||||
icons/weather-snow.xcf \
|
||||
icons/weather-storm.xcf \
|
||||
icons/weather-sunny.xcf \
|
||||
icons/weather-sunny-very-few-clouds.xcf \
|
||||
icons/weather-thundershower.xcf \
|
||||
icons/README.txt
|
||||
|
||||
DISTFILES += \
|
||||
WeatherInfo.qml
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue