mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 07:25:10 -04:00
Merge branch '780_improved_ui' into 690_language_dropdown
This commit is contained in:
commit
ac10b8899f
41 changed files with 1363 additions and 1025 deletions
|
@ -90,20 +90,20 @@ class ServerStatus(QtWidgets.QWidget):
|
|||
self.server_button.clicked.connect(self.server_button_clicked)
|
||||
|
||||
# URL layout
|
||||
url_font = QtGui.QFont()
|
||||
url_font = QtGui.QFontDatabase.systemFont(QtGui.QFontDatabase.FixedFont)
|
||||
self.url_description = QtWidgets.QLabel()
|
||||
self.url_description.setWordWrap(True)
|
||||
self.url_description.setMinimumHeight(50)
|
||||
self.url = QtWidgets.QLabel()
|
||||
self.url.setFont(url_font)
|
||||
self.url.setWordWrap(True)
|
||||
self.url.setMinimumHeight(65)
|
||||
self.url.setMinimumSize(self.url.sizeHint())
|
||||
self.url.setStyleSheet(self.common.css['server_status_url'])
|
||||
|
||||
self.copy_url_button = QtWidgets.QPushButton(strings._('gui_copy_url'))
|
||||
self.copy_url_button.setFlat(True)
|
||||
self.copy_url_button.setStyleSheet(self.common.css['server_status_url_buttons'])
|
||||
self.copy_url_button.setMinimumHeight(65)
|
||||
self.copy_url_button.clicked.connect(self.copy_url)
|
||||
self.copy_hidservauth_button = QtWidgets.QPushButton(strings._('gui_copy_hidservauth'))
|
||||
self.copy_hidservauth_button.setFlat(True)
|
||||
|
@ -142,12 +142,12 @@ class ServerStatus(QtWidgets.QWidget):
|
|||
When the widget is resized, try and adjust the display of a v3 onion URL.
|
||||
"""
|
||||
try:
|
||||
self.get_url()
|
||||
# Wrap the URL label
|
||||
url_length=len(self.get_url())
|
||||
if url_length > 60:
|
||||
width = self.frameGeometry().width()
|
||||
if width < 530:
|
||||
wrapped_onion_url = textwrap.fill(self.get_url(), 50)
|
||||
wrapped_onion_url = textwrap.fill(self.get_url(), 46)
|
||||
self.url.setText(wrapped_onion_url)
|
||||
else:
|
||||
self.url.setText(self.get_url())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue