mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-12 15:59:30 -05:00
Merge pull request #1243 from SaptakS/1240_newtab_text
Adjusts height of title based on length of text
This commit is contained in:
commit
e092c50b42
@ -260,7 +260,7 @@ class GuiCommon:
|
|||||||
QLabel {
|
QLabel {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 28px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
""",
|
""",
|
||||||
# Share mode and child widget styles
|
# Share mode and child widget styles
|
||||||
|
@ -53,16 +53,22 @@ class NewTabButton(QtWidgets.QPushButton):
|
|||||||
)
|
)
|
||||||
self.image_label.setAlignment(QtCore.Qt.AlignCenter)
|
self.image_label.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
self.image_label.setStyleSheet(self.common.gui.css["new_tab_button_image"])
|
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()
|
self.image_label.show()
|
||||||
|
|
||||||
# Title
|
# Title
|
||||||
self.title_label = QtWidgets.QLabel(title, parent=self)
|
self.title_label = QtWidgets.QLabel(title, parent=self)
|
||||||
|
self.title_label.setWordWrap(True)
|
||||||
self.title_label.setAlignment(QtCore.Qt.AlignCenter)
|
self.title_label.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
self.title_label.setStyleSheet(self.common.gui.css["new_tab_title_text"])
|
self.title_label.setStyleSheet(self.common.gui.css["new_tab_title_text"])
|
||||||
self.title_label.setGeometry(
|
if self.title_label.sizeHint().width() >= 250:
|
||||||
(self.width() - 250) / 2, self.height() - 100, 250, 30
|
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()
|
self.title_label.show()
|
||||||
|
|
||||||
# Text
|
# Text
|
||||||
|
Loading…
Reference in New Issue
Block a user