47 lines
1.2 KiB
QML
47 lines
1.2 KiB
QML
import QtQuick 2.6
|
|
import QtQuick.Controls 2.0 as Controls
|
|
import QtQuick.Layouts 1.2
|
|
import org.kde.kirigami 2.13 as Kirigami
|
|
|
|
// Base element, provides basic features needed for all kirigami applications
|
|
Kirigami.ApplicationWindow {
|
|
// ID provides unique identifier to reference this element
|
|
id: root
|
|
title: "Metar Weather"
|
|
|
|
// Initial page to be loaded on app load
|
|
pageStack.initialPage: Kirigami.Page {
|
|
actions {
|
|
main: Kirigami.Action {
|
|
icon.name: "refresh"
|
|
text: "Refresh"
|
|
onTriggered: logic.refresh()
|
|
}
|
|
right: Kirigami.Action {
|
|
icon.name: "plus"
|
|
text: "Add Airport"
|
|
onTriggered: addAirport.open()
|
|
}
|
|
}
|
|
}
|
|
Kirigami.OverlaySheet {
|
|
id: addAirport
|
|
|
|
Kirigami.FormLayout {
|
|
Controls.TextField {
|
|
id: airportCode
|
|
Kirigami.FormData.label: "airport code"
|
|
}
|
|
Controls.Button {
|
|
text: "Add"
|
|
onClicked: {
|
|
logic.addAirport(airportCode.text)
|
|
addAirport.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|