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/EditStateDialog.qml
|
||||||
qml/ConsentDialog.qml
|
qml/ConsentDialog.qml
|
||||||
qml/AskDirectChatConfirmation.qml
|
qml/AskDirectChatConfirmation.qml
|
||||||
|
qml/HoverLinkIndicator.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(settings)
|
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
|
id: root
|
||||||
|
|
||||||
property NeoChatConnection connection: Controller.activeConnection
|
property NeoChatConnection connection: Controller.activeConnection
|
||||||
|
readonly property HoverLinkIndicator hoverLinkIndicator: linkIndicator
|
||||||
|
|
||||||
|
|
||||||
title: Config.windowTitleFocus ? activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "") : "NeoChat"
|
title: Config.windowTitleFocus ? activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "") : "NeoChat"
|
||||||
|
|
||||||
@@ -311,25 +313,11 @@ Kirigami.ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property QQC2.Control hoverLinkIndicator: QQC2.Control {
|
HoverLinkIndicator {
|
||||||
parent: root.overlay.parent
|
id: linkIndicator
|
||||||
property alias text: linkText.rawText
|
|
||||||
opacity: linkText.text.length > 0 ? 1 : 0
|
|
||||||
|
|
||||||
z: 20
|
anchors.bottom: parent.bottom
|
||||||
x: 0
|
anchors.left: parent.left
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
|
|||||||
Reference in New Issue
Block a user