mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-06 08:25:15 -04:00
Make new tab button login in the QTabWidget instead of QTabBar
This commit is contained in:
parent
3ceab336f9
commit
f83d88b29e
4 changed files with 109 additions and 25 deletions
|
@ -26,7 +26,7 @@ from .tor_connection_dialog import TorConnectionDialog
|
|||
from .settings_dialog import SettingsDialog
|
||||
from .widgets import Alert
|
||||
from .update_checker import UpdateThread
|
||||
from .tab import Tab
|
||||
from .tab_widget import TabWidget
|
||||
|
||||
|
||||
class MainWindow(QtWidgets.QMainWindow):
|
||||
|
@ -96,25 +96,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
self.status_bar.addPermanentWidget(self.status_bar.server_status_indicator)
|
||||
|
||||
# Tabs
|
||||
self.tabs = QtWidgets.QTabWidget()
|
||||
self.tabs.setStyleSheet(self.common.gui.css["tab_bar_new_tab"])
|
||||
self.tabs.setMovable(True)
|
||||
self.tabs.setTabsClosable(True)
|
||||
self.tabs.setUsesScrollButtons(True)
|
||||
|
||||
# New tab button
|
||||
new_tab_button = QtWidgets.QToolButton()
|
||||
new_tab_button.setStyleSheet(self.common.gui.css["tab_bar_new_tab_button"])
|
||||
new_tab_button.setText("+")
|
||||
new_tab_button.setAutoRaise(True)
|
||||
self.tabs.insertTab(0, QtWidgets.QWidget(), "")
|
||||
self.tabs.tabBar().setTabButton(0, QtWidgets.QTabBar.RightSide, new_tab_button)
|
||||
self.tabs.tabBar().setTabToolTip(0, strings._("gui_new_tab_tooltip"))
|
||||
self.tabs = TabWidget(self.common, self.system_tray, self.status_bar)
|
||||
|
||||
# Start with a tab
|
||||
new_tab = Tab(self.common, self.system_tray, self.status_bar, filenames)
|
||||
self.tabs.insertTab(0, new_tab, strings._("gui_new_tab"))
|
||||
self.tabs.setCurrentIndex(0)
|
||||
# new_tab = Tab(self.common, self.system_tray, self.status_bar, filenames)
|
||||
# self.tabs.insertTab(0, new_tab, strings._("gui_new_tab"))
|
||||
# self.tabs.setCurrentIndex(0)
|
||||
|
||||
# Layout
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue