Initial commit
This commit is contained in:
46
main.qml
Normal file
46
main.qml
Normal file
@@ -0,0 +1,46 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user