VertexEngine-WebEngine 1.1__py3-none-any.whl → 1.2.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- VertexEngine/BrowserTools/Tabs.py +22 -12
- VertexEngine/WebEngine/WebEngine.py +2 -3
- {vertexengine_webengine-1.1.dist-info → vertexengine_webengine-1.2.dev1.dist-info}/METADATA +1 -1
- vertexengine_webengine-1.2.dev1.dist-info/RECORD +11 -0
- {vertexengine_webengine-1.1.dist-info → vertexengine_webengine-1.2.dev1.dist-info}/WHEEL +1 -1
- vertexengine_webengine-1.1.dist-info/RECORD +0 -11
- {vertexengine_webengine-1.1.dist-info → vertexengine_webengine-1.2.dev1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
from PyQt6.QtWidgets import QTabWidget,
|
|
1
|
+
from PyQt6.QtWidgets import QTabWidget, QToolButton
|
|
2
2
|
from PyQt6.QtCore import QUrl
|
|
3
3
|
from PyQt6.QtGui import QKeySequence, QShortcut
|
|
4
|
+
from PyQt6.QtCore import Qt
|
|
4
5
|
|
|
5
6
|
from WebEngine.WebEngine import WebEngine
|
|
6
7
|
|
|
@@ -18,25 +19,34 @@ class BrowserTabs(QTabWidget):
|
|
|
18
19
|
# Keyboard shortcuts
|
|
19
20
|
QShortcut(QKeySequence("Ctrl+T"), self).activated.connect(self.new_tab)
|
|
20
21
|
QShortcut(QKeySequence("Ctrl+W"), self).activated.connect(self.close_current_tab)
|
|
22
|
+
# ➕ New Tab button
|
|
23
|
+
self.new_tab_btn = QToolButton(self)
|
|
24
|
+
self.new_tab_btn.setText("+")
|
|
25
|
+
self.new_tab_btn.setAutoRaise(True)
|
|
26
|
+
self.new_tab_btn.setToolTip("New Tab")
|
|
21
27
|
|
|
22
|
-
self.new_tab
|
|
28
|
+
self.new_tab_btn.clicked.connect(self.new_tab)
|
|
29
|
+
|
|
30
|
+
self.setCornerWidget(
|
|
31
|
+
self.new_tab_btn,
|
|
32
|
+
Qt.Corner.TopRightCorner
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
self.new_tab("https://www.google.com")
|
|
23
36
|
|
|
24
37
|
# ➕ Create tab
|
|
25
|
-
def new_tab(self, url=
|
|
26
|
-
|
|
38
|
+
def new_tab(self, url=None):
|
|
39
|
+
if not isinstance(url, str):
|
|
40
|
+
url = "https://www.google.com"
|
|
27
41
|
|
|
42
|
+
print("🆕 New tab:", url)
|
|
43
|
+
|
|
44
|
+
engine = WebEngine()
|
|
28
45
|
index = self.addTab(engine, "New Tab")
|
|
29
46
|
self.setCurrentIndex(index)
|
|
30
47
|
|
|
31
|
-
|
|
32
|
-
engine.load_home()
|
|
33
|
-
else:
|
|
34
|
-
engine.load(QUrl(url))
|
|
48
|
+
engine.load_url(url)
|
|
35
49
|
|
|
36
|
-
# Update tab title
|
|
37
|
-
engine.page().titleChanged.connect(
|
|
38
|
-
lambda title, e=engine: self.update_tab_title(e, title)
|
|
39
|
-
)
|
|
40
50
|
|
|
41
51
|
# ❌ Close tab by index
|
|
42
52
|
def close_tab(self, index):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from PyQt6.QtWebEngineWidgets import QWebEngineView
|
|
2
2
|
from PyQt6.QtGui import QKeySequence, QShortcut
|
|
3
3
|
from PyQt6.QtWebChannel import QWebChannel
|
|
4
|
-
|
|
4
|
+
from PyQt6.QtCore import QUrl
|
|
5
5
|
from WebView.profile import WebProfile
|
|
6
6
|
from WebView.WebPage import WebPage
|
|
7
7
|
from WebView.bridge import JSBridge
|
|
@@ -78,8 +78,7 @@ function openSite() {
|
|
|
78
78
|
</body>
|
|
79
79
|
</html>
|
|
80
80
|
"""
|
|
81
|
-
self.webpage.setHtml(html)
|
|
81
|
+
self.webpage.setHtml(html, QUrl("https://www.google.com"))
|
|
82
82
|
|
|
83
83
|
def load_url(self, url):
|
|
84
|
-
from PyQt6.QtCore import QUrl
|
|
85
84
|
self.load(QUrl(url))
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
VertexEngine/main.py,sha256=hutXWxm5qQv2x9eBdXyhD2ErKENzHb-aHSfuxWT-QoQ,333
|
|
2
|
+
VertexEngine/test.py,sha256=y2VWCtKSOmXNOD1qlitSF44a7q6qRmHS0q-o7_bG0k8,1696
|
|
3
|
+
VertexEngine/BrowserTools/Tabs.py,sha256=TOT0df5afpLHhvaUOA-xtUHFbGgvdo66peHaBvzVCrc,2301
|
|
4
|
+
VertexEngine/WebEngine/WebEngine.py,sha256=1kko_WabEyJEt8mPTMxg3lMB-QPYdflq8bpRYg_DNxQ,2189
|
|
5
|
+
VertexEngine/WebView/WebPage.py,sha256=Lav-uWvMhg3fIOhFxteujpx0YpyRNvWRD3C47sYK4N0,674
|
|
6
|
+
VertexEngine/WebView/bridge.py,sha256=iJuXC9g7OynrH-7Jsg2-OmwngY8-z3nGycaIQwooRLQ,469
|
|
7
|
+
VertexEngine/WebView/profile.py,sha256=g1KJRqYd2EHGJn1C-MyoPzk6Y6Awuuf9Tf5L9K9BGkI,832
|
|
8
|
+
vertexengine_webengine-1.2.dev1.dist-info/METADATA,sha256=OxHrojCCpxKPDgGonSxVgB7GJW8gXrFrTq24d8Q9fmI,2177
|
|
9
|
+
vertexengine_webengine-1.2.dev1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
vertexengine_webengine-1.2.dev1.dist-info/top_level.txt,sha256=ONNMJUQViY7bNuEYPB2TaUwj7Jo1Is2yuBY4KOv19wM,13
|
|
11
|
+
vertexengine_webengine-1.2.dev1.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
VertexEngine/main.py,sha256=hutXWxm5qQv2x9eBdXyhD2ErKENzHb-aHSfuxWT-QoQ,333
|
|
2
|
-
VertexEngine/test.py,sha256=y2VWCtKSOmXNOD1qlitSF44a7q6qRmHS0q-o7_bG0k8,1696
|
|
3
|
-
VertexEngine/BrowserTools/Tabs.py,sha256=epKFZttZ3mYoh-VAu4Otxz5e2FR4BJXEuQauMNdbvWk,2019
|
|
4
|
-
VertexEngine/WebEngine/WebEngine.py,sha256=RUMs6fXGMNNpyDZPEJHy6tppYwAfevkobs65mR1J9RA,2167
|
|
5
|
-
VertexEngine/WebView/WebPage.py,sha256=Lav-uWvMhg3fIOhFxteujpx0YpyRNvWRD3C47sYK4N0,674
|
|
6
|
-
VertexEngine/WebView/bridge.py,sha256=iJuXC9g7OynrH-7Jsg2-OmwngY8-z3nGycaIQwooRLQ,469
|
|
7
|
-
VertexEngine/WebView/profile.py,sha256=g1KJRqYd2EHGJn1C-MyoPzk6Y6Awuuf9Tf5L9K9BGkI,832
|
|
8
|
-
vertexengine_webengine-1.1.dist-info/METADATA,sha256=3HoOtnYMOgnRcgo0iuvVpEhrJb0LTGPCSUWK7bozfFQ,2172
|
|
9
|
-
vertexengine_webengine-1.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
10
|
-
vertexengine_webengine-1.1.dist-info/top_level.txt,sha256=ONNMJUQViY7bNuEYPB2TaUwj7Jo1Is2yuBY4KOv19wM,13
|
|
11
|
-
vertexengine_webengine-1.1.dist-info/RECORD,,
|
{vertexengine_webengine-1.1.dist-info → vertexengine_webengine-1.2.dev1.dist-info}/top_level.txt
RENAMED
|
File without changes
|