mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-16 07:06:45 +00:00
feat(GODT-2772): use WebEngineView instead of WebView
This commit is contained in:
@ -277,7 +277,8 @@ signals: // Signals received from the Go backend, to be forwarded to QML
|
|||||||
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
|
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.
|
||||||
void showHelp(); ///< Signal for the 'showHelp' event (from the context menu).
|
void showHelp(); ///< Signal for the 'showHelp' event (from the context menu).
|
||||||
void showSettings(); ///< Signal for the 'showHelp' event (from the context menu).
|
void showSettings(); ///< Signal for the 'showHelp' event (from the context menu).
|
||||||
void showWebViewWindow(QString const &url); ///< Signal the the 'showWebViewWindow' event
|
void showWebFrameWindow(QString const &url); ///< Signal the the 'showWebFrameWindow' event
|
||||||
|
void showWebFrameOverlay(QString const &url); ////< Signal for the 'showWebFrameOverlay' event.
|
||||||
void selectUser(QString const& userID, bool forceShowWindow); ///< Signal emitted in order to selected a user with a given ID in the list.
|
void selectUser(QString const& userID, bool forceShowWindow); ///< Signal emitted in order to selected a user with a given ID in the list.
|
||||||
void genericError(QString const &title, QString const &description); ///< Signal for the 'genericError' gRPC stream event.
|
void genericError(QString const &title, QString const &description); ///< Signal for the 'genericError' gRPC stream event.
|
||||||
void imapLoginWhileSignedOut(QString const& username); ///< Signal for the notification of IMAP login attempt on a signed out account.
|
void imapLoginWhileSignedOut(QString const& username); ///< Signal for the notification of IMAP login attempt on a signed out account.
|
||||||
|
|||||||
@ -107,7 +107,7 @@
|
|||||||
<file>qml/Proton/TextArea.qml</file>
|
<file>qml/Proton/TextArea.qml</file>
|
||||||
<file>qml/Proton/TextField.qml</file>
|
<file>qml/Proton/TextField.qml</file>
|
||||||
<file>qml/Proton/Toggle.qml</file>
|
<file>qml/Proton/Toggle.qml</file>
|
||||||
<file>qml/Proton/WebView.qml</file>
|
<file>qml/Proton/WebFrame.qml</file>
|
||||||
<file>qml/QuestionItem.qml</file>
|
<file>qml/QuestionItem.qml</file>
|
||||||
<file>qml/Resources/bug_report_flow.json</file>
|
<file>qml/Resources/bug_report_flow.json</file>
|
||||||
<file>qml/SettingsItem.qml</file>
|
<file>qml/SettingsItem.qml</file>
|
||||||
@ -126,6 +126,6 @@
|
|||||||
<file>qml/ConnectionModeSettings.qml</file>
|
<file>qml/ConnectionModeSettings.qml</file>
|
||||||
<file>qml/SplashScreen.qml</file>
|
<file>qml/SplashScreen.qml</file>
|
||||||
<file>qml/Status.qml</file>
|
<file>qml/Status.qml</file>
|
||||||
<file>qml/WebViewWindow.qml</file>
|
<file>qml/WebFrameWindow.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@ -69,16 +69,19 @@ QtObject {
|
|||||||
Backend.setNormalTrayIcon();
|
Backend.setNormalTrayIcon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
property WebViewWindow _webviewWindow: WebViewWindow {
|
property WebFrameWindow _webFrameWindow: WebFrameWindow {
|
||||||
id: webViewWindow
|
id: webFrameWindow
|
||||||
flags: Qt.Tool
|
colorScheme: ProtonStyle.currentStyle
|
||||||
transientParent: mainWindow
|
transientParent: mainWindow
|
||||||
visible: false
|
flags: Qt.Tool
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onShowWebViewWindow(url) {
|
function onShowWebFrameWindow(url) {
|
||||||
webViewWindow.url = url;
|
webFrameWindow.url = url;
|
||||||
webViewWindow.show();
|
webFrameWindow.showNormal();
|
||||||
|
}
|
||||||
|
function onShowWebFrameOverlay(url) {
|
||||||
|
mainWindow.showWebFrameOverlay(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
target: Backend
|
target: Backend
|
||||||
|
|||||||
@ -104,7 +104,7 @@ SettingsView {
|
|||||||
type: Label.Caption
|
type: Label.Caption
|
||||||
|
|
||||||
onLinkActivated: function (link) {
|
onLinkActivated: function (link) {
|
||||||
Backend.showWebViewWindow(link)
|
Backend.showWebFrameOverlay(link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ ApplicationWindow {
|
|||||||
setupWizard.showClientConfig(user, address);
|
setupWizard.showClientConfig(user, address);
|
||||||
}
|
}
|
||||||
function showHelp() {
|
function showHelp() {
|
||||||
showWebViewOverlay("https://proton.me/support/bridge");
|
Backend.showWebFrameWindow("https://proton.me/support/bridge");
|
||||||
}
|
}
|
||||||
function showLocalCacheSettings() {
|
function showLocalCacheSettings() {
|
||||||
contentWrapper.showLocalCacheSettings();
|
contentWrapper.showLocalCacheSettings();
|
||||||
@ -69,9 +69,9 @@ ApplicationWindow {
|
|||||||
function showSettings() {
|
function showSettings() {
|
||||||
contentWrapper.showSettings();
|
contentWrapper.showSettings();
|
||||||
}
|
}
|
||||||
function showWebViewOverlay(url) {
|
function showWebFrameOverlay(url) {
|
||||||
webViewOverlay.visible = true;
|
webFrameOverlay.visible = true;
|
||||||
webViewOverlay.url = url;
|
webFrameOverlay.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
colorScheme: ProtonStyle.currentStyle
|
colorScheme: ProtonStyle.currentStyle
|
||||||
@ -179,8 +179,8 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WebView {
|
WebFrame {
|
||||||
id: webViewOverlay
|
id: webFrameOverlay
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
overlay: true
|
overlay: true
|
||||||
|
|||||||
@ -15,8 +15,8 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Controls.impl
|
import QtQuick.Controls.impl
|
||||||
import QtWebView
|
import QtWebEngine
|
||||||
import "." as Proton
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@ -55,11 +55,15 @@ Item {
|
|||||||
border.color: root.colorScheme.border_norm
|
border.color: root.colorScheme.border_norm
|
||||||
border.width: overlay ? ProtonStyle.web_view_overley_border_width : 0
|
border.width: overlay ? ProtonStyle.web_view_overley_border_width : 0
|
||||||
|
|
||||||
WebView {
|
WebEngineView {
|
||||||
id: webView
|
id: webView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: ProtonStyle.web_view_overley_border_width
|
anchors.margins: ProtonStyle.web_view_overley_border_width
|
||||||
url: root.url
|
url: root.url
|
||||||
|
|
||||||
|
onContextMenuRequested: function (request) {
|
||||||
|
request.accepted = true; // This prevent the default context menu from being presented.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
@ -37,4 +37,4 @@ Switch 4.0 Switch.qml
|
|||||||
TextArea 4.0 TextArea.qml
|
TextArea 4.0 TextArea.qml
|
||||||
TextField 4.0 TextField.qml
|
TextField 4.0 TextField.qml
|
||||||
Toggle 4.0 Toggle.qml
|
Toggle 4.0 Toggle.qml
|
||||||
WebView 4.0 WebView.qml
|
WebFrame 4.0 WebFrame.qml
|
||||||
|
|||||||
@ -17,13 +17,18 @@ import Proton
|
|||||||
|
|
||||||
Window {
|
Window {
|
||||||
id: root
|
id: root
|
||||||
height: 600
|
|
||||||
width: 800
|
|
||||||
minimumWidth: 600
|
|
||||||
property string url
|
property string url
|
||||||
WebView {
|
property ColorScheme colorScheme
|
||||||
|
|
||||||
|
height: 600
|
||||||
|
minimumWidth: 600
|
||||||
|
width: 800
|
||||||
|
|
||||||
|
WebFrame {
|
||||||
|
id: frame
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
colorScheme: ProtonStyle.currentStyle
|
colorScheme: root.colorScheme
|
||||||
overlay: false
|
overlay: false
|
||||||
url: root.url
|
url: root.url
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user