mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-11 02:45:03 -04:00
One attempt at making a new tab button
This commit is contained in:
parent
6190de5c53
commit
509516c46a
3 changed files with 29 additions and 3 deletions
|
@ -50,6 +50,16 @@ class GuiCommon:
|
|||
|
||||
self.css = {
|
||||
# OnionShareGui styles
|
||||
"tab_bar_new_tab": """
|
||||
QTabBar::tab:last {
|
||||
border: 0;
|
||||
margin: 3px;
|
||||
}""",
|
||||
"tab_bar_new_tab_button": """
|
||||
QToolButton {
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}""",
|
||||
"new_tab_button": """
|
||||
QPushButton {
|
||||
font-weight: bold;
|
||||
|
|
|
@ -97,10 +97,24 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
|
||||
# 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)
|
||||
|
||||
# Start with one tab
|
||||
self.tab = Tab(self.common, self.system_tray, self.status_bar, filenames)
|
||||
self.tabs.addTab(self.tab, "New Tab")
|
||||
# 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"))
|
||||
|
||||
# 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)
|
||||
|
||||
# Layout
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
|
|
|
@ -180,6 +180,8 @@
|
|||
"hours_first_letter": "h",
|
||||
"minutes_first_letter": "m",
|
||||
"seconds_first_letter": "s",
|
||||
"gui_new_tab": "New Tab",
|
||||
"gui_new_tab_tooltip": "Open a new tab",
|
||||
"gui_new_tab_share_button": "Share Files",
|
||||
"gui_new_tab_share_description": "Choose files on your computer to send to someone else. The person or people who you want to send files to will need to use Tor Browser to download them from you.",
|
||||
"gui_new_tab_receive_button": "Receive Files",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue