Commit 0274d601 authored by Volker Krause's avatar Volker Krause
Browse files

Show car type icons for overnight trains in the train coach layout view

parent 1a674b67
Pipeline #144110 passed with stage
in 1 minute and 35 seconds
......@@ -191,9 +191,28 @@ Kirigami.ScrollablePage {
inaccessibleBackground: colorMix(Kirigami.Theme.backgroundColor, Kirigami.Theme.disabledTextColor, isSelected ? 1 : 0.25)
restaurantBackground: colorMix(Kirigami.Theme.backgroundColor, Kirigami.Theme.neutralTextColor, isSelected ? 1 : 0.25)
QQC2.Label {
ColumnLayout {
anchors.centerIn: parent
text: section.name
QQC2.Label {
Layout.alignment: Qt.AlignCenter
text: section.name
}
Kirigami.Icon {
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Kirigami.Units.iconSizes.small
Layout.preferredHeight: visible ? Kirigami.Units.iconSizes.small : 0
source: {
switch (section.type) {
case KPublicTransport.VehicleSection.PassengerCar: return "qrc:///images/seat.svg"
case KPublicTransport.VehicleSection.SleepingCar: return "qrc:///images/sleepingcar.svg"
case KPublicTransport.VehicleSection.CouchetteCar: return "qrc:///images/couchettecar.svg"
case KPublicTransport.VehicleSection.RestaurantCar: return "qrc:///images/foodestablishment.svg"
}
}
color: Kirigami.Theme.textColor
isMask: true
visible: source ? true : false
}
}
ColumnLayout {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="22" height="22" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text { color:#4d4d4d; }
</style>
<polygon
style="fill:currentColor;stroke-width:0"
points="13.843885,3.2142857 9.0837593,6.7294713 0,6.7294713 0,11.785714 1.1319308,11.785714 1.1319308,9.1029246 13.790798,9.1029246 13.790798,11.785714 15,11.785714 15,3.2142857 "
id="polygon3"
transform="matrix(1.3138289,0,0,1.3138289,1.1118802,1.1489425)" />
</svg>
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: Volker Krause <vkrause@kde.org>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="22" height="22" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text { color:#4d4d4d; }
</style>
<g transform="matrix(1.3102432,0,0,1.3102432,1.2193104,1.1894719)">
<path d="m 5.1443418,7.3044641 c 0,-0.528773 -0.0081,-0.8023148 0.1015991,-1.2374509 C 5.3614143,5.6373851 5.5519455,5.2463134 5.8175344,4.8993061 6.071576,4.5688229 6.3991096,4.3125374 6.7051142,4.1307717 7.1671034,3.949414 7.1363263,3.9549633 7.6766568,3.8968406 L 13.845266,3.8729476 V 2.8539579 H 15 V 12.272727 H 13.845266 V 9.6013219 H 1.2124711 V 12.272727 H 0 V 2.7272727 h 1.1374134 v 0.837224 c 0.2078522,0 0.4272517,0.016524 0.6581986,0.060589 0.2309469,0.044065 0.4618938,0.1101611 0.6928407,0.1982899 0.2309468,0.088129 0.4503464,0.203798 0.6466512,0.3414993 0.1963049,0.1321932 0.3579677,0.2919267 0.4849885,0.4681844 0.2598152,0.3580234 0.4445727,0.7601112 0.5600462,1.2117715 0.1212471,0.4461522 0.1789838,0.9308608 0.1789838,1.4596338 z m -4.0069284,0 h 2.2748268 c 0,-0.4516602 -0.040416,-0.842732 -0.1212471,-1.1732151 C 3.204388,5.8007659 3.0715935,5.497823 2.8983834,5.2114043 2.7020785,4.9139695 2.4364896,4.7046635 2.1016166,4.5889944 1.76097,4.4678172 1.443418,4.4072287 1.1374134,4.4072287 Z M 7.9306984,4.7560967 C 7.2845735,4.7638814 6.8853796,4.9041689 6.5505066,5.3833694 6.3657491,5.653264 6.2216915,6.0174407 6.1408601,6.3424158 6.0658023,6.6673908 6.091224,6.8528039 6.091224,7.3044641 h 7.754042 V 4.7322037 Z" style="fill:currentColor;stroke-width:0"/>
</g>
</svg>
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: Volker Krause <vkrause@kde.org>
......@@ -91,6 +91,7 @@
<file>images/cablecar.svg</file>
<file>images/car.svg</file>
<file>images/coach.svg</file>
<file>images/couchettecar.svg</file>
<file>images/elevator.svg</file>
<file>images/escalator.svg</file>
<file>images/ferry.svg</file>
......@@ -101,6 +102,7 @@
<file>images/rapidtransit.svg</file>
<file>images/seat.svg</file>
<file>images/shuttle.svg</file>
<file>images/sleepingcar.svg</file>
<file>images/stairs.svg</file>
<file>images/subway.svg</file>
<file>images/taxi.svg</file>
......
......@@ -5,6 +5,7 @@
*/
#include "publictransport.h"
#include "localizer.h"
#include <KPublicTransport/Stopover>
......@@ -55,6 +56,9 @@ int main(int argc, char **argv)
qmlRegisterSingletonType("org.kde.itinerary", 1, 0, "PublicTransport", [](QQmlEngine*, QJSEngine *engine) -> QJSValue { \
return engine->toScriptValue(PublicTransport()); \
});
qmlRegisterSingletonType("org.kde.itinerary", 1, 0, "Localizer", [](QQmlEngine*, QJSEngine *engine) -> QJSValue {
return engine->toScriptValue(Localizer());
});
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
......
......@@ -7,7 +7,10 @@
<file>vehiclelayoutviewer.qml</file>
<file alias="VehicleLayoutPage.qml">../src/app/VehicleLayoutPage.qml</file>
<file alias="images/couchettecar.svg">../src/app/images/couchettecar.svg</file>
<file alias="images/longdistancetrain.svg">../src/app/images/longdistancetrain.svg</file>
<file alias="images/seat.svg">../src/app/images/seat.svg</file>
<file alias="images/sleepingcar.svg">../src/app/images/sleepingcar.svg</file>
<file alias="images/train.svg">../src/app/images/train.svg</file>
</qresource>
</RCC>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment