Skip to content

Commit 7857bc0

Browse files
Merge pull request #90 from NekoSilverFox/MengJianing
Optimize the interface
2 parents 2cc1d20 + 928c546 commit 7857bc0

File tree

6 files changed

+86
-50
lines changed

6 files changed

+86
-50
lines changed

PolyChatApp/chatboxwidget.ui

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,8 @@
9393
<item>
9494
<widget class="QComboBox" name="cbxFontSize">
9595
<property name="currentIndex">
96-
<number>0</number>
96+
<number>2</number>
9797
</property>
98-
<item>
99-
<property name="text">
100-
<string>8</string>
101-
</property>
102-
</item>
10398
<item>
10499
<property name="text">
105100
<string>10</string>
@@ -442,7 +437,7 @@
442437
</size>
443438
</property>
444439
<property name="shortcut">
445-
<string>Return</string>
440+
<string>Shift+Return</string>
446441
</property>
447442
</widget>
448443
</item>

PolyChatApp/chatlist.ui

Lines changed: 81 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,39 @@
2828
<property name="orientation">
2929
<enum>Qt::Horizontal</enum>
3030
</property>
31-
<property name="sizeType">
32-
<enum>QSizePolicy::Expanding</enum>
33-
</property>
3431
<property name="sizeHint" stdset="0">
3532
<size>
36-
<width>20</width>
33+
<width>40</width>
3734
<height>20</height>
3835
</size>
3936
</property>
4037
</spacer>
4138
</item>
39+
<item>
40+
<widget class="QLabel" name="label_6">
41+
<property name="sizePolicy">
42+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
43+
<horstretch>0</horstretch>
44+
<verstretch>0</verstretch>
45+
</sizepolicy>
46+
</property>
47+
<property name="maximumSize">
48+
<size>
49+
<width>50</width>
50+
<height>50</height>
51+
</size>
52+
</property>
53+
<property name="text">
54+
<string/>
55+
</property>
56+
<property name="pixmap">
57+
<pixmap resource="resource.qrc">:/icon/icons/logo_fox.png</pixmap>
58+
</property>
59+
<property name="scaledContents">
60+
<bool>true</bool>
61+
</property>
62+
</widget>
63+
</item>
4264
<item>
4365
<widget class="QLabel" name="label">
4466
<property name="font">
@@ -57,37 +79,14 @@
5779
<property name="orientation">
5880
<enum>Qt::Horizontal</enum>
5981
</property>
60-
<property name="sizeType">
61-
<enum>QSizePolicy::Fixed</enum>
62-
</property>
6382
<property name="sizeHint" stdset="0">
6483
<size>
65-
<width>25</width>
84+
<width>40</width>
6685
<height>20</height>
6786
</size>
6887
</property>
6988
</spacer>
7089
</item>
71-
<item>
72-
<widget class="QToolButton" name="btnNewChat">
73-
<property name="text">
74-
<string>...</string>
75-
</property>
76-
<property name="icon">
77-
<iconset resource="resource.qrc">
78-
<normaloff>:/icon/icons/plus.png</normaloff>:/icon/icons/plus.png</iconset>
79-
</property>
80-
<property name="iconSize">
81-
<size>
82-
<width>20</width>
83-
<height>16</height>
84-
</size>
85-
</property>
86-
<property name="autoRaise">
87-
<bool>true</bool>
88-
</property>
89-
</widget>
90-
</item>
9190
</layout>
9291
</widget>
9392
</item>
@@ -129,6 +128,41 @@
129128
</property>
130129
</widget>
131130
</item>
131+
<item>
132+
<widget class="QToolButton" name="btnNewChat">
133+
<property name="minimumSize">
134+
<size>
135+
<width>0</width>
136+
<height>25</height>
137+
</size>
138+
</property>
139+
<property name="maximumSize">
140+
<size>
141+
<width>16777215</width>
142+
<height>25</height>
143+
</size>
144+
</property>
145+
<property name="text">
146+
<string>+</string>
147+
</property>
148+
<property name="icon">
149+
<iconset resource="resource.qrc">
150+
<normaloff>:/icon/icons/add.png</normaloff>:/icon/icons/add.png</iconset>
151+
</property>
152+
<property name="iconSize">
153+
<size>
154+
<width>20</width>
155+
<height>25</height>
156+
</size>
157+
</property>
158+
<property name="toolButtonStyle">
159+
<enum>Qt::ToolButtonIconOnly</enum>
160+
</property>
161+
<property name="autoRaise">
162+
<bool>true</bool>
163+
</property>
164+
</widget>
165+
</item>
132166
</layout>
133167
</widget>
134168
</item>
@@ -143,7 +177,7 @@
143177
<x>0</x>
144178
<y>0</y>
145179
<width>334</width>
146-
<height>493</height>
180+
<height>470</height>
147181
</rect>
148182
</property>
149183
<attribute name="label">
@@ -155,9 +189,15 @@
155189
</item>
156190
<item>
157191
<widget class="QGroupBox" name="groupBox">
192+
<property name="autoFillBackground">
193+
<bool>false</bool>
194+
</property>
158195
<property name="title">
159196
<string>Your info</string>
160197
</property>
198+
<property name="flat">
199+
<bool>false</bool>
200+
</property>
161201
<layout class="QGridLayout" name="gridLayout">
162202
<item row="1" column="0">
163203
<widget class="QLabel" name="label_4">
@@ -172,10 +212,10 @@
172212
</property>
173213
</widget>
174214
</item>
175-
<item row="0" column="0">
176-
<widget class="QLabel" name="label_3">
215+
<item row="0" column="1">
216+
<widget class="QLabel" name="lbName">
177217
<property name="text">
178-
<string>Name:</string>
218+
<string>NO_NAME</string>
179219
</property>
180220
</widget>
181221
</item>
@@ -186,24 +226,24 @@
186226
</property>
187227
</widget>
188228
</item>
189-
<item row="0" column="1">
190-
<widget class="QLabel" name="lbName">
229+
<item row="0" column="0">
230+
<widget class="QLabel" name="label_3">
191231
<property name="text">
192-
<string>name</string>
232+
<string>Name:</string>
193233
</property>
194234
</widget>
195235
</item>
196-
<item row="1" column="1">
197-
<widget class="QLabel" name="lbGroupNumber">
236+
<item row="2" column="1">
237+
<widget class="QLabel" name="lbIP">
198238
<property name="text">
199-
<string>XXXX/XXXXXX</string>
239+
<string>000.000.0.0</string>
200240
</property>
201241
</widget>
202242
</item>
203-
<item row="2" column="1">
204-
<widget class="QLabel" name="lbIP">
243+
<item row="1" column="1">
244+
<widget class="QLabel" name="lbGroupNumber">
205245
<property name="text">
206-
<string>000.000.0.0</string>
246+
<string>XXXX/XXXXXX</string>
207247
</property>
208248
</widget>
209249
</item>

PolyChatApp/icons/add.png

2.82 KB
Loading

PolyChatApp/resource.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<file>icons/register-add-friend.png</file>
1717
<file>icons/logo_fox.png</file>
1818
<file>icons/send-file.png</file>
19+
<file>icons/add.png</file>
1920
</qresource>
2021
</RCC>

PolyChatApp/uil_chatboxwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void ChatBoxWidget::receiveUDPMessage()
290290
// 追加聊天记录
291291
ui->msgTextBrowser->setTextColor(Qt::red);
292292
ui->msgTextBrowser->append(">>> [FILE] " + time);
293-
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()));
293+
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()));
294294
break;
295295

296296
case SignalType::UserJoin:

PolyChatApp/uil_chatlist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ChatList::ChatList(QWidget* parent, QString localUserName, QString localUserGrou
1414
ui(new Ui::ChatList)
1515
{
1616
ui->setupUi(this);
17-
this->setWindowTitle("Chat list");
17+
this->setWindowTitle("PolyChat Chat list");
1818
this->setWindowIcon(QIcon(":/icon/icons/logo_fox.png"));
1919

2020

0 commit comments

Comments
 (0)