Skip to content

Commit

Permalink
Merge pull request #90 from NekoSilverFox/MengJianing
Browse files Browse the repository at this point in the history
Optimize the interface
  • Loading branch information
nekosilverfox authored Dec 10, 2022
2 parents 2cc1d20 + 928c546 commit 7857bc0
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 50 deletions.
9 changes: 2 additions & 7 deletions PolyChatApp/chatboxwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,8 @@
<item>
<widget class="QComboBox" name="cbxFontSize">
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
Expand Down Expand Up @@ -442,7 +437,7 @@
</size>
</property>
<property name="shortcut">
<string>Return</string>
<string>Shift+Return</string>
</property>
</widget>
</item>
Expand Down
122 changes: 81 additions & 41 deletions PolyChatApp/chatlist.ui
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,39 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resource.qrc">:/icon/icons/logo_fox.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
Expand All @@ -57,37 +79,14 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>25</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="btnNewChat">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/icon/icons/plus.png</normaloff>:/icon/icons/plus.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -129,6 +128,41 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnNewChat">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>+</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/icon/icons/add.png</normaloff>:/icon/icons/add.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>25</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand All @@ -143,7 +177,7 @@
<x>0</x>
<y>0</y>
<width>334</width>
<height>493</height>
<height>470</height>
</rect>
</property>
<attribute name="label">
Expand All @@ -155,9 +189,15 @@
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="title">
<string>Your info</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_4">
Expand All @@ -172,10 +212,10 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<item row="0" column="1">
<widget class="QLabel" name="lbName">
<property name="text">
<string>Name:</string>
<string>NO_NAME</string>
</property>
</widget>
</item>
Expand All @@ -186,24 +226,24 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lbName">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>name</string>
<string>Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lbGroupNumber">
<item row="2" column="1">
<widget class="QLabel" name="lbIP">
<property name="text">
<string>XXXX/XXXXXX</string>
<string>000.000.0.0</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="lbIP">
<item row="1" column="1">
<widget class="QLabel" name="lbGroupNumber">
<property name="text">
<string>000.000.0.0</string>
<string>XXXX/XXXXXX</string>
</property>
</widget>
</item>
Expand Down
Binary file added PolyChatApp/icons/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions PolyChatApp/resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<file>icons/register-add-friend.png</file>
<file>icons/logo_fox.png</file>
<file>icons/send-file.png</file>
<file>icons/add.png</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion PolyChatApp/uil_chatboxwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void ChatBoxWidget::receiveUDPMessage()
// 追加聊天记录
ui->msgTextBrowser->setTextColor(Qt::red);
ui->msgTextBrowser->append(">>> [FILE] " + time);
ui->msgTextBrowser->append(QString("<p><a href=\"%1\" target=\"_blank\">[Name]: %2 [Size]: %3Kb</a></p>").arg(msg_7).arg(QFileInfo(msg_7).fileName()).arg(QFileInfo(msg_7).size()));
ui->msgTextBrowser->append(QString("<div><p><a href=\"%1\" target=\"_blank\">[Name]: %2 [Size]: %3Kb</a></p></div>").arg(msg_7).arg(QFileInfo(msg_7).fileName()).arg(QFileInfo(msg_7).size()));
break;

case SignalType::UserJoin:
Expand Down
2 changes: 1 addition & 1 deletion PolyChatApp/uil_chatlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ChatList::ChatList(QWidget* parent, QString localUserName, QString localUserGrou
ui(new Ui::ChatList)
{
ui->setupUi(this);
this->setWindowTitle("Chat list");
this->setWindowTitle("PolyChat Chat list");
this->setWindowIcon(QIcon(":/icon/icons/logo_fox.png"));


Expand Down

0 comments on commit 7857bc0

Please sign in to comment.