Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/DashWeatherDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* Copyright 2016 Aditya Mehra <aix.m@outlook.com> 0002 0003 This library is free software; you can redistribute it and/or 0004 modify it under the terms of the GNU Lesser General Public 0005 License as published by the Free Software Foundation; either 0006 version 2.1 of the License, or (at your option) version 3, or any 0007 later version accepted by the membership of KDE e.V. (or its 0008 successor approved by the membership of KDE e.V.), which shall 0009 act as a proxy defined in Section 6 of version 3 of the license. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Lesser General Public License for more details. 0015 0016 You should have received a copy of the GNU Lesser General Public 0017 License along with this library. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 import QtQuick 2.9 0021 import QtQuick.Controls 2.2 0022 import QtQuick.Layouts 1.3 0023 import QtGraphicalEffects 1.0 0024 import org.kde.plasma.core 2.0 as PlasmaCore 0025 import org.kde.plasma.plasmoid 2.0 0026 import org.kde.plasma.components 2.0 as PlasmaComponents 0027 0028 Rectangle { 0029 id: dashDelegateItmWeather 0030 height: units.gridUnit * 7.75 0031 width: cbwidth - units.gridUnit * 0.50 0032 border.width: 1 0033 border.color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) 0034 color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) 0035 layer.enabled: true 0036 layer.effect: DropShadow { 0037 horizontalOffset: 0 0038 verticalOffset: 1 0039 radius: 10 0040 samples: 32 0041 spread: 0.1 0042 color: Qt.rgba(0, 0, 0, 0.3) 0043 } 0044 property bool expanded: false 0045 0046 Item { 0047 id: contentdlgtitem 0048 width: parent.width 0049 height: parent.height 0050 0051 Item { 0052 id: skillTopRowLayout 0053 anchors.top: parent.top 0054 anchors.left: parent.left 0055 anchors.right: parent.right 0056 implicitHeight: dashHeader.implicitHeight + units.gridUnit * 0.5 0057 0058 Text { 0059 id: dashHeader 0060 anchors.left: dashHeaderSeprtr.right 0061 anchors.leftMargin: units.gridUnit * 0.25 0062 anchors.verticalCenter: parent.verticalCenter 0063 wrapMode: Text.Wrap; 0064 font.bold: true; 0065 font.pointSize: theme.defaultFont.pointSize 0066 font.letterSpacing: theme.defaultFont.letterSpacing 0067 font.wordSpacing: theme.defaultFont.wordSpacing 0068 font.family: theme.defaultFont.family 0069 renderType: Text.NativeRendering 0070 color: PlasmaCore.ColorScope.textColor 0071 text: i18n("%1 | %2", model.contents.itemWeatherCity, model.contents.itemWeatherTempTypeHourZero) 0072 } 0073 0074 Image { 0075 id: weatherDashCardIcon 0076 anchors.left: dashHeader.right 0077 anchors.leftMargin: units.gridUnit * 0.25 0078 anchors.verticalCenter: parent.verticalCenter 0079 source: model.contents.itemWeatherIconTypeHourZero 0080 width: units.gridUnit * 1.25 0081 height: units.gridUnit * 1.25 0082 } 0083 0084 PlasmaCore.SvgItem { 0085 id: dashHeaderSeprtr 0086 anchors { 0087 left: contxtnewsitemmenu.right 0088 leftMargin: units.gridUnit * 0.25 0089 verticalCenter: parent.verticalCenter 0090 } 0091 height: units.gridUnit * 1 0092 width: dashhdrvertSvg.elementSize("vertical-line").width 0093 z: 110 0094 elementId: "vertical-line" 0095 0096 svg: PlasmaCore.Svg { 0097 id: dashhdrvertSvg; 0098 imagePath: "widgets/line" 0099 } 0100 } 0101 0102 ToolButton { 0103 id: contxtnewsitemmenu 0104 anchors.verticalCenter: parent.verticalCenter 0105 anchors.left: parent.left 0106 width: units.gridUnit * 1 0107 height: units.gridUnit * 1 0108 Image { 0109 id: innrnewitemcontxmenuimage 0110 source: "../images/ctxmenu.png" 0111 anchors.verticalCenter: parent.verticalCenter 0112 anchors.horizontalCenter: parent.horizontalCenter 0113 width: units.gridUnit * 0.60 0114 height: units.gridUnit * 0.50 0115 } 0116 ColorOverlay { 0117 anchors.fill: innrnewitemcontxmenuimage 0118 source: innrnewitemcontxmenuimage 0119 color: theme.textColor 0120 } 0121 onClicked: { 0122 mcmenuItem.open() 0123 } 0124 } 0125 } 0126 0127 Rectangle { 0128 id: nwsseprator 0129 width: parent.width 0130 anchors.top: skillTopRowLayout.bottom 0131 anchors.topMargin: 1 0132 height: 2 0133 color: theme.linkColor 0134 } 0135 0136 Text { 0137 id: weatherDshTempDateLabel 0138 anchors.top: nwsseprator.bottom 0139 anchors.topMargin: 1 0140 anchors.left: parent.left 0141 font.pointSize: theme.defaultFont.pointSize 0142 font.letterSpacing: theme.defaultFont.letterSpacing 0143 font.wordSpacing: theme.defaultFont.wordSpacing 0144 font.family: theme.defaultFont.family 0145 renderType: Text.NativeRendering 0146 color: PlasmaCore.ColorScope.textColor 0147 wrapMode: Text.WordWrap; 0148 font.bold: true; 0149 text: i18n("Date: %1 | Time: %2", model.contents.itemWeatherDateHourZero.split(" ")[0], model.contents.itemWeatherDateHourZero.split(" ")[1]) 0150 } 0151 0152 Rectangle { 0153 id: nwsseprator1 0154 width: parent.width 0155 anchors.top: weatherDshTempDateLabel.bottom 0156 anchors.topMargin: 1 0157 height: 2 0158 color: theme.linkColor 0159 } 0160 0161 Text { 0162 id: weatherDshTempMinLabel 0163 anchors.top: nwsseprator1.bottom 0164 anchors.topMargin: 1 0165 anchors.left: parent.left 0166 font.pointSize: theme.defaultFont.pointSize 0167 font.letterSpacing: theme.defaultFont.letterSpacing 0168 font.wordSpacing: theme.defaultFont.wordSpacing 0169 font.family: theme.defaultFont.family 0170 renderType: Text.NativeRendering 0171 color: PlasmaCore.ColorScope.textColor 0172 wrapMode: Text.WordWrap; 0173 font.bold: true; 0174 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Minimum Temperature: %1%2", model.contents.itemWeatherTempMinHourZero, model.contents.itemWeatherMetricType) 0175 } 0176 0177 Rectangle { 0178 id: nwsseprator2 0179 width: parent.width 0180 anchors.top: weatherDshTempMinLabel.bottom 0181 anchors.topMargin: 1 0182 height: 2 0183 color: theme.linkColor 0184 } 0185 0186 Text { 0187 id: weatherDshTempCurrentLabel 0188 anchors.top: nwsseprator2.bottom 0189 anchors.topMargin: 1 0190 anchors.left: parent.left 0191 font.pointSize: theme.defaultFont.pointSize 0192 font.letterSpacing: theme.defaultFont.letterSpacing 0193 font.wordSpacing: theme.defaultFont.wordSpacing 0194 font.family: theme.defaultFont.family 0195 renderType: Text.NativeRendering 0196 color: PlasmaCore.ColorScope.textColor 0197 wrapMode: Text.WordWrap; 0198 font.bold: true; 0199 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Current Temperature: %1%2", model.contents.itemWeatherTempHourZero, model.contents.itemWeatherMetricType) 0200 } 0201 0202 Rectangle { 0203 id: nwsseprator3 0204 width: parent.width 0205 anchors.top: weatherDshTempCurrentLabel.bottom 0206 anchors.topMargin: 1 0207 height: 2 0208 color: theme.linkColor 0209 } 0210 0211 Text { 0212 id: weatherDshTempMaxLabel 0213 anchors.top: nwsseprator3.bottom 0214 anchors.topMargin: 1 0215 anchors.left: parent.left 0216 font.pointSize: theme.defaultFont.pointSize 0217 font.letterSpacing: theme.defaultFont.letterSpacing 0218 font.wordSpacing: theme.defaultFont.wordSpacing 0219 font.family: theme.defaultFont.family 0220 renderType: Text.NativeRendering 0221 color: PlasmaCore.ColorScope.textColor 0222 wrapMode: Text.WordWrap; 0223 font.bold: true; 0224 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Maximum Temperature: %1%2", model.contents.itemWeatherTempMaxHourZero, model.contents.itemWeatherMetricType) 0225 } 0226 0227 PlasmaCore.SvgItem { 0228 id: horizontalSepWeathrCard1 0229 anchors { 0230 left: contentdlgtitem.left 0231 right: contentdlgtitem.right 0232 top: weatherDshTempMaxLabel.bottom 0233 } 0234 width: 1 0235 height: horlineweatherextendSvg.elementSize("horizontal-line").height 0236 0237 elementId: "horizontal-line" 0238 z: 110 0239 svg: PlasmaCore.Svg { 0240 id: horlineweatherextendSvg; 0241 imagePath: "widgets/line" 0242 } 0243 } 0244 0245 Item { 0246 id: footerBx 0247 anchors.left: parent.left 0248 anchors.right: parent.right 0249 anchors.bottom: parent.bottom 0250 height: units.gridUnit * 1.5 0251 0252 Rectangle { 0253 id: expandBtnRectBg 0254 height: units.gridUnit * 1.25 0255 width: units.gridUnit * 1.25 0256 radius: 100 0257 color: theme.backgroundColor 0258 anchors.centerIn: parent 0259 z: 400 0260 0261 PlasmaCore.ToolTipArea { 0262 id: toolTipExpand 0263 mainText: i18n("Expand Forecast") 0264 anchors.fill: parent 0265 } 0266 0267 PlasmaCore.ToolTipArea { 0268 id: toolTipCollapse 0269 mainText: i18n("Close") 0270 anchors.fill: parent 0271 } 0272 0273 PlasmaCore.IconItem { 0274 id: expandWeatherCardBtn 0275 anchors.centerIn: parent 0276 source: "go-down" 0277 width: units.gridUnit * 1.15 0278 height: units.gridUnit * 1.15 0279 } 0280 0281 MouseArea { 0282 anchors.fill: parent 0283 0284 onClicked: { 0285 if(!expanded){ 0286 dashboardmodelview.positionViewAtIndex(findIndex(model.itemType), ListView.SnapPosition) 0287 dashdelegatelview.height = cbheight - units.gridUnit * 2 0288 dashDelegateItmWeather.height = dashdelegatelview.height 0289 expanded = true 0290 expandWeatherCardBtn.source = "go-up" 0291 weatherForcastItem.state = "CardExpanded" 0292 } 0293 else if(expanded){ 0294 dashDelegateItmWeather.height = units.gridUnit * 7.75 0295 dashdelegatelview.height = dashDelegateItmWeather.height 0296 expanded = false 0297 expandWeatherCardBtn.source = "go-down" 0298 weatherForcastItem.state = "CardNotExpanded" 0299 } 0300 } 0301 } 0302 } 0303 } 0304 0305 Item { 0306 id: extensionFrame 0307 anchors.top: horizontalSepWeathrCard1.bottom 0308 anchors.bottom: footerBx.top 0309 anchors.left: parent.left 0310 anchors.right: parent.right 0311 visible: expanded ? true : false 0312 0313 Image{ 0314 id: weatherForcastBgImage 0315 anchors.fill: parent 0316 anchors.margins: units.gridUnit * 0.25 0317 0318 Component.onCompleted: { 0319 var conditionType = model.contents.itemWeatherTempTypeHourA.toLowerCase(); 0320 if(conditionType.indexOf("scattered") !== -1 && conditionType.indexOf("clouds") !== -1 || conditionType.indexOf("clear") !== -1 || conditionType.indexOf("clouds") !== -1 ){ 0321 weatherForcastBgImage.source = "../images/climatesc.jpg" 0322 } 0323 else if(conditionType.indexOf("rain") !== -1){ 0324 weatherForcastBgImage.source = "../images/rain.gif" 0325 } 0326 else if(conditionType.indexOf("snow") !== -1){ 0327 weatherForcastBgImage.source = "../images/snow.gif" 0328 } 0329 else if(conditionType.indexOf("snow") !== -1){ 0330 weatherForcastBgImage.source = "../images/snow.gif" 0331 } 0332 else if(conditionType.indexOf("haze") !== -1){ 0333 weatherForcastBgImage.source = "../images/haze.gif" 0334 } 0335 else { 0336 weatherForcastBgImage.source = "../images/bluesky.png" 0337 } 0338 } 0339 0340 0341 Rectangle { 0342 id: weatherForcastItem 0343 anchors.left: parent.left 0344 anchors.right: parent.right 0345 anchors.top: parent.top 0346 anchors.bottom: parent.bottom 0347 anchors.topMargin: units.gridUnit * 1 0348 anchors.bottomMargin: units.gridUnit * 1 0349 color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) 0350 state: "CardNotExpanded" 0351 0352 states: [ 0353 State { 0354 name: "CardExpanded" 0355 PropertyChanges { target: forcastItemExternalRow; width: parent.width } 0356 PropertyChanges { target: forcastItemExternalRow; height: parent.height - units.gridUnit * 2 } 0357 PropertyChanges { target: forcastItemInnerRowA; width: parent.width / 2 } 0358 PropertyChanges { target: forcastItemInnerRowA; height: parent.height } 0359 PropertyChanges { target: forcastItemInnerRowB; width: parent.width / 2 } 0360 PropertyChanges { target: forcastItemInnerRowB; height: parent.height } 0361 PropertyChanges { target: hourAsep0; width: parent.width } 0362 PropertyChanges { target: hourAsep0; height: 2 } 0363 PropertyChanges { target: hourBsep0; width: parent.width } 0364 PropertyChanges { target: hourBsep0; height: 2 } 0365 PropertyChanges { target: hourAsep1; width: parent.width } 0366 PropertyChanges { target: hourAsep1; height: 2 } 0367 PropertyChanges { target: hourBsep1; width: parent.width } 0368 PropertyChanges { target: hourBsep1; height: 2 } 0369 PropertyChanges { target: hourAsep2; width: parent.width } 0370 PropertyChanges { target: hourAsep2; height: 2 } 0371 PropertyChanges { target: hourBsep2; width: parent.width } 0372 PropertyChanges { target: hourBsep2; height: 2 } 0373 PropertyChanges { target: hourAsep3; width: parent.width } 0374 PropertyChanges { target: hourAsep3; height: 2 } 0375 PropertyChanges { target: hourBsep3; width: parent.width } 0376 PropertyChanges { target: hourBsep3; height: 2 } 0377 PropertyChanges { target: forecastItemCreditsFooter; width: parent.width } 0378 PropertyChanges { target: forecastItemCreditsFooter; height: units.gridUnit * 1 } 0379 PropertyChanges { target: toolTipExpand; enabled: false } 0380 PropertyChanges { target: toolTipExpand; visible: false } 0381 PropertyChanges { target: toolTipCollapse; enabled: true } 0382 PropertyChanges { target: toolTipCollapse; visible: true } 0383 0384 }, 0385 State { 0386 name: "CardNotExpanded" 0387 PropertyChanges { target: forcastItemExternalRow; width: 0 } 0388 PropertyChanges { target: forcastItemExternalRow; height: 0 } 0389 PropertyChanges { target: forcastItemInnerRowA; width: 0 } 0390 PropertyChanges { target: forcastItemInnerRowA; height: 0 } 0391 PropertyChanges { target: forcastItemInnerRowB; width: 0 } 0392 PropertyChanges { target: forcastItemInnerRowB; height: 0 } 0393 PropertyChanges { target: hourAsep0; width: 0 } 0394 PropertyChanges { target: hourAsep0; height: 0 } 0395 PropertyChanges { target: hourBsep0; width: 0 } 0396 PropertyChanges { target: hourBsep0; height: 0 } 0397 PropertyChanges { target: hourAsep1; width: 0 } 0398 PropertyChanges { target: hourAsep1; height: 0 } 0399 PropertyChanges { target: hourBsep1; width: 0 } 0400 PropertyChanges { target: hourBsep1; height: 0 } 0401 PropertyChanges { target: hourAsep2; width: 0 } 0402 PropertyChanges { target: hourAsep2; height: 0 } 0403 PropertyChanges { target: hourBsep2; width: 0 } 0404 PropertyChanges { target: hourBsep2; height: 0 } 0405 PropertyChanges { target: hourAsep3; width: 0 } 0406 PropertyChanges { target: hourAsep3; height: 0 } 0407 PropertyChanges { target: hourBsep3; width: 0 } 0408 PropertyChanges { target: hourBsep3; height: 0 } 0409 PropertyChanges { target: forecastItemCreditsFooter; width: 0 } 0410 PropertyChanges { target: forecastItemCreditsFooter; height: 0 } 0411 PropertyChanges { target: toolTipExpand; enabled: true } 0412 PropertyChanges { target: toolTipExpand; visible: true } 0413 PropertyChanges { target: toolTipCollapse; enabled: false } 0414 PropertyChanges { target: toolTipCollapse; visible: false } 0415 } 0416 ] 0417 0418 Row{ 0419 id: forcastItemExternalRow 0420 spacing: 4 0421 0422 Item { 0423 id: forcastItemInnerRowA 0424 0425 Text { 0426 id: weatherDshDateLabelHourA 0427 anchors.top: parent.top 0428 anchors.topMargin: 1 0429 anchors.left: parent.left 0430 font.pointSize: theme.defaultFont.pointSize 0431 font.letterSpacing: theme.defaultFont.letterSpacing 0432 font.wordSpacing: theme.defaultFont.wordSpacing 0433 font.family: theme.defaultFont.family 0434 renderType: Text.NativeRendering 0435 color: PlasmaCore.ColorScope.textColor 0436 wrapMode: Text.WordWrap; 0437 font.bold: true; 0438 text: i18nc("D stand for Day, T stands for Time", "D: %1 | T: %2", model.contents.itemWeatherDateHourA.split(" ")[0], model.contents.itemWeatherDateHourA.split(" ")[1]) 0439 } 0440 0441 Rectangle { 0442 id: hourAsep0 0443 anchors.top: weatherDshDateLabelHourA.bottom 0444 anchors.topMargin: expanded ? 0 : 1 0445 height: expanded ? 0 : 2 0446 color: theme.linkColor 0447 } 0448 0449 Text { 0450 id: weatherDshConditionLabelHourA 0451 anchors.top: hourAsep0.bottom 0452 anchors.topMargin: 1 0453 anchors.left: parent.left 0454 font.pointSize: theme.defaultFont.pointSize 0455 font.letterSpacing: theme.defaultFont.letterSpacing 0456 font.wordSpacing: theme.defaultFont.wordSpacing 0457 font.family: theme.defaultFont.family 0458 renderType: Text.NativeRendering 0459 color: PlasmaCore.ColorScope.textColor 0460 wrapMode: Text.WordWrap; 0461 font.bold: true; 0462 text: i18n("Condition: %1", model.contents.itemWeatherTempTypeHourA) 0463 } 0464 0465 Image { 0466 id: weatherDashCardIconHourA 0467 anchors.left: weatherDshConditionLabelHourA.right 0468 anchors.verticalCenter: weatherDshConditionLabelHourA.verticalCenter 0469 source: model.contents.itemWeatherIconTypeHourA 0470 width: units.gridUnit * 1.25 0471 height: units.gridUnit * 1.25 0472 } 0473 0474 Rectangle { 0475 id: hourAsep1 0476 anchors.top: weatherDshConditionLabelHourA.bottom 0477 anchors.topMargin: expanded ? 0 : 1 0478 height: expanded ? 0 : 2 0479 color: theme.linkColor 0480 } 0481 0482 Text { 0483 id: weatherDshWindLabelHourA 0484 anchors.top: hourAsep1.bottom 0485 anchors.topMargin: 1 0486 anchors.left: parent.left 0487 font.pointSize: theme.defaultFont.pointSize 0488 font.letterSpacing: theme.defaultFont.letterSpacing 0489 font.wordSpacing: theme.defaultFont.wordSpacing 0490 font.family: theme.defaultFont.family 0491 renderType: Text.NativeRendering 0492 color: PlasmaCore.ColorScope.textColor 0493 wrapMode: Text.WordWrap; 0494 font.bold: true; 0495 text: i18n("Wind: %1 meters/sec", model.contents.itemWeatherWindHourA) 0496 } 0497 0498 Rectangle { 0499 id: hourAsep2 0500 anchors.top: weatherDshWindLabelHourA.bottom 0501 anchors.topMargin: expanded ? 0 : 1 0502 height: expanded ? 0 : 2 0503 color: theme.linkColor 0504 } 0505 0506 Text { 0507 id: weatherDshTempMinLabelHourA 0508 anchors.top: hourAsep2.bottom 0509 anchors.topMargin: 1 0510 anchors.left: parent.left 0511 font.pointSize: theme.defaultFont.pointSize 0512 font.letterSpacing: theme.defaultFont.letterSpacing 0513 font.wordSpacing: theme.defaultFont.wordSpacing 0514 font.family: theme.defaultFont.family 0515 renderType: Text.NativeRendering 0516 color: PlasmaCore.ColorScope.textColor 0517 wrapMode: Text.WordWrap; 0518 font.bold: true; 0519 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Min: %1%2", model.contents.itemWeatherTempHourA, model.contents.itemWeatherMetricType) 0520 } 0521 0522 Rectangle { 0523 id: hourAsep3 0524 width: expanded ? 0 : parent.width 0525 anchors.top: weatherDshTempMinLabelHourA.bottom 0526 anchors.topMargin: expanded ? 0 : 1 0527 height: expanded ? 0 : 2 0528 color: theme.linkColor 0529 } 0530 0531 Text { 0532 id: weatherDshTempMaxLabelHourA 0533 anchors.top: hourAsep3.bottom 0534 anchors.topMargin: 1 0535 anchors.left: parent.left 0536 font.pointSize: theme.defaultFont.pointSize 0537 font.letterSpacing: theme.defaultFont.letterSpacing 0538 font.wordSpacing: theme.defaultFont.wordSpacing 0539 font.family: theme.defaultFont.family 0540 renderType: Text.NativeRendering 0541 color: PlasmaCore.ColorScope.textColor 0542 wrapMode: Text.WordWrap; 0543 font.bold: true; 0544 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Max: %1%2", model.contents.itemWeatherTempHourA, model.contents.itemWeatherMetricType) 0545 } 0546 } 0547 0548 Item { 0549 id: forcastItemInnerRowB 0550 0551 Text { 0552 id: weatherDshDateLabelHourB 0553 anchors.top: parent.top 0554 anchors.topMargin: 1 0555 anchors.left: parent.left 0556 font.pointSize: theme.defaultFont.pointSize 0557 font.letterSpacing: theme.defaultFont.letterSpacing 0558 font.wordSpacing: theme.defaultFont.wordSpacing 0559 font.family: theme.defaultFont.family 0560 renderType: Text.NativeRendering 0561 color: PlasmaCore.ColorScope.textColor 0562 wrapMode: Text.WordWrap; 0563 font.bold: true; 0564 text: i18nc("D stand for Day, T stands for Time", "D: %1 | T: %2", model.contents.itemWeatherDateHourB.split(" ")[0], model.contents.itemWeatherDateHourB.split(" ")[1]) 0565 } 0566 0567 Rectangle { 0568 id: hourBsep0 0569 anchors.top: weatherDshDateLabelHourB.bottom 0570 anchors.topMargin: expanded ? 0 : 1 0571 height: expanded ? 0 : 2 0572 color: theme.linkColor 0573 } 0574 0575 Text { 0576 id: weatherDshConditionLabelHourB 0577 anchors.top: hourBsep0.bottom 0578 anchors.topMargin: 1 0579 anchors.left: parent.left 0580 font.pointSize: theme.defaultFont.pointSize 0581 font.letterSpacing: theme.defaultFont.letterSpacing 0582 font.wordSpacing: theme.defaultFont.wordSpacing 0583 font.family: theme.defaultFont.family 0584 renderType: Text.NativeRendering 0585 color: PlasmaCore.ColorScope.textColor 0586 wrapMode: Text.WordWrap; 0587 font.bold: true; 0588 text: i18n("Condition: %1", model.contents.itemWeatherTempTypeHourB) 0589 } 0590 0591 Image { 0592 id: weatherDashCardIconHourB 0593 anchors.left: weatherDshConditionLabelHourB.right 0594 anchors.verticalCenter: weatherDshConditionLabelHourB.verticalCenter 0595 source: model.contents.itemWeatherIconTypeHourB 0596 width: units.gridUnit * 1.25 0597 height: units.gridUnit * 1.25 0598 } 0599 0600 Rectangle { 0601 id: hourBsep1 0602 anchors.top: weatherDshConditionLabelHourB.bottom 0603 anchors.topMargin: expanded ? 0 : 1 0604 height: expanded ? 0 : 2 0605 color: theme.linkColor 0606 } 0607 0608 Text { 0609 id: weatherDshWindLabelHourB 0610 anchors.top: hourBsep1.bottom 0611 anchors.topMargin: 1 0612 anchors.left: parent.left 0613 font.pointSize: theme.defaultFont.pointSize 0614 font.letterSpacing: theme.defaultFont.letterSpacing 0615 font.wordSpacing: theme.defaultFont.wordSpacing 0616 font.family: theme.defaultFont.family 0617 renderType: Text.NativeRendering 0618 color: PlasmaCore.ColorScope.textColor 0619 wrapMode: Text.WordWrap; 0620 font.bold: true; 0621 text: i18n("Wind: %1 meters/sec", model.contents.itemWeatherWindHourB) 0622 } 0623 0624 Rectangle { 0625 id: hourBsep2 0626 anchors.top: weatherDshWindLabelHourB.bottom 0627 anchors.topMargin: expanded ? 0 : 1 0628 height: expanded ? 0 : 2 0629 color: theme.linkColor 0630 } 0631 0632 Text { 0633 id: weatherDshTempMinLabelHourB 0634 anchors.top: hourBsep2.bottom 0635 anchors.topMargin: 1 0636 anchors.left: parent.left 0637 font.pointSize: theme.defaultFont.pointSize 0638 font.letterSpacing: theme.defaultFont.letterSpacing 0639 font.wordSpacing: theme.defaultFont.wordSpacing 0640 font.family: theme.defaultFont.family 0641 renderType: Text.NativeRendering 0642 color: PlasmaCore.ColorScope.textColor 0643 wrapMode: Text.WordWrap; 0644 font.bold: true; 0645 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Min: %1%2", model.contents.itemWeatherTempHourB, model.contents.itemWeatherMetricType) 0646 } 0647 0648 Rectangle { 0649 id: hourBsep3 0650 width: expanded ? 0 : parent.width 0651 anchors.top: weatherDshTempMinLabelHourB.bottom 0652 anchors.topMargin: expanded ? 0 : 1 0653 height: expanded ? 0 : 2 0654 color: theme.linkColor 0655 } 0656 0657 Text { 0658 id: weatherDshTempMaxLabelHourB 0659 anchors.top: hourBsep3.bottom 0660 anchors.topMargin: 1 0661 anchors.left: parent.left 0662 font.pointSize: theme.defaultFont.pointSize 0663 font.letterSpacing: theme.defaultFont.letterSpacing 0664 font.wordSpacing: theme.defaultFont.wordSpacing 0665 font.family: theme.defaultFont.family 0666 renderType: Text.NativeRendering 0667 color: PlasmaCore.ColorScope.textColor 0668 wrapMode: Text.WordWrap; 0669 font.bold: true; 0670 text: i18nc("%1 is value, %2 is unit (Celsius or Fahrenheit degree)", "Max: %1%2", model.contents.itemWeatherTempHourB, model.contents.itemWeatherMetricType) 0671 } 0672 } 0673 } 0674 0675 Rectangle { 0676 id: forecastItemCreditsFooter 0677 anchors.bottom: parent.bottom 0678 color: theme.linkColor 0679 0680 PlasmaComponents.Label{ 0681 id: creditOWM 0682 anchors.right: parent.right 0683 anchors.rightMargin: units.gridUnit * 0.15 0684 anchors.verticalCenter: parent.verticalCenter 0685 text: i18n("<i>Powered By: OpenWeatherMap</i>") 0686 } 0687 } 0688 } 0689 } 0690 } 0691 } 0692 0693 Drawer { 0694 id: mcmenuItem 0695 width: dwrpaddedwidth 0696 height: removeCardRectbtn.height + disableCardRectbtn.height 0697 edge: Qt.TopEdge 0698 dragMargin: 0 0699 0700 Rectangle { 0701 id: menuRectItem 0702 anchors.fill: parent 0703 color: theme.backgroundColor 0704 0705 Column { 0706 id: menuRectColumn 0707 anchors.fill: parent 0708 0709 Rectangle { 0710 id: removeCardRectbtn 0711 width: parent.width 0712 height: units.gridUnit * 2 0713 color: theme.backgroundColor 0714 0715 Row { 0716 spacing: 5 0717 PlasmaCore.IconItem { 0718 id: removeCardIcon 0719 anchors.verticalCenter: parent.verticalCenter 0720 source: "archive-remove" 0721 width: units.gridUnit * 2 0722 height: units.gridUnit * 2 0723 } 0724 Rectangle { 0725 id: removeCardSeperater 0726 width: 1 0727 height: parent.height 0728 color: theme.linkColor 0729 } 0730 PlasmaComponents.Label { 0731 id: removeCardLabel 0732 anchors.verticalCenter: parent.verticalCenter 0733 text: i18n("Remove Card") 0734 } 0735 } 0736 MouseArea { 0737 anchors.fill: parent 0738 hoverEnabled: true 0739 onEntered: { 0740 removeCardLabel.color = theme.linkColor 0741 } 0742 onExited:{ 0743 removeCardLabel.color = theme.textColor 0744 } 0745 onClicked:{ 0746 dashCardCollectionModel.remove(index) 0747 removeChildCard() 0748 } 0749 } 0750 } 0751 0752 Rectangle { 0753 id: btnshorzSepr 0754 width: parent.width 0755 height: 1 0756 color: theme.linkColor 0757 } 0758 0759 Rectangle { 0760 id: disableCardRectbtn 0761 width: parent.width 0762 height: units.gridUnit * 2 0763 color: theme.backgroundColor 0764 0765 Row { 0766 spacing: 5 0767 PlasmaCore.IconItem { 0768 id: disableCardIcon 0769 anchors.verticalCenter: parent.verticalCenter 0770 source: "document-close" 0771 width: units.gridUnit * 2 0772 height: units.gridUnit * 2 0773 } 0774 Rectangle { 0775 id: disableCardSeperater 0776 width: 1 0777 height: parent.height 0778 color: theme.linkColor 0779 } 0780 PlasmaComponents.Label { 0781 id: disableCardLabel 0782 anchors.verticalCenter: parent.verticalCenter 0783 text: i18n("Disable Weather Cards") 0784 } 0785 } 0786 MouseArea { 0787 anchors.fill: parent 0788 hoverEnabled: true 0789 onEntered: { 0790 disableCardLabel.color = theme.linkColor 0791 } 0792 onExited:{ 0793 disableCardLabel.color = theme.textColor 0794 } 0795 onClicked:{ 0796 weathercardswitch.checked = false 0797 dashCardCollectionModel.remove(index) 0798 removeChildCard() 0799 } 0800 } 0801 } 0802 0803 Rectangle { 0804 id: btnshorzSeprEnd 0805 width: parent.width 0806 height: units.gridUnit * 0.75 0807 color: theme.linkColor 0808 0809 PlasmaCore.IconItem { 0810 id: closemenuDrawer 0811 anchors.centerIn: parent 0812 source: "go-up" 0813 width: units.gridUnit * 2 0814 height: units.gridUnit * 2 0815 } 0816 } 0817 } 0818 } 0819 } 0820 }