mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-27 00:25:45 -04:00
Receive mode and chat mode are also looking awesome
This commit is contained in:
parent
327253fc26
commit
f65e7a3507
7 changed files with 52 additions and 23 deletions
|
@ -74,13 +74,8 @@ class GuiCommon:
|
||||||
}""",
|
}""",
|
||||||
"mode_header_label": """
|
"mode_header_label": """
|
||||||
QLabel {
|
QLabel {
|
||||||
color: #ffffff;
|
color: #333333;
|
||||||
background-color: #4e064f;
|
font-size: 30px;
|
||||||
border: 0;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 18px;
|
|
||||||
border-radius: 0;
|
|
||||||
padding: 10px 0 10px 0;
|
|
||||||
}""",
|
}""",
|
||||||
"settings_button": """
|
"settings_button": """
|
||||||
QPushButton {
|
QPushButton {
|
||||||
|
@ -132,7 +127,7 @@ class GuiCommon:
|
||||||
QPushButton {
|
QPushButton {
|
||||||
background-color: #5fa416;
|
background-color: #5fa416;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
padding: 10px;
|
padding: 10px 30px 10px 30px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}""",
|
}""",
|
||||||
|
@ -140,7 +135,7 @@ class GuiCommon:
|
||||||
QPushButton {
|
QPushButton {
|
||||||
background-color: #4c8211;
|
background-color: #4c8211;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
padding: 10px;
|
padding: 10px 30px 10px 30px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
@ -149,7 +144,7 @@ class GuiCommon:
|
||||||
QPushButton {
|
QPushButton {
|
||||||
background-color: #d0011b;
|
background-color: #d0011b;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
padding: 10px;
|
padding: 10px 30px 10px 30px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}""",
|
}""",
|
||||||
|
|
|
@ -93,12 +93,6 @@ class Mode(QtWidgets.QWidget):
|
||||||
self.starting_server_early.connect(self.start_server_early)
|
self.starting_server_early.connect(self.start_server_early)
|
||||||
self.starting_server_error.connect(self.start_server_error)
|
self.starting_server_error.connect(self.start_server_error)
|
||||||
|
|
||||||
# Header
|
|
||||||
# Note: It's up to the downstream Mode to add this to its layout
|
|
||||||
self.header_label = QtWidgets.QLabel()
|
|
||||||
self.header_label.setStyleSheet(self.common.gui.css["mode_header_label"])
|
|
||||||
self.header_label.setAlignment(QtCore.Qt.AlignHCenter)
|
|
||||||
|
|
||||||
# Primary action
|
# Primary action
|
||||||
# Note: It's up to the downstream Mode to add this to its layout
|
# Note: It's up to the downstream Mode to add this to its layout
|
||||||
self.primary_action_layout = QtWidgets.QVBoxLayout()
|
self.primary_action_layout = QtWidgets.QVBoxLayout()
|
||||||
|
|
|
@ -47,8 +47,20 @@ class ChatMode(Mode):
|
||||||
# Create the Web object
|
# Create the Web object
|
||||||
self.web = Web(self.common, True, self.settings, "chat")
|
self.web = Web(self.common, True, self.settings, "chat")
|
||||||
|
|
||||||
# Header
|
# Chat image
|
||||||
self.header_label.setText(strings._("gui_new_tab_chat_button"))
|
self.image_label = QtWidgets.QLabel()
|
||||||
|
self.image_label.setPixmap(
|
||||||
|
QtGui.QPixmap.fromImage(
|
||||||
|
QtGui.QImage(self.common.get_resource_path("images/mode_chat.png"))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.image_label.setFixedSize(300, 300)
|
||||||
|
image_layout = QtWidgets.QVBoxLayout()
|
||||||
|
image_layout.addStretch()
|
||||||
|
image_layout.addWidget(self.image_label)
|
||||||
|
image_layout.addStretch()
|
||||||
|
self.image = QtWidgets.QWidget()
|
||||||
|
self.image.setLayout(image_layout)
|
||||||
|
|
||||||
# Server status
|
# Server status
|
||||||
self.server_status.set_mode("chat")
|
self.server_status.set_mode("chat")
|
||||||
|
@ -59,6 +71,10 @@ class ChatMode(Mode):
|
||||||
self.server_status.web = self.web
|
self.server_status.web = self.web
|
||||||
self.server_status.update()
|
self.server_status.update()
|
||||||
|
|
||||||
|
# Header
|
||||||
|
header_label = QtWidgets.QLabel(strings._("gui_new_tab_chat_button"))
|
||||||
|
header_label.setStyleSheet(self.common.gui.css["mode_header_label"])
|
||||||
|
|
||||||
# Top bar
|
# Top bar
|
||||||
top_bar_layout = QtWidgets.QHBoxLayout()
|
top_bar_layout = QtWidgets.QHBoxLayout()
|
||||||
top_bar_layout.addStretch()
|
top_bar_layout.addStretch()
|
||||||
|
@ -66,17 +82,19 @@ class ChatMode(Mode):
|
||||||
# Main layout
|
# Main layout
|
||||||
self.main_layout = QtWidgets.QVBoxLayout()
|
self.main_layout = QtWidgets.QVBoxLayout()
|
||||||
self.main_layout.addLayout(top_bar_layout)
|
self.main_layout.addLayout(top_bar_layout)
|
||||||
|
self.main_layout.addStretch()
|
||||||
|
self.main_layout.addWidget(header_label)
|
||||||
self.main_layout.addWidget(self.primary_action)
|
self.main_layout.addWidget(self.primary_action)
|
||||||
self.main_layout.addStretch()
|
self.main_layout.addStretch()
|
||||||
self.main_layout.addWidget(MinimumWidthWidget(700))
|
self.main_layout.addWidget(MinimumWidthWidget(700))
|
||||||
|
|
||||||
# Column layout
|
# Column layout
|
||||||
self.column_layout = QtWidgets.QHBoxLayout()
|
self.column_layout = QtWidgets.QHBoxLayout()
|
||||||
|
self.column_layout.addWidget(self.image)
|
||||||
self.column_layout.addLayout(self.main_layout)
|
self.column_layout.addLayout(self.main_layout)
|
||||||
|
|
||||||
# Wrapper layout
|
# Wrapper layout
|
||||||
self.wrapper_layout = QtWidgets.QVBoxLayout()
|
self.wrapper_layout = QtWidgets.QVBoxLayout()
|
||||||
self.wrapper_layout.addWidget(self.header_label)
|
|
||||||
self.wrapper_layout.addLayout(self.column_layout)
|
self.wrapper_layout.addLayout(self.column_layout)
|
||||||
self.setLayout(self.wrapper_layout)
|
self.setLayout(self.wrapper_layout)
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,20 @@ class ReceiveMode(Mode):
|
||||||
# Create the Web object
|
# Create the Web object
|
||||||
self.web = Web(self.common, True, self.settings, "receive")
|
self.web = Web(self.common, True, self.settings, "receive")
|
||||||
|
|
||||||
# Header
|
# Receive image
|
||||||
self.header_label.setText(strings._("gui_new_tab_receive_button"))
|
self.image_label = QtWidgets.QLabel()
|
||||||
|
self.image_label.setPixmap(
|
||||||
|
QtGui.QPixmap.fromImage(
|
||||||
|
QtGui.QImage(self.common.get_resource_path("images/mode_receive.png"))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.image_label.setFixedSize(300, 300)
|
||||||
|
image_layout = QtWidgets.QVBoxLayout()
|
||||||
|
image_layout.addStretch()
|
||||||
|
image_layout.addWidget(self.image_label)
|
||||||
|
image_layout.addStretch()
|
||||||
|
self.image = QtWidgets.QWidget()
|
||||||
|
self.image.setLayout(image_layout)
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
data_dir_label = QtWidgets.QLabel(
|
data_dir_label = QtWidgets.QLabel(
|
||||||
|
@ -97,6 +109,10 @@ class ReceiveMode(Mode):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Header
|
||||||
|
header_label = QtWidgets.QLabel(strings._("gui_new_tab_receive_button"))
|
||||||
|
header_label.setStyleSheet(self.common.gui.css["mode_header_label"])
|
||||||
|
|
||||||
# Receive mode warning
|
# Receive mode warning
|
||||||
receive_warning = QtWidgets.QLabel(strings._("gui_receive_mode_warning"))
|
receive_warning = QtWidgets.QLabel(strings._("gui_receive_mode_warning"))
|
||||||
receive_warning.setMinimumHeight(80)
|
receive_warning.setMinimumHeight(80)
|
||||||
|
@ -110,6 +126,8 @@ class ReceiveMode(Mode):
|
||||||
# Main layout
|
# Main layout
|
||||||
self.main_layout = QtWidgets.QVBoxLayout()
|
self.main_layout = QtWidgets.QVBoxLayout()
|
||||||
self.main_layout.addLayout(top_bar_layout)
|
self.main_layout.addLayout(top_bar_layout)
|
||||||
|
self.main_layout.addStretch()
|
||||||
|
self.main_layout.addWidget(header_label)
|
||||||
self.main_layout.addWidget(receive_warning)
|
self.main_layout.addWidget(receive_warning)
|
||||||
self.main_layout.addWidget(self.primary_action)
|
self.main_layout.addWidget(self.primary_action)
|
||||||
self.main_layout.addStretch()
|
self.main_layout.addStretch()
|
||||||
|
@ -117,12 +135,12 @@ class ReceiveMode(Mode):
|
||||||
|
|
||||||
# Column layout
|
# Column layout
|
||||||
self.column_layout = QtWidgets.QHBoxLayout()
|
self.column_layout = QtWidgets.QHBoxLayout()
|
||||||
|
self.column_layout.addWidget(self.image)
|
||||||
self.column_layout.addLayout(self.main_layout)
|
self.column_layout.addLayout(self.main_layout)
|
||||||
self.column_layout.addWidget(self.history, stretch=1)
|
self.column_layout.addWidget(self.history, stretch=1)
|
||||||
|
|
||||||
# Wrapper layout
|
# Wrapper layout
|
||||||
self.wrapper_layout = QtWidgets.QVBoxLayout()
|
self.wrapper_layout = QtWidgets.QVBoxLayout()
|
||||||
self.wrapper_layout.addWidget(self.header_label)
|
|
||||||
self.wrapper_layout.addLayout(self.column_layout)
|
self.wrapper_layout.addLayout(self.column_layout)
|
||||||
self.setLayout(self.wrapper_layout)
|
self.setLayout(self.wrapper_layout)
|
||||||
|
|
||||||
|
|
|
@ -129,8 +129,12 @@ class ServerStatus(QtWidgets.QWidget):
|
||||||
url_layout.addLayout(url_buttons_layout)
|
url_layout.addLayout(url_buttons_layout)
|
||||||
|
|
||||||
# Add the widgets
|
# Add the widgets
|
||||||
|
button_layout = QtWidgets.QHBoxLayout()
|
||||||
|
button_layout.addWidget(self.server_button)
|
||||||
|
button_layout.addStretch()
|
||||||
|
|
||||||
layout = QtWidgets.QVBoxLayout()
|
layout = QtWidgets.QVBoxLayout()
|
||||||
layout.addWidget(self.server_button)
|
layout.addLayout(button_layout)
|
||||||
layout.addLayout(url_layout)
|
layout.addLayout(url_layout)
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 27 KiB |
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
Loading…
Add table
Add a link
Reference in a new issue