-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatgui.py
330 lines (323 loc) · 14.5 KB
/
chatgui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chatwindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_chat_qwidget(object):
def setupUi(self, chat_qwidget):
chat_qwidget.setObjectName("chat_qwidget")
chat_qwidget.resize(800, 600)
chat_qwidget.setMinimumSize(QtCore.QSize(800, 600))
font = QtGui.QFont()
font.setFamily("Candara")
font.setPointSize(10)
chat_qwidget.setFont(font)
chat_qwidget.setStyleSheet("border: none;\n"
"border-radius: 11px;")
self.chat_qwidget_vlayout = QtWidgets.QVBoxLayout(chat_qwidget)
self.chat_qwidget_vlayout.setContentsMargins(10, 10, 10, 10)
self.chat_qwidget_vlayout.setSpacing(0)
self.chat_qwidget_vlayout.setObjectName("chat_qwidget_vlayout")
self.chat_qframe = QtWidgets.QFrame(chat_qwidget)
font = QtGui.QFont()
font.setFamily("Candara")
font.setPointSize(10)
self.chat_qframe.setFont(font)
self.chat_qframe.setStyleSheet("QFrame{\n"
" border:none;\n"
" border-radius: 11px;\n"
" background-color: qlineargradient(spread:pad, x1:0.124, y1:0.0454545, x2:0.711403, y2:0.46, stop:0 rgba(104, 100, 141, 255), stop:0.870647 rgba(57, 55, 77, 255));\n"
"}\n"
"QScrollBar:vertical{\n"
" border: none;\n"
" background-color: rgb(86, 83, 116);\n"
" width: 13px;\n"
" margin: 15px 0px 15px 0px;\n"
"}\n"
"QScrollBar::handle:vertical{\n"
" border: none;\n"
" background: none;\n"
" background-color: rgb(110, 106, 135);\n"
" min-heigth:30px;\n"
" border-radius:0px;\n"
"}\n"
"QScrollBar::handle:vertical:hover{\n"
" background-color: rgb(103, 99, 139);\n"
"}\n"
"QScrollBar::handle:vertical:pressed{\n"
" background-color: rgb(160, 189, 189);\n"
"}\n"
"QScrollBar::sub-line:vertical{\n"
" border:none;\n"
" background-color: rgb(128, 124, 158);\n"
" height: 13px;\n"
" border-top-left-radius: 6px;\n"
" border-top-right-radius: 6px;\n"
" subcontrol-position: top;\n"
" subcontrol-origin: margin;\n"
"}\n"
"QScrollBar::sub-line:vertical:hover {\n"
" background-color: rgb(103, 99, 139);\n"
"}\n"
"QScrollBar::sub-line:vertical:pressed {\n"
" background-color: rgb(160, 189, 189);\n"
"}\n"
"QScrollBar::add-line:vertical{\n"
" border:none;\n"
" background-color: rgb(128, 124, 158);\n"
" height: 13px;\n"
" border-bottom-left-radius: 6px;\n"
" border-bottom-right-radius: 6px;\n"
" subcontrol-position: bottom;\n"
" subcontrol-origin: margin;\n"
"}\n"
"QScrollBar::add-line:vertical:hover {\n"
" background-color: rgb(103, 99, 139);\n"
"}\n"
"QScrollBar::add-line:vertical:pressed {\n"
" background-color: rgb(160, 189, 189);\n"
"}\n"
"QScrollBar::up-arrow:vertical,QScrollBar::down-arrow:vertical{\n"
" background: none;\n"
"}\n"
"QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical{\n"
" background: none; \n"
" background-color: rgb(86, 83, 116);\n"
"}")
self.chat_qframe.setFrameShape(QtWidgets.QFrame.NoFrame)
self.chat_qframe.setFrameShadow(QtWidgets.QFrame.Raised)
self.chat_qframe.setObjectName("chat_qframe")
self.chat_qframe_layout = QtWidgets.QVBoxLayout(self.chat_qframe)
self.chat_qframe_layout.setContentsMargins(0, 0, 0, 0)
self.chat_qframe_layout.setSpacing(0)
self.chat_qframe_layout.setObjectName("chat_qframe_layout")
self.top_frame = QtWidgets.QFrame(self.chat_qframe)
self.top_frame.setMinimumSize(QtCore.QSize(0, 30))
self.top_frame.setMaximumSize(QtCore.QSize(16777215, 30))
font = QtGui.QFont()
font.setFamily("Candara")
font.setPointSize(10)
self.top_frame.setFont(font)
self.top_frame.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0.483, y1:0, x2:0.543, y2:1, stop:0 rgba(255, 255, 255, 25), stop:0.736318 rgba(255, 255, 255, 0));\n"
"border-bottom-right-radius: 0px;\n"
"border-bottom-left-radius: 0px;\n"
"border-top-right-radius: 11px;\n"
"border-top-left-radius: 11px;")
self.top_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.top_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.top_frame.setObjectName("top_frame")
self.top_layout = QtWidgets.QHBoxLayout(self.top_frame)
self.top_layout.setContentsMargins(0, 0, 0, 0)
self.top_layout.setSpacing(0)
self.top_layout.setObjectName("top_layout")
self.title_frame = QtWidgets.QFrame(self.top_frame)
self.title_frame.setStyleSheet("background-color:none;")
self.title_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.title_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.title_frame.setObjectName("title_frame")
self.title_layout = QtWidgets.QHBoxLayout(self.title_frame)
self.title_layout.setContentsMargins(12, 0, 0, 0)
self.title_layout.setObjectName("title_layout")
self.title_lable = QtWidgets.QLabel(self.title_frame)
font = QtGui.QFont()
font.setFamily("Candara")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.title_lable.setFont(font)
self.title_lable.setStyleSheet("background-color:none;\n"
"border-radius: 0px;\n"
"color: rgb(199, 219, 232);")
self.title_lable.setObjectName("title_lable")
self.title_layout.addWidget(self.title_lable)
self.top_layout.addWidget(self.title_frame)
self.button_frame = QtWidgets.QFrame(self.top_frame)
self.button_frame.setMaximumSize(QtCore.QSize(150, 16777215))
self.button_frame.setStyleSheet("background-color: none;")
self.button_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.button_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.button_frame.setObjectName("button_frame")
self.button_layout = QtWidgets.QHBoxLayout(self.button_frame)
self.button_layout.setContentsMargins(0, 2, 10, 0)
self.button_layout.setSpacing(10)
self.button_layout.setObjectName("button_layout")
spacerItem = QtWidgets.QSpacerItem(59, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.button_layout.addItem(spacerItem)
self.minimize_button = QtWidgets.QPushButton(self.button_frame)
self.minimize_button.setMinimumSize(QtCore.QSize(16, 16))
self.minimize_button.setMaximumSize(QtCore.QSize(16, 16))
self.minimize_button.setStyleSheet("QPushButton{\n"
" background-color: rgb(219, 222, 57);\n"
" border-radius: 8px;\n"
"}\n"
"QPushButton:hover{\n"
" background-color: rgb(199, 202, 51);\n"
"}")
self.minimize_button.setText("")
self.minimize_button.setObjectName("minimize_button")
self.button_layout.addWidget(self.minimize_button)
self.window_button = QtWidgets.QPushButton(self.button_frame)
self.window_button.setMinimumSize(QtCore.QSize(16, 16))
self.window_button.setMaximumSize(QtCore.QSize(16, 16))
self.window_button.setStyleSheet("QPushButton{\n"
" background-color: rgb(76, 225, 49);\n"
" border-radius: 8px;\n"
"}\n"
"QPushButton:hover{\n"
" background-color: rgb(72, 205, 45);\n"
" border-radius: 8px;\n"
"}")
self.window_button.setText("")
self.window_button.setObjectName("window_button")
self.button_layout.addWidget(self.window_button)
self.exit_button = QtWidgets.QPushButton(self.button_frame)
self.exit_button.setMinimumSize(QtCore.QSize(16, 16))
self.exit_button.setMaximumSize(QtCore.QSize(16, 16))
self.exit_button.setStyleSheet("QPushButton{\n"
" background-color: rgb(225, 0, 7);\n"
" border-radius: 8px;\n"
"}\n"
"QPushButton:hover{\n"
" background-color: rgb(205, 0, 7);\n"
"}")
self.exit_button.setText("")
self.exit_button.setObjectName("exit_button")
self.button_layout.addWidget(self.exit_button)
self.top_layout.addWidget(self.button_frame)
self.chat_qframe_layout.addWidget(self.top_frame)
self.output_frame = QtWidgets.QFrame(self.chat_qframe)
self.output_frame.setStyleSheet("background-color: none;")
self.output_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.output_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.output_frame.setObjectName("output_frame")
self.output_layout = QtWidgets.QVBoxLayout(self.output_frame)
self.output_layout.setContentsMargins(5, 5, 5, 5)
self.output_layout.setSpacing(0)
self.output_layout.setObjectName("output_layout")
self.output_tbrowser = QtWidgets.QTextBrowser(self.output_frame)
font = QtGui.QFont()
font.setFamily("Calibri Light")
font.setPointSize(11)
self.output_tbrowser.setFont(font)
self.output_tbrowser.setStyleSheet("QTextBrowser{\n"
" background-color: rgb(86, 83, 116 , 200);\n"
" border: 1px solid #000;\n"
" border-color: rgba(0, 0, 0, 50);\n"
" color: rgb(163, 219, 232);\n"
"}")
self.output_tbrowser.setFrameShape(QtWidgets.QFrame.NoFrame)
self.output_tbrowser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.output_tbrowser.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.output_tbrowser.setObjectName("output_tbrowser")
self.output_layout.addWidget(self.output_tbrowser)
self.chat_qframe_layout.addWidget(self.output_frame)
self.input_frame = QtWidgets.QFrame(self.chat_qframe)
self.input_frame.setMinimumSize(QtCore.QSize(0, 105))
self.input_frame.setMaximumSize(QtCore.QSize(16777215, 105))
self.input_frame.setStyleSheet("background-color:none;")
self.input_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.input_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.input_frame.setObjectName("input_frame")
self.input_layout = QtWidgets.QHBoxLayout(self.input_frame)
self.input_layout.setContentsMargins(5, 5, 5, 5)
self.input_layout.setSpacing(5)
self.input_layout.setObjectName("input_layout")
self.input_tedit = QtWidgets.QTextEdit(self.input_frame)
self.input_tedit.setMinimumSize(QtCore.QSize(0, 95))
self.input_tedit.setMaximumSize(QtCore.QSize(16777215, 95))
font = QtGui.QFont()
font.setFamily("Calibri Light")
font.setPointSize(10)
self.input_tedit.setFont(font)
self.input_tedit.setStyleSheet("QTextEdit{\n"
" border: 1px solid #000;\n"
" border-color: rgba(0, 0, 0, 50);\n"
" border-radius: 6px;\n"
" background-color: rgb(93, 90, 126);\n"
" background-color: rgb(86, 83, 116);\n"
" color: rgb(163, 219, 232);\n"
"}")
self.input_tedit.setFrameShape(QtWidgets.QFrame.NoFrame)
self.input_tedit.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.input_tedit.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.input_tedit.setObjectName("input_tedit")
self.input_layout.addWidget(self.input_tedit)
self.input_send_pbutton = QtWidgets.QPushButton(self.input_frame)
self.input_send_pbutton.setMinimumSize(QtCore.QSize(90, 90))
font = QtGui.QFont()
font.setFamily("Calibri")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.input_send_pbutton.setFont(font)
self.input_send_pbutton.setStyleSheet("QPushButton{\n"
" background-color: rgb(92, 100, 111);\n"
" background-color: rgb(86, 83, 116);\n"
" color: rgb(199, 219, 232);\n"
"}\n"
"QPushButton:hover{\n"
" background-color: rgb(74, 71, 100);\n"
"}\n"
"QPushButton:pressed{\n"
" \n"
" color: rgb(84, 92, 108);\n"
" background-color: rgb(70, 77, 81);\n"
" background-color: rgb(160, 189, 189);\n"
"}")
self.input_send_pbutton.setObjectName("input_send_pbutton")
self.input_layout.addWidget(self.input_send_pbutton)
self.chat_qframe_layout.addWidget(self.input_frame)
self.bottom_frame = QtWidgets.QFrame(self.chat_qframe)
self.bottom_frame.setMinimumSize(QtCore.QSize(0, 25))
self.bottom_frame.setMaximumSize(QtCore.QSize(16777215, 25))
font = QtGui.QFont()
font.setFamily("Candara")
font.setPointSize(10)
self.bottom_frame.setFont(font)
self.bottom_frame.setStyleSheet("background-color: rgb(112, 108, 147,50);\n"
"border-bottom-right-radius: 11px;\n"
"border-bottom-left-radius: 11px;\n"
"border-top-right-radius: 0px;\n"
"border-top-left-radius: 0px;")
self.bottom_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.bottom_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.bottom_frame.setObjectName("bottom_frame")
self.bottom_hlayout = QtWidgets.QHBoxLayout(self.bottom_frame)
self.bottom_hlayout.setContentsMargins(0, 0, 0, 0)
self.bottom_hlayout.setSpacing(0)
self.bottom_hlayout.setObjectName("bottom_hlayout")
self.credit_frame = QtWidgets.QFrame(self.bottom_frame)
self.credit_frame.setStyleSheet("background-color: none;\n"
"border-top-right-radius: 0px;\n"
"border-bottom-right-radius: 0px;")
self.credit_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.credit_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.credit_frame.setObjectName("credit_frame")
self.bottom_hlayout.addWidget(self.credit_frame)
self.grip_frame = QtWidgets.QFrame(self.bottom_frame)
self.grip_frame.setMaximumSize(QtCore.QSize(30, 16777215))
self.grip_frame.setStyleSheet("QFrame{\n"
"background-color: none;\n"
"border-top-left-radius: 0px;\n"
"border-top-right-radius: 0px;\n"
"border-bottom-left-radius: 0px;\n"
"}\n"
"QFrame:hover{\n"
" background-color: rgba(199, 219, 232, 25);\n"
"}")
self.grip_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.grip_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.grip_frame.setObjectName("grip_frame")
self.bottom_hlayout.addWidget(self.grip_frame)
self.chat_qframe_layout.addWidget(self.bottom_frame)
self.chat_qwidget_vlayout.addWidget(self.chat_qframe)
self.retranslateUi(chat_qwidget)
QtCore.QMetaObject.connectSlotsByName(chat_qwidget)
def retranslateUi(self, chat_qwidget):
_translate = QtCore.QCoreApplication.translate
chat_qwidget.setWindowTitle(_translate("chat_qwidget", "Form"))
self.title_lable.setText(_translate("chat_qwidget", "Title"))
self.input_send_pbutton.setText(_translate("chat_qwidget", "Send"))