parent
6576796718
commit
ab2d2d79ca
@ -381,6 +381,10 @@ class CommandDispatcher:
|
||||
curtab = self._current_widget()
|
||||
tabbed_browser = self._tabbed_browser(window)
|
||||
newtab = tabbed_browser.tabopen(background=bg, explicit=True)
|
||||
idx = tabbed_browser.indexOf(newtab)
|
||||
tabbed_browser.setTabText(idx, curtab.title().replace('&', '&&'))
|
||||
tabbed_browser.setTabIcon(idx, curtab.icon())
|
||||
newtab.keep_icon = True
|
||||
history = qtutils.serialize(curtab.history())
|
||||
qtutils.deserialize(history, newtab.history())
|
||||
return newtab
|
||||
|
@ -58,6 +58,8 @@ class WebView(QWebView):
|
||||
open_target: Where to open the next tab ("normal", "tab", "tab_bg")
|
||||
viewing_source: Whether the webview is currently displaying source
|
||||
code.
|
||||
keep_icon: Whether the (e.g. cloned) icon should not be cleared on page
|
||||
load.
|
||||
registry: The ObjectRegistry associated with this tab.
|
||||
tab_id: The tab ID of the view.
|
||||
_cur_url: The current URL (accessed via cur_url property).
|
||||
@ -101,6 +103,7 @@ class WebView(QWebView):
|
||||
self._force_open_target = None
|
||||
self._zoom = None
|
||||
self._has_ssl_errors = False
|
||||
self.keep_icon = False
|
||||
self.init_neighborlist()
|
||||
cfg = objreg.get('config')
|
||||
cfg.changed.connect(self.init_neighborlist)
|
||||
|
@ -426,7 +426,10 @@ class TabbedBrowser(tabwidget.TabWidget):
|
||||
# We can get signals for tabs we already deleted...
|
||||
log.webview.debug("Got invalid tab {}!".format(tab))
|
||||
return
|
||||
self.setTabIcon(idx, QIcon())
|
||||
if tab.keep_icon:
|
||||
tab.keep_icon = False
|
||||
else:
|
||||
self.setTabIcon(idx, QIcon())
|
||||
if idx == self.currentIndex():
|
||||
self._update_window_title()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user