diff --git a/src/app/FlightPage.qml b/src/app/FlightPage.qml index 0f25405..bb3137f 100644 --- a/src/app/FlightPage.qml +++ b/src/app/FlightPage.qml @@ -1,173 +1,132 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 as QQC2 -import org.kde.kirigami 2.0 as Kirigami +import org.kde.kirigami 2.4 as Kirigami import org.kde.kitinerary 1.0 import org.kde.itinerary 1.0 import "." as App App.DetailsPage { id: root title: i18n("Flight") editor: Component { App.FlightEditor { resIds: root.resIds } } - GridLayout { - id: grid + Kirigami.FormLayout { width: root.width - columns: 2 QQC2.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true + Kirigami.FormData.isSection: true text: reservationFor.airline.iataCode + " " + reservationFor.flightNumber horizontalAlignment: Qt.AlignHCenter font.bold: true } // ticket barcode App.TicketTokenDelegate { - Layout.columnSpan: 2 + Kirigami.FormData.isSection: true resIds: root.resIds } // flight details - QQC2.Label { - text: i18n("Boarding time:") + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Flight") } QQC2.Label { + Kirigami.FormData.label: i18n("Boarding:") text: Localizer.formatDateTime(reservationFor, "boardingTime") } QQC2.Label { - text: i18n("Boarding group:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Boarding group:") text: reservation.boardingGroup } QQC2.Label { - text: i18n("Seat:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Seat:") text: reservation.airplaneSeat } QQC2.Label { - text: i18n("Airline:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Airline:") text: reservationFor.airline.name } - Kirigami.Separator { - Layout.columnSpan: 2 - Layout.fillWidth: true - } // departure data - QQC2.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: i18n("Departure") - horizontalAlignment: Qt.AlignHCenter - } - QQC2.Label { - text: i18n("Departure time:") + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Departure") } QQC2.Label { + Kirigami.FormData.label: i18n("Time:") text: Localizer.formatDateTime(reservationFor, "departureTime") } QQC2.Label { + Kirigami.FormData.label: i18n("Airport:") text: reservationFor.departureAirport.name + " (" + reservationFor.departureAirport.iataCode + ")" - Layout.columnSpan: 2 } App.PlaceDelegate { - Layout.columnSpan: 2 - Layout.fillWidth: true place: reservationFor.departureAirport } QQC2.Label { - text: i18n("Departure terminal:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Terminal:") text: reservationFor.departureTerminal } QQC2.Label { - text: i18n("Departure gate:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Gate:") text: reservationFor.departureGate } - Kirigami.Separator { - Layout.columnSpan: 2 - Layout.fillWidth: true - } // arrival data - QQC2.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: i18n("Arrival") - horizontalAlignment: Qt.AlignHCenter - } - QQC2.Label { - text: i18n("Arrival time:") + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Arrival") } QQC2.Label { + Kirigami.FormData.label: i18n("Time:") text: Localizer.formatDateTime(reservationFor, "arrivalTime") } QQC2.Label { + Kirigami.FormData.label: i18n("Airport:") text: reservationFor.arrivalAirport.name + " (" + reservationFor.arrivalAirport.iataCode + ")" - Layout.columnSpan: 2 } App.PlaceDelegate { - Layout.columnSpan: 2 - Layout.fillWidth: true place: reservationFor.arrivalAirport } - Kirigami.Separator { - Layout.columnSpan: 2 - Layout.fillWidth: true - } // booking details - QQC2.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: i18n("Booking") - horizontalAlignment: Qt.AlignHCenter - } - QQC2.Label { - text: i18n("Booking reference:") + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Booking") } QQC2.Label { + Kirigami.FormData.label: i18n("Reference:") text: reservation.reservationNumber } QQC2.Label { - text: i18n("Under name:") - } - QQC2.Label { + Kirigami.FormData.label: i18n("Under name:") text: reservation.underName.name } } }