Open new tab on Ctrl+click
This commit is contained in:
parent
16645768e6
commit
429d4a6814
1
TODO
1
TODO
@ -36,7 +36,6 @@ copypaste
|
|||||||
All kind of FIXMEs
|
All kind of FIXMEs
|
||||||
:bind
|
:bind
|
||||||
docstrings
|
docstrings
|
||||||
ctrl+click for new tab
|
|
||||||
completion code cleanup
|
completion code cleanup
|
||||||
|
|
||||||
Other stuff
|
Other stuff
|
||||||
|
@ -195,7 +195,7 @@ class BrowserTab(QWebView):
|
|||||||
progress = 0
|
progress = 0
|
||||||
scroll_pos_changed = pyqtSignal(int, int)
|
scroll_pos_changed = pyqtSignal(int, int)
|
||||||
_scroll_pos = (-1, -1)
|
_scroll_pos = (-1, -1)
|
||||||
midbutton = False # if the middle button was pressed
|
open_new_tab = False # open new tab for the next action
|
||||||
open_tab = pyqtSignal('QUrl')
|
open_tab = pyqtSignal('QUrl')
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
@ -212,7 +212,7 @@ class BrowserTab(QWebView):
|
|||||||
return self.load(utils.qurl(url))
|
return self.load(utils.qurl(url))
|
||||||
|
|
||||||
def link_handler(self, url):
|
def link_handler(self, url):
|
||||||
if self.midbutton:
|
if self.open_new_tab:
|
||||||
self.open_tab.emit(url)
|
self.open_tab.emit(url)
|
||||||
else:
|
else:
|
||||||
self.openurl(url)
|
self.openurl(url)
|
||||||
@ -242,5 +242,6 @@ class BrowserTab(QWebView):
|
|||||||
button
|
button
|
||||||
"""
|
"""
|
||||||
if e.type() in [QEvent.MouseButtonPress, QEvent.MouseButtonDblClick]:
|
if e.type() in [QEvent.MouseButtonPress, QEvent.MouseButtonDblClick]:
|
||||||
self.midbutton = (e.button() == Qt.MidButton)
|
self.open_new_tab = (e.button() == Qt.MidButton or
|
||||||
|
e.modifiers() & Qt.ControlModifier)
|
||||||
return super().event(e)
|
return super().event(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user