KOSMIndoorMap

OSMElementInformationDialogLinkDelegate.qml
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6import QtQuick
7import QtQuick.Layouts
8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10import org.kde.kosmindoormap
12/** OSM element info dialog delegate for graphically displaying link entries. */
13RowLayout {
14 id: root
15
16 /** Key name. */
17 required property string keyLabel
18 /** Value category. */
19 required property int category
20 /** Link label of this entry. */
21 required property string value
22 /** URL of this entry. */
23 required property string url
24
25 QQC2.Label {
26 visible: root.keyLabel !== ""
27 text: root.keyLabel + ":"
28 color: root.category === OSMElementInformationModel.DebugCategory ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
29 Layout.alignment: Qt.AlignTop
30 }
31 QQC2.Label {
32 Layout.fillWidth: true
33 text: "<a href=\"" + root.url + "\">" + root.value + "</a>"
34 color: root.category == OSMElementInformationModel.DebugCategory ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
35 onLinkActivated: (link) => { Qt.openUrlExternally(link); }
36 wrapMode: Text.WordWrap
37 }
38}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.