diff options
author | Micah Lee <micah@micahflee.com> | 2020-12-13 10:29:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 10:29:09 -0800 |
commit | e092c50b4200478a71a796ab4ca9167a6000c150 (patch) | |
tree | 49288063b64dda653f1066f9430745fc69b3a78d | |
parent | 5f612a94a0356b797a1811f3898e5b4345b6952d (diff) | |
parent | 47e8b7f6665027ddfce48daa04b8ddb914649763 (diff) | |
download | onionshare-e092c50b4200478a71a796ab4ca9167a6000c150.tar.gz onionshare-e092c50b4200478a71a796ab4ca9167a6000c150.zip |
Merge pull request #1243 from SaptakS/1240_newtab_text
Adjusts height of title based on length of text
-rw-r--r-- | desktop/src/onionshare/gui_common.py | 2 | ||||
-rw-r--r-- | desktop/src/onionshare/tab/tab.py | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/desktop/src/onionshare/gui_common.py b/desktop/src/onionshare/gui_common.py index 017fd6b7..7d367b99 100644 --- a/desktop/src/onionshare/gui_common.py +++ b/desktop/src/onionshare/gui_common.py @@ -260,7 +260,7 @@ class GuiCommon: QLabel { text-align: center; color: #333333; - font-size: 28px; + font-size: 25px; } """, # Share mode and child widget styles diff --git a/desktop/src/onionshare/tab/tab.py b/desktop/src/onionshare/tab/tab.py index 5e819405..8f5ffd08 100644 --- a/desktop/src/onionshare/tab/tab.py +++ b/desktop/src/onionshare/tab/tab.py @@ -53,16 +53,22 @@ class NewTabButton(QtWidgets.QPushButton): ) self.image_label.setAlignment(QtCore.Qt.AlignCenter) self.image_label.setStyleSheet(self.common.gui.css["new_tab_button_image"]) - self.image_label.setGeometry(0, 0, self.width(), 200) + self.image_label.setGeometry(0, 0, self.width(), 190) self.image_label.show() # Title self.title_label = QtWidgets.QLabel(title, parent=self) + self.title_label.setWordWrap(True) self.title_label.setAlignment(QtCore.Qt.AlignCenter) self.title_label.setStyleSheet(self.common.gui.css["new_tab_title_text"]) - self.title_label.setGeometry( - (self.width() - 250) / 2, self.height() - 100, 250, 30 - ) + if self.title_label.sizeHint().width() >= 250: + self.title_label.setGeometry( + (self.width() - 250) / 2, self.height() - 120, 250, 60 + ) + else: + self.title_label.setGeometry( + (self.width() - 250) / 2, self.height() - 100, 250, 30 + ) self.title_label.show() # Text |