[libraries/kpublictransport] src/quick: Allow to highlight multiple vehicle sections at once

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ed5f4950ea2cb771c7bde57fd24a03ee299bab56 by Volker Krause.
Committed on 24/07/2026 at 11:45.
Pushed by vkrause into branch 'master'.

Allow to highlight multiple vehicle sections at once

Needed for distributed multi-traveler seat reservations.

M  +5    -3    src/quick/VehicleLayoutView.qml

https://invent.kde.org/libraries/kpublictransport/-/commit/ed5f4950ea2cb771c7bde57fd24a03ee299bab56

diff --git a/src/quick/VehicleLayoutView.qml b/src/quick/VehicleLayoutView.qml
index e8ae6cac..2d5f699d 100644
--- a/src/quick/VehicleLayoutView.qml
+++ b/src/quick/VehicleLayoutView.qml
@@ -3,6 +3,8 @@
     SPDX-License-Identifier: LGPL-2.0-or-later
 */
 
+pragma ComponentBehavior: Bound
+
 import QtQuick
 import QtQuick.Layouts
 import QtQuick.Controls as QQC2
@@ -22,7 +24,7 @@ Item {
     property real sectionWidth: 48
 
     /** Name of the vehicle section to highlight. */
-    property string highlightedVehicleSection: ""
+    property list<string> highlightedVehicleSection: []
     /** Vehicle seating classes to highlight. */
     property int higlightedClassTypes: KPublicTransport.VehicleSection.UnknownClass
 
@@ -83,10 +85,10 @@ Item {
             id: delegateRoot
 
             highlighted: {
-                if (root.highlightedVehicleSection === "") {
+                if (root.highlightedVehicleSection.length === 0) {
                     return root.higlightedClassTypes & section.classes;
                 }
-                return section.name === root.highlightedVehicleSection
+                return root.highlightedVehicleSection.includes(section.name)
             }
 
             y: delegateRoot.vehicleSection.platformPositionBegin * root.fullLength + root.directionIndicatorSize
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.