Kirigami2
8import org.kde.kirigami as Kirigami
9import org.kde.kirigami.private as KirigamiPrivate
10import QtQuick.Controls as QQC2
38 property bool externalLink: true
41 enabled: url.length > 0
42 visible: text.length > 0
43 acceptedButtons: Qt.LeftButton | Qt.RightButton
46 Accessible.description: text !== url
47 ? qsTr("Open link %1",
"@info:whatsthis").arg(
url)
48 : qsTr(
"Open link",
"@info:whatsthis")
50 rightPadding: LayoutMirroring.enabled || !icon.visible ? 0 : icon.size + Kirigami.
Units.smallSpacing
51 leftPadding: LayoutMirroring.enabled && icon.visible ? icon.size + Kirigami.
Units.smallSpacing : 0
56 readonly
property int size: Kirigami.Units.iconSizes.sizeForLabels
58 x: LayoutMirroring.
enabled ? button.width - button.implicitWidth : button.implicitWidth - size
62 visible: button.externalLink
64 source:
"open-link-symbolic"
65 fallback:
"link-symbolic"
68 anchors.verticalCenter: button.verticalCenter
72 if (mouse.button ===
Qt.RightButton) {
78 if (mouse.button !==
Qt.RightButton) {
79 Qt.openUrlExternally(url);
85 visible: button.text !== button.url && button.mouseArea.containsMouse
92 text: qsTr(
"Copy Link to Clipboard")
93 icon.name:
"edit-copy"
94 onClicked: KirigamiPrivate.CopyHelperPrivate.copyTextToClipboard(button.url)
Class for rendering an icon in UI.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:21 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.