Warning, /education/marble/src/apps/marble-maps/IconText.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2016 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 
0006 import QtQuick 2.3
0007 import QtQuick.Window 2.2
0008 
0009 import org.kde.marble 0.20
0010 
0011 Item {
0012     id: root
0013     height: text === "" ? 0 : Math.max(icon.height, text.height)
0014 
0015     property alias text: text.text
0016     property alias icon: icon.source
0017     property alias font: text.font
0018     property alias maximumLineCount: text.maximumLineCount
0019     property alias linkColor: text.linkColor
0020 
0021     signal linkActivated(string link)
0022 
0023     Image {
0024         id: icon
0025         sourceSize.height: Screen.pixelDensity * 3
0026         fillMode: Image.PreserveAspectFit
0027         anchors.verticalCenter: text.verticalCenter
0028     }
0029 
0030     Text {
0031         id: text
0032         anchors.left: icon.right
0033         anchors.right: parent.right
0034         anchors.leftMargin: icon.width === 0 ? 0 : Screen.pixelDensity * 1
0035         font.pointSize: 16
0036         wrapMode: Text.WordWrap
0037         elide: Text.ElideRight
0038 
0039         onLinkActivated: root.linkActivated(link)
0040 
0041         MouseArea {
0042             anchors.fill: parent
0043             acceptedButtons: Qt.NoButton
0044             cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
0045         }
0046     }
0047 }