ui update

This commit is contained in:
ingvar1995 2016-03-30 20:33:42 +03:00
parent 721ac2b807
commit 9696615caf
5 changed files with 31 additions and 30 deletions

View file

@ -126,13 +126,13 @@ class MainWindow(QtGui.QMainWindow):
def setup_left_bottom(self, Form): def setup_left_bottom(self, Form):
Form.setObjectName("left_bottom") Form.setObjectName("left_bottom")
Form.resize(500, 80) Form.resize(500, 60)
self.online_contacts = QtGui.QCheckBox(Form) self.online_contacts = QtGui.QCheckBox(Form)
self.online_contacts.setGeometry(QtCore.QRect(0, 20, 141, 22)) self.online_contacts.setGeometry(QtCore.QRect(0, 0, 140, 20))
self.online_contacts.setObjectName("online_contacts") self.online_contacts.setObjectName("online_contacts")
self.online_contacts.clicked.connect(self.filtering) self.online_contacts.clicked.connect(self.filtering)
self.contact_name = QtGui.QLineEdit(Form) self.contact_name = QtGui.QLineEdit(Form)
self.contact_name.setGeometry(QtCore.QRect(0, 40, 140, 28)) self.contact_name.setGeometry(QtCore.QRect(0, 27, 270, 30))
self.contact_name.setObjectName("contact_name") self.contact_name.setObjectName("contact_name")
self.contact_name.textChanged.connect(self.filtering) self.contact_name.textChanged.connect(self.filtering)
self.online_contacts.setText(QtGui.QApplication.translate("Form", "Online contacts", None, QtGui.QApplication.UnicodeUTF8)) self.online_contacts.setText(QtGui.QApplication.translate("Form", "Online contacts", None, QtGui.QApplication.UnicodeUTF8))
@ -149,7 +149,7 @@ class MainWindow(QtGui.QMainWindow):
self.avatar_label.setGeometry(QtCore.QRect(10, 20, 64, 64)) self.avatar_label.setGeometry(QtCore.QRect(10, 20, 64, 64))
self.avatar_label.setScaledContents(True) self.avatar_label.setScaledContents(True)
self.name = Form.name = QtGui.QLabel(Form) self.name = Form.name = QtGui.QLabel(Form)
Form.name.setGeometry(QtCore.QRect(80, 30, 120, 25)) Form.name.setGeometry(QtCore.QRect(80, 30, 150, 25))
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily("Times New Roman") font.setFamily("Times New Roman")
font.setPointSize(14) font.setPointSize(14)
@ -163,7 +163,7 @@ class MainWindow(QtGui.QMainWindow):
Form.status_message.setFont(font) Form.status_message.setFont(font)
Form.status_message.setObjectName("status_message") Form.status_message.setObjectName("status_message")
self.connection_status = Form.connection_status = StatusCircle(self) self.connection_status = Form.connection_status = StatusCircle(self)
Form.connection_status.setGeometry(QtCore.QRect(200, 34, 64, 64)) Form.connection_status.setGeometry(QtCore.QRect(230, 34, 64, 64))
Form.connection_status.setMinimumSize(QtCore.QSize(32, 32)) Form.connection_status.setMinimumSize(QtCore.QSize(32, 32))
Form.connection_status.setMaximumSize(QtCore.QSize(32, 32)) Form.connection_status.setMaximumSize(QtCore.QSize(32, 32))
Form.connection_status.setBaseSize(QtCore.QSize(32, 32)) Form.connection_status.setBaseSize(QtCore.QSize(32, 32))
@ -205,7 +205,7 @@ class MainWindow(QtGui.QMainWindow):
def setup_left_center(self, widget): def setup_left_center(self, widget):
self.friends_list = QtGui.QListWidget(widget) self.friends_list = QtGui.QListWidget(widget)
self.friends_list.setObjectName("friends_list") self.friends_list.setObjectName("friends_list")
self.friends_list.setGeometry(0, 0, 270, 250) self.friends_list.setGeometry(0, 0, 270, 310)
self.friends_list.clicked.connect(self.friend_click) self.friends_list.clicked.connect(self.friend_click)
self.friends_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.friends_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.friends_list.connect(self.friends_list, QtCore.SIGNAL("customContextMenuRequested(QPoint)"), self.friends_list.connect(self.friends_list, QtCore.SIGNAL("customContextMenuRequested(QPoint)"),
@ -225,15 +225,15 @@ class MainWindow(QtGui.QMainWindow):
self.messages.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel) self.messages.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
def initUI(self, tox): def initUI(self, tox):
self.setMinimumSize(920, 520) self.setMinimumSize(920, 500)
self.setMaximumSize(920, 520) self.setMaximumSize(920, 500)
self.setGeometry(400, 400, 920, 520) self.setGeometry(400, 400, 920, 500)
self.setWindowTitle('Toxygen') self.setWindowTitle('Toxygen')
main = QtGui.QWidget() main = QtGui.QWidget()
grid = QtGui.QGridLayout() grid = QtGui.QGridLayout()
search = QtGui.QWidget() search = QtGui.QWidget()
self.setup_left_bottom(search) self.setup_left_bottom(search)
grid.addWidget(search, 2, 0) grid.addWidget(search, 3, 0)
name = QtGui.QWidget() name = QtGui.QWidget()
self.setup_left_top(name) self.setup_left_top(name)
grid.addWidget(name, 0, 0) grid.addWidget(name, 0, 0)
@ -245,13 +245,14 @@ class MainWindow(QtGui.QMainWindow):
grid.addWidget(info, 0, 1) grid.addWidget(info, 0, 1)
message_buttons = QtGui.QWidget() message_buttons = QtGui.QWidget()
self.setup_right_bottom(message_buttons) self.setup_right_bottom(message_buttons)
grid.addWidget(message_buttons, 2, 1) grid.addWidget(message_buttons, 2, 1, 2, 1)
main_list = QtGui.QWidget() main_list = QtGui.QWidget()
self.setup_left_center(main_list) self.setup_left_center(main_list)
grid.addWidget(main_list, 1, 0) grid.addWidget(main_list, 1, 0, 2, 1)
grid.setColumnMinimumWidth(1, 500) grid.setColumnMinimumWidth(1, 500)
grid.setColumnMinimumWidth(0, 270) grid.setColumnMinimumWidth(0, 270)
grid.setRowMinimumHeight(1, 250) grid.setRowMinimumHeight(1, 250)
grid.setRowMinimumHeight(3, 50)
main.setLayout(grid) main.setLayout(grid)
self.setCentralWidget(main) self.setCentralWidget(main)
self.setup_menu(self) self.setup_menu(self)
@ -269,8 +270,8 @@ class MainWindow(QtGui.QMainWindow):
def about_program(self): def about_program(self):
import util import util
msgBox = QtGui.QMessageBox() msgBox = QtGui.QMessageBox()
msgBox.setWindowTitle("About") msgBox.setWindowTitle('About')
msgBox.setText("Toxygen is pythonic Tox client. Version: " + util.program_version) msgBox.setText('Toxygen is Tox client written on Python 2.7. Version: ' + util.program_version)
msgBox.exec_() msgBox.exec_()
def network_settings(self): def network_settings(self):

View file

@ -128,14 +128,14 @@ class ProfileSettings(CenteredWidget):
self.export.setGeometry(QtCore.QRect(200, 250, 150, 30)) self.export.setGeometry(QtCore.QRect(200, 250, 150, 30))
self.export.setObjectName("export") self.export.setObjectName("export")
self.export.clicked.connect(self.export_profile) self.export.clicked.connect(self.export_profile)
self.comboBox = QtGui.QComboBox(self) self.lang_choose = QtGui.QComboBox(self)
self.comboBox.setGeometry(QtCore.QRect(30, 350, 211, 27)) self.lang_choose.setGeometry(QtCore.QRect(30, 350, 211, 27))
self.comboBox.setObjectName("comboBox") self.lang_choose.setObjectName("comboBox")
self.tox_id_2 = QtGui.QLabel(self) self.lang_choose.addItem('English')
self.tox_id_2.setGeometry(QtCore.QRect(40, 310, 121, 31)) self.lang = QtGui.QLabel(self)
self.lang.setGeometry(QtCore.QRect(40, 310, 121, 31))
font.setPointSize(18) font.setPointSize(18)
self.tox_id_2.setFont(font) self.lang.setFont(font)
self.tox_id_2.setObjectName("tox_id_2")
self.new_avatar = QtGui.QPushButton(self) self.new_avatar = QtGui.QPushButton(self)
self.new_avatar.setGeometry(QtCore.QRect(400, 50, 200, 50)) self.new_avatar.setGeometry(QtCore.QRect(400, 50, 200, 50))
self.delete_avatar = QtGui.QPushButton(self) self.delete_avatar = QtGui.QPushButton(self)
@ -152,7 +152,7 @@ class ProfileSettings(CenteredWidget):
self.label_2.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Status:", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Status:", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("ProfileSettingsForm", "TOX ID:", None, QtGui.QApplication.UnicodeUTF8)) self.label_3.setText(QtGui.QApplication.translate("ProfileSettingsForm", "TOX ID:", None, QtGui.QApplication.UnicodeUTF8))
self.copyId.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Copy TOX ID", None, QtGui.QApplication.UnicodeUTF8)) self.copyId.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Copy TOX ID", None, QtGui.QApplication.UnicodeUTF8))
self.tox_id_2.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Language:", None, QtGui.QApplication.UnicodeUTF8)) self.lang.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Language:", None, QtGui.QApplication.UnicodeUTF8))
self.new_avatar.setText(QtGui.QApplication.translate("ProfileSettingsForm", "New avatar", None, QtGui.QApplication.UnicodeUTF8)) self.new_avatar.setText(QtGui.QApplication.translate("ProfileSettingsForm", "New avatar", None, QtGui.QApplication.UnicodeUTF8))
self.delete_avatar.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Reset avatar", None, QtGui.QApplication.UnicodeUTF8)) self.delete_avatar.setText(QtGui.QApplication.translate("ProfileSettingsForm", "Reset avatar", None, QtGui.QApplication.UnicodeUTF8))

View file

@ -87,7 +87,7 @@ class Contact(object):
self._name, self._status_message = name, status_message self._name, self._status_message = name, status_message
self._status, self._widget = None, widget self._status, self._widget = None, widget
if type(self) is Profile: if type(self) is Profile:
self._widget.name.setText(name if len(name) <= 14 else name[:11] + '...') self._widget.name.setText(name if len(name) <= 12 else name[:9] + '...')
else: else:
self._widget.name.setText(name if len(name) <= 20 else name[:17] + '...') self._widget.name.setText(name if len(name) <= 20 else name[:17] + '...')
if type(self) is Profile: if type(self) is Profile:
@ -108,7 +108,7 @@ class Contact(object):
def set_name(self, value): def set_name(self, value):
self._name = value.decode('utf-8') self._name = value.decode('utf-8')
if type(self) is Profile: if type(self) is Profile:
self._widget.name.setText(self._name if len(self._name) <= 14 else self._name[:11] + '...') self._widget.name.setText(self._name if len(self._name) <= 12 else self._name[:9] + '...')
else: else:
self._widget.name.setText(self._name if len(self._name) <= 20 else self._name[:17] + '...') self._widget.name.setText(self._name if len(self._name) <= 20 else self._name[:17] + '...')
self._widget.name.repaint() self._widget.name.repaint()

View file

@ -45,7 +45,7 @@ QWidget
{ {
color: silver; color: silver;
background-color: #302F2F; background-color: #302F2F;
selection-background-color:#008B8B; selection-background-color: #A9A9A9;
selection-color: black; selection-color: black;
background-clip: border; background-clip: border;
border-image: none; border-image: none;
@ -60,7 +60,7 @@ QWidget:item:hover
QWidget:item:selected QWidget:item:selected
{ {
background-color: #008B8B; background-color: #A9A9A9;
} }
QCheckBox QCheckBox
@ -229,13 +229,13 @@ QMenuBar::item
QMenuBar::item:selected QMenuBar::item:selected
{ {
background: transparent; background: transparent;
border: 1px solid #008B8B; border: 1px solid #A9A9A9;
} }
QMenuBar::item:pressed QMenuBar::item:pressed
{ {
border: 1px solid #3A3939; border: 1px solid #3A3939;
background-color: #008B8B; background-color: #A9A9A9;
color: black; color: black;
margin-bottom:-1px; margin-bottom:-1px;
padding-bottom:1px; padding-bottom:1px;
@ -1266,6 +1266,6 @@ QPushButton:hover
#toxygen #toxygen
{ {
color: white; color: #A9A9A9;
} }

View file

@ -3,7 +3,7 @@ import time
from platform import system from platform import system
program_version = '0.0.2 (alpha)' program_version = '0.0.3'
def log(data): def log(data):