forked from Silverfish/proton-bridge
feat(GODT-3046): link in pop-up banner.
This commit is contained in:
committed by
Xavier Michelon
parent
0e5715c4e3
commit
650ad49ab0
@ -84,6 +84,7 @@ Popup {
|
||||
anchors.topMargin: 14
|
||||
spacing: 8
|
||||
|
||||
|
||||
ColorImage {
|
||||
Layout.preferredHeight: 24
|
||||
Layout.preferredWidth: 24
|
||||
@ -108,14 +109,35 @@ Popup {
|
||||
sourceSize.width: 24
|
||||
width: 24
|
||||
}
|
||||
Label {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
color: root.colorScheme.text_invert
|
||||
colorScheme: root.colorScheme
|
||||
text: root.notification ? root.notification.description : ""
|
||||
wrapMode: Text.WordWrap
|
||||
Label {
|
||||
id: messageLabel
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
color: root.colorScheme.text_invert
|
||||
colorScheme: root.colorScheme
|
||||
text: root.notification ? root.notification.description : ""
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
LinkLabel {
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
colorScheme: root.colorScheme
|
||||
color: messageLabel.color
|
||||
external: true
|
||||
link: root.notification ? root.notification.linkUrl : ""
|
||||
text: root.notification ? root.notification.linkText : ""
|
||||
visible: root.notification && root.notification.linkUrl.length > 0
|
||||
}
|
||||
// Label {
|
||||
// color: root.colorScheme.text_invert
|
||||
// colorScheme: root.colorScheme
|
||||
// text: "Youpi!"
|
||||
// wrapMode: Text.WordWrap
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -716,7 +716,8 @@ QtObject {
|
||||
group: Notifications.Group.Connection
|
||||
icon: "./icons/ic-no-connection.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
|
||||
linkUrl: "https://proton.me/support/bridge"
|
||||
linkText: qsTr("What happens with my messages when internet is down?")
|
||||
Connections {
|
||||
function onInternetOff() {
|
||||
root.noInternet.active = true;
|
||||
|
||||
@ -22,6 +22,7 @@ RowLayout {
|
||||
property bool external: false
|
||||
property string link: "#"
|
||||
property string text: ""
|
||||
property color color: colorScheme.interaction_norm
|
||||
|
||||
function clear() {
|
||||
root.callback = null;
|
||||
@ -49,9 +50,9 @@ RowLayout {
|
||||
id: label
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
colorScheme: root.colorScheme
|
||||
linkColor: root.color
|
||||
text: label.link(root.link, root.text)
|
||||
type: Label.LabelType.Body
|
||||
|
||||
onLinkActivated: function (link) {
|
||||
if ((link !== "#") && (link.length > 0)) {
|
||||
Qt.openUrlExternally(link);
|
||||
|
||||
Reference in New Issue
Block a user