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
|
width: 360
|
||||||
height: 480
|
height: 480
|
||||||
color: "black"
|
color: "black"
|
||||||
border.color: "grey"
|
|
||||||
border.width: 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
10
Weather.qml
10
Weather.qml
|
@ -2,6 +2,12 @@ import QtQuick 2.0
|
||||||
import net.frozentux.weatherinfo 1.0
|
import net.frozentux.weatherinfo 1.0
|
||||||
|
|
||||||
|
|
||||||
WeatherInfo {
|
Rectangle {
|
||||||
id: weatherdata
|
width: 360
|
||||||
|
height: 600
|
||||||
|
color: "black"
|
||||||
|
WeatherInfo {
|
||||||
|
|
||||||
|
id: weatherdata
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,43 +96,6 @@ Item {
|
||||||
topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6
|
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]
|
//! [3]
|
||||||
BigForecastIcon {
|
BigForecastIcon {
|
||||||
|
|
|
@ -51,6 +51,7 @@ Item {
|
||||||
Text {
|
Text {
|
||||||
text: current.topText
|
text: current.topText
|
||||||
font.pointSize: 28
|
font.pointSize: 28
|
||||||
|
color: "white"
|
||||||
anchors {
|
anchors {
|
||||||
top: current.top
|
top: current.top
|
||||||
left: current.left
|
left: current.left
|
||||||
|
@ -70,6 +71,7 @@ Item {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: current.bottomText
|
text: current.bottomText
|
||||||
|
color: "white"
|
||||||
font.pointSize: 23
|
font.pointSize: 23
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
|
@ -52,6 +52,8 @@ Item {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
width: top.width
|
width: top.width
|
||||||
text: top.topText
|
text: top.topText
|
||||||
|
color: "white"
|
||||||
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: top.height / 5 - dayText.paintedHeight
|
anchors.topMargin: top.height / 5 - dayText.paintedHeight
|
||||||
|
@ -81,6 +83,7 @@ Item {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
width: top.width
|
width: top.width
|
||||||
text: top.bottomText
|
text: top.bottomText
|
||||||
|
color: "white"
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: top.height / 5 - tempText.paintedHeight
|
anchors.bottomMargin: top.height / 5 - tempText.paintedHeight
|
||||||
|
|
|
@ -15,24 +15,6 @@ INSTALLS += target
|
||||||
uri=net.frozentux.weatherinfo
|
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 += \
|
DISTFILES += \
|
||||||
WeatherInfo.qml
|
WeatherInfo.qml
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue