summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/jami-no-webengine.patch
blob: f26cd8e3f50e035d498f8ca65a3ec6d23c33bcf9 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
From 1f73d3c88e94f2d932c59cab8a02c72a325ccc20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 11 Nov 2022 16:19:11 -0500
Subject: [PATCH] misc: fix build without webengine

Change-Id: I2511cd89e1ce7f60424f69ab6576d7fb992dd58c
GitLab: #881
---
 .../components/DocumentsScrollview.qml        |  1 -
 src/app/mainview/components/FilePreview.qml   |  1 -
 src/app/mainview/components/MediaPreview.qml  | 57 ++--------------
 .../mainview/components/SwarmDetailsPanel.qml |  1 -
 src/app/nowebengine/VideoPreview.qml          | 24 +++++++
 src/app/webengine/VideoPreview.qml            | 68 +++++++++++++++++++
 6 files changed, 99 insertions(+), 53 deletions(-)
 create mode 100644 src/app/nowebengine/VideoPreview.qml
 create mode 100644 src/app/webengine/VideoPreview.qml

diff --git a/client-qt/src/app/mainview/components/DocumentsScrollview.qml b/client-qt/src/app/mainview/components/DocumentsScrollview.qml
index df516961..3338536a 100644
--- a/client-qt/src/app/mainview/components/DocumentsScrollview.qml
+++ b/client-qt/src/app/mainview/components/DocumentsScrollview.qml
@@ -20,7 +20,6 @@ import QtQuick.Controls
 import QtQuick.Layouts
 import Qt.labs.platform
 import Qt5Compat.GraphicalEffects
-import QtWebEngine
 
 import net.jami.Models 1.1
 import net.jami.Adapters 1.1
diff --git a/client-qt/src/app/mainview/components/FilePreview.qml b/client-qt/src/app/mainview/components/FilePreview.qml
index 57b1ec8b..fe8f3fd9 100644
--- a/client-qt/src/app/mainview/components/FilePreview.qml
+++ b/client-qt/src/app/mainview/components/FilePreview.qml
@@ -19,7 +19,6 @@ import QtQuick.Controls
 import QtQuick.Layouts
 import Qt.labs.platform
 import Qt5Compat.GraphicalEffects
-import QtWebEngine
 
 import net.jami.Models 1.1
 import net.jami.Adapters 1.1
diff --git a/client-qt/src/app/mainview/components/MediaPreview.qml b/client-qt/src/app/mainview/components/MediaPreview.qml
index 0c33bf3e..965f9343 100644
--- a/client-qt/src/app/mainview/components/MediaPreview.qml
+++ b/client-qt/src/app/mainview/components/MediaPreview.qml
@@ -19,7 +19,6 @@ import QtQuick.Controls
 import QtQuick.Layouts
 import Qt.labs.platform
 import Qt5Compat.GraphicalEffects
-import QtWebEngine
 
 import net.jami.Models 1.1
 import net.jami.Adapters 1.1
@@ -92,59 +91,17 @@ Component {
                         }
                         Component {
                             id: avMediaComp
-
                             Loader {
-                                property real msgRadius: 20
-
-                                Rectangle {
-                                    id: videoAudioRect
-                                    color: JamiTheme.secondaryBackgroundColor
-                                    anchors.fill: parent
-
-                                    WebEngineView {
-                                        id: wev
-
-                                        property bool isVideo: mediaInfo.isVideo
-                                        property string html: mediaInfo.html
-
-                                        anchors.fill: parent
-                                        anchors.verticalCenter: videoAudioRect.verticalCenter
-                                        backgroundColor: JamiTheme.secondaryBackgroundColor
-                                        anchors.topMargin: isVideo? 0 :  wev.implicitHeight / 2
-                                        settings.fullScreenSupportEnabled: isVideo
-                                        settings.javascriptCanOpenWindows: false
-                                        Component.onCompleted: loadHtml(html, 'file://')
-                                        onFullScreenRequested: function(request) {
-                                            if (request.toggleOn) {
-                                                layoutManager.pushFullScreenItem(
-                                                            this,
-                                                            videoAudioRect,
-                                                            null,
-                                                            function() { wev.fullScreenCancelled() })
-                                            } else if (!request.toggleOn) {
-                                                layoutManager.removeFullScreenItem(this)
-                                            }
-                                            request.accept()
-                                        }
-                                    }
-
-                                    layer.enabled: true
-                                    layer.effect: OpacityMask {
-                                        maskSource: Item {
-                                            width: videoAudioRect.width
-                                            height: videoAudioRect.height
-                                            Rectangle {
-                                                anchors.centerIn: parent
-                                                width:  videoAudioRect.width
-                                                height: videoAudioRect.height
-                                                radius: JamiTheme.swarmDetailsPageDocumentsMediaRadius
-                                            }
-                                        }
-                                    }
+                                Component.onCompleted: {
+                                    var qml = WITH_WEBENGINE ?
+                                                "qrc:/webengine/VideoPreview.qml" :
+                                                "qrc:/nowebengine/VideoPreview.qml"
+                                    setSource( qml, { isVideo: mediaInfo.isVideo, html:mediaInfo.html } )
                                 }
+
+                                property real msgRadius: 20
                             }
                         }
-
                         Component {
                             id: imageMediaComp
 
diff --git a/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml b/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml
index 0dd93bc2..7625a76e 100644
--- a/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml
+++ b/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml
@@ -21,7 +21,6 @@ import QtQuick.Controls
 import QtQuick.Layouts
 import Qt.labs.platform
 import Qt5Compat.GraphicalEffects
-import QtWebEngine
 
 import net.jami.Models 1.1
 import net.jami.Adapters 1.1
diff --git a/client-qt/src/app/nowebengine/VideoPreview.qml b/client-qt/src/app/nowebengine/VideoPreview.qml
new file mode 100644
index 00000000..8c2e8a4f
--- /dev/null
+++ b/client-qt/src/app/nowebengine/VideoPreview.qml
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 Savoir-faire Linux Inc.
+ *
+ * This program 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.
+ *
+ * This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+
+Rectangle {
+    property var mediaInfo: undefined
+}
\ No newline at end of file
diff --git a/client-qt/src/app/webengine/VideoPreview.qml b/client-qt/src/app/webengine/VideoPreview.qml
new file mode 100644
index 00000000..edc03599
--- /dev/null
+++ b/client-qt/src/app/webengine/VideoPreview.qml
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2022 Savoir-faire Linux Inc.
+ *
+ * This program 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.
+ *
+ * This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick
+import QtWebEngine
+import Qt5Compat.GraphicalEffects
+
+import net.jami.Constants 1.1
+
+Rectangle {
+    id: root
+    color: JamiTheme.secondaryBackgroundColor
+    anchors.fill: parent
+    property bool isVideo: false
+    property string html: ""
+
+    WebEngineView {
+        id: wev
+
+        anchors.fill: parent
+        anchors.verticalCenter: root.verticalCenter
+        backgroundColor: JamiTheme.secondaryBackgroundColor
+        anchors.topMargin: root.isVideo? 0 :  wev.implicitHeight / 2
+        settings.fullScreenSupportEnabled: root.isVideo
+        settings.javascriptCanOpenWindows: false
+        Component.onCompleted: loadHtml(root.html, 'file://')
+        onFullScreenRequested: function(request) {
+            if (request.toggleOn) {
+                layoutManager.pushFullScreenItem(
+                            this,
+                            root,
+                            null,
+                            function() { wev.fullScreenCancelled() })
+            } else if (!request.toggleOn) {
+                layoutManager.removeFullScreenItem(this)
+            }
+            request.accept()
+        }
+    }
+
+    layer.enabled: true
+    layer.effect: OpacityMask {
+        maskSource: Item {
+            width: root.width
+            height: root.height
+            Rectangle {
+                anchors.centerIn: parent
+                width:  root.width
+                height: root.height
+                radius: JamiTheme.swarmDetailsPageDocumentsMediaRadius
+            }
+        }
+    }
+}
\ No newline at end of file
-- 
2.37.3