Move HoverLinkIndicator to separate file
This commit is contained in:
@@ -272,6 +272,7 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
|
||||
qml/EditStateDialog.qml
|
||||
qml/ConsentDialog.qml
|
||||
qml/AskDirectChatConfirmation.qml
|
||||
qml/HoverLinkIndicator.qml
|
||||
)
|
||||
|
||||
add_subdirectory(settings)
|
||||
|
||||
30
src/qml/HoverLinkIndicator.qml
Normal file
30
src/qml/HoverLinkIndicator.qml
Normal file
@@ -0,0 +1,30 @@
|
||||
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-FileCopyrightText: 2024 Carl Schwan <carl@carlschwan.eu>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
QQC2.Control {
|
||||
id: root
|
||||
|
||||
property string text
|
||||
|
||||
visible: !root.text.startsWith("https://matrix.to/") && root.text.length > 0
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
|
||||
z: 20
|
||||
|
||||
Accessible.ignored: true
|
||||
|
||||
contentItem: QQC2.Label {
|
||||
text: root.text.startsWith("https://matrix.to/") ? "" : root.text
|
||||
Accessible.description: i18nc("@info screenreader", "The currently selected link")
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
|
||||
property NeoChatConnection connection: Controller.activeConnection
|
||||
readonly property HoverLinkIndicator hoverLinkIndicator: linkIndicator
|
||||
|
||||
|
||||
title: Config.windowTitleFocus ? activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "") : "NeoChat"
|
||||
|
||||
@@ -311,25 +313,11 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
property QQC2.Control hoverLinkIndicator: QQC2.Control {
|
||||
parent: root.overlay.parent
|
||||
property alias text: linkText.rawText
|
||||
opacity: linkText.text.length > 0 ? 1 : 0
|
||||
HoverLinkIndicator {
|
||||
id: linkIndicator
|
||||
|
||||
z: 20
|
||||
x: 0
|
||||
Accessible.ignored: true
|
||||
y: parent.height - implicitHeight
|
||||
contentItem: QQC2.Label {
|
||||
id: linkText
|
||||
property string rawText
|
||||
text: rawText.startsWith("https://matrix.to/") ? "" : rawText
|
||||
Accessible.description: i18nc("@info screenreader", "The currently selected link")
|
||||
}
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
}
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
|
||||
Reference in New Issue
Block a user