diff --git a/internal/frontend/bridge-gui/bridge-gui/Resources.qrc b/internal/frontend/bridge-gui/bridge-gui/Resources.qrc index 0d3c80b5..68c2707b 100644 --- a/internal/frontend/bridge-gui/bridge-gui/Resources.qrc +++ b/internal/frontend/bridge-gui/bridge-gui/Resources.qrc @@ -96,6 +96,7 @@ qml/Proton/ColorScheme.qml qml/Proton/ComboBox.qml qml/Proton/Dialog.qml + qml/Proton/InfoTooltip.qml qml/Proton/Label.qml qml/Proton/LinkLabel.qml qml/Proton/Menu.qml diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/BugReport/BugReportView.qml b/internal/frontend/bridge-gui/bridge-gui/qml/BugReport/BugReportView.qml index b76fe263..8edadd76 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/BugReport/BugReportView.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/BugReport/BugReportView.qml @@ -82,11 +82,17 @@ SettingsView { id: suggestionBox visible: suggestions && suggestions.length > 0 spacing: 8 - - Label { - colorScheme: root.colorScheme - text: qsTr("We believe these links might be relevant for your problem") - type: Label.Body_semibold + RowLayout { + Label { + colorScheme: root.colorScheme + text: qsTr("We believe these links may help you solve your problem") + type: Label.Body_semibold + } + InfoTooltip { + colorScheme: root.colorScheme + text: qsTr("The links will open in an external browser. If you cancel the report, your input will be preserved until you restart Bridge.") + Layout.bottomMargin: -4 + } } Repeater { model: suggestions diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/InfoTooltip.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/InfoTooltip.qml new file mode 100644 index 00000000..7da4b680 --- /dev/null +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/InfoTooltip.qml @@ -0,0 +1,59 @@ +// Copyright (c) 2023 Proton AG +// +// This file is part of Proton Mail Bridge. +// +// Proton Mail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Proton Mail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Proton Mail Bridge. If not, see . +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +ColorImage { + property var colorScheme + property string text + id: root + Layout.alignment: Qt.AlignVCenter + Layout.bottomMargin: root._bottomMargin + color: root.colorScheme.interaction_norm + height: sourceSize.height + width: sourceSize.width + source: "/qml/icons/ic-info-circle.svg" + sourceSize.height: 16 + sourceSize.width: 16 + visible: root.hint !== "" + MouseArea { + id: imageArea + anchors.fill: parent + hoverEnabled: true + } + ToolTip { + id: toolTipinfo + text: root.text + visible: imageArea.containsMouse + implicitWidth: Math.min(400, tooltipText.implicitWidth) + background: Rectangle { + radius: 4 + border.color: root.colorScheme.border_weak + color: root.colorScheme.background_weak + } + contentItem: Text { + id: tooltipText + color: root.colorScheme.text_norm + text: root.text + wrapMode: Text.WordWrap + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } +} \ No newline at end of file diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml index 95755fef..04a334db 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml @@ -64,11 +64,12 @@ RowLayout { } ColorImage { Layout.alignment: Qt.AlignVCenter + Layout.bottomMargin: -6 color: label.linkColor height: sourceSize.height source: "/qml/icons/ic-external-link.svg" - sourceSize.height: 16 - sourceSize.width: 16 + sourceSize.height: 14 + sourceSize.width: 14 visible: external width: sourceSize.width diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/qmldir b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/qmldir index a13b58f2..15a2af26 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/qmldir +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/qmldir @@ -27,6 +27,7 @@ Button 4.0 Button.qml CheckBox 4.0 CheckBox.qml ComboBox 4.0 ComboBox.qml Dialog 4.0 Dialog.qml +InfoTooltip 4.0 InfoTooltip.qml Label 4.0 Label.qml LinkLabel 4.0 LinkLabel.qml Menu 4.0 Menu.qml