Merge branch '780_improved_ui' into 690_language_dropdown

This commit is contained in:
Micah Lee 2018-10-10 18:32:01 -07:00
commit ac10b8899f
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
41 changed files with 1363 additions and 1025 deletions

View file

@ -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())