18 QVBoxLayout *layout =
new QVBoxLayout(
this);
19 layout->setContentsMargins(10, 0, 10, 0);
20 layout->addSpacing(2);
22 QWidget *centerWidget =
new QWidget(
this);
23 QHBoxLayout *centerWidgetLayout =
new QHBoxLayout(centerWidget);
24 centerWidgetLayout->setContentsMargins(0, 0, 0, 0);
26 QWidget *textWidget =
new QWidget(centerWidget);
27 QVBoxLayout *textWidgetLayout =
new QVBoxLayout(textWidget);
28 textWidgetLayout->setContentsMargins(0, 5, 0, 6);
29 textWidgetLayout->setSpacing(0);
31 QWidget *userWidget =
new QWidget(textWidget);
32 QHBoxLayout *userWidgetLayout =
new QHBoxLayout(userWidget);
33 userWidgetLayout->setContentsMargins(0, 0, 0, 0);
34 userWidgetLayout->setSpacing(2);
39 m_userCommit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
46 userWidget->setLayout(userWidgetLayout);
48 QWidget *operWidget =
new QWidget(textWidget);
49 QHBoxLayout *operWidgetLayout =
new QHBoxLayout(operWidget);
50 operWidgetLayout->setContentsMargins(0, 0, 0, 0);
51 operWidgetLayout->setSpacing(4);
59 QFrame *spliteLine1 =
new QFrame(operWidget);
60 spliteLine1->setFixedWidth(1);
61 spliteLine1->setFrameShape(QFrame::VLine);
64 QPushButton *starButton =
new QPushButton(operWidget);
65 starButton->setCursor(QCursor(Qt::PointingHandCursor));
66 starButton->setFixedSize(12, 11);
73 QFrame *spliteLine2 =
new QFrame(operWidget);
74 spliteLine2->setFixedWidth(1);
75 spliteLine2->setFrameShape(QFrame::VLine);
81 starButton->setFocusPolicy(Qt::NoFocus);
85 operWidgetLayout->addStretch(1);
86 operWidgetLayout->addWidget(ngReportLabel);
87 operWidgetLayout->addWidget(spliteLine1);
88 operWidgetLayout->addWidget(starButton);
90 operWidgetLayout->addWidget(spliteLine2);
91 operWidgetLayout->addWidget(ReplyLabel);
92 operWidget->setLayout(operWidgetLayout);
94 textWidgetLayout->addWidget(userWidget);
95 textWidgetLayout->addWidget(operWidget);
96 textWidget->setLayout(textWidgetLayout);
102 centerWidgetLayout->addWidget(textWidget);
103 centerWidget->setLayout(centerWidgetLayout);
105 QFrame *solidLine =
new QFrame(
this);
106 solidLine->setFixedHeight(1);
109 layout->addWidget(centerWidget);
110 layout->addWidget(solidLine);
133 connect(d, SIGNAL(downLoadRawDataChanged(QByteArray)), SLOT(
downLoadFinished(QByteArray)));
146 pix.loadFromData(bytes);
155 m_messageEdit(nullptr),
157 m_commentsLabel(nullptr),
158 m_messageComments(nullptr),
159 m_pageQueryWidget(nullptr),
160 m_networkRequest(nullptr)
180 setObjectName(className());
183 QVBoxLayout *mainLayout =
new QVBoxLayout(
this);
184 mainLayout->setContentsMargins(0, 0, 0, 0);
185 mainLayout->setSpacing(0);
187 QWidget *topWidget =
nullptr;
190 topWidget =
new QWidget(
this);
191 topWidget->setFixedHeight(40);
192 QHBoxLayout *topWidgetLayout =
new QHBoxLayout(topWidget);
193 topWidgetLayout->setContentsMargins(0, 0, 10, 0);
199 QPushButton *closeButton =
new QPushButton(
this);
200 closeButton->setFixedSize(14, 14);
202 closeButton->setCursor(QCursor(Qt::PointingHandCursor));
204 closeButton->setFocusPolicy(Qt::NoFocus);
206 connect(closeButton, SIGNAL(clicked()), SLOT(close()));
208 topWidgetLayout->addWidget(closeButton);
209 topWidget->setLayout(topWidgetLayout);
217 QWidget *contentsWidget =
new QWidget(
this);
218 QVBoxLayout *contentsLayout =
new QVBoxLayout(contentsWidget);
219 contentsLayout->setContentsMargins(0, 0, 0 ,0);
220 contentsLayout->setSpacing(0);
222 QWidget *messageBox =
new QWidget(contentsWidget);
223 messageBox->setFixedHeight(150);
224 QVBoxLayout *messageBoxLayout =
new QVBoxLayout(messageBox);
225 messageBoxLayout->setContentsMargins(10, 10, 10, 3);
226 messageBox->setAttribute(Qt::WA_TranslucentBackground,
false);
232 messageBox->setAttribute(Qt::WA_TranslucentBackground,
true);
235 QFrame *solidLine =
new QFrame(contentsWidget);
236 solidLine->setFrameShape(QFrame::HLine);
237 solidLine->setFixedHeight(1);
240 QWidget *messageMiddle =
new QWidget(messageBox);
241 QHBoxLayout *messageMiddleLayout =
new QHBoxLayout(messageMiddle);
242 messageMiddleLayout->setContentsMargins(0, 10, 0, 0);
243 QPushButton *emojiButton =
new QPushButton(messageMiddle);
244 QPushButton *sendButton =
new QPushButton(tr(
"Send"), messageMiddle);
245 emojiButton->setIcon(QIcon(
":/lrc/lb_emoji"));
246 emojiButton->setCursor(QCursor(Qt::PointingHandCursor));
249 sendButton->setFixedSize(65, 25);
250 sendButton->setCursor(QCursor(Qt::PointingHandCursor));
252 messageMiddleLayout->addWidget(emojiButton);
253 messageMiddleLayout->addStretch(1);
254 messageMiddleLayout->addWidget(sendButton);
255 messageMiddle->setLayout(messageMiddleLayout);
257 emojiButton->setFocusPolicy(Qt::NoFocus);
258 sendButton->setFocusPolicy(Qt::NoFocus);
262 messageBoxLayout->addWidget(messageMiddle);
264 messageBoxLayout->addWidget(solidLine);
265 messageBox->setLayout(messageBoxLayout);
269 messageCommentsLayout->setContentsMargins(0, 0, 0, 0);
272 contentsLayout->addWidget(messageBox);
274 contentsWidget->setLayout(contentsLayout);
278 QScrollArea *scrollArea =
new QScrollArea(
this);
281 contentsWidget->setObjectName(
"ContentsWidget");
283 QWidget *view = scrollArea->viewport();
284 view->setObjectName(
"Viewport");
287 mainLayout->addWidget(topWidget);
288 mainLayout->addWidget(scrollArea);
292 mainLayout->addWidget(contentsWidget);
295 setLayout(mainLayout);
305 connect(
m_networkRequest, SIGNAL(downLoadDataChanged(QString)), &loop, SLOT(quit()));
322 layout->insertWidget(layout->count() - 1, comment);
326 setFixedHeight(height() + comment->height());
368 m_topLabel->setText(tr(
"<span style='font-size:15pt;color:#AAAAAA;font-style:bold;'>\"%1\" Commit</span>"
369 "<span style='font-size:11pt;color:#666666;font-style:bold;'> (Just %2 Commits)</span>").arg(name).arg(total));
The class of the search result data item.
static const QString BorderStyle01
border
#define TTK_DATE_TIMEZ_FORMAT
int pageTotalSize() const noexcept
virtual void startToRequest(const QString &url)=0
static constexpr const char * BtnPClose
static const QString ColorStyle04
int exec(ProcessEventsFlags flags=AllEvents)
static const QString BorderStyle05
The class of the label widget that can click.
static const QString ScrollBarStyle01
ScrollBar.
static const QString PushButtonStyle03
static constexpr const char * InteriorStar
static const QString BackgroundStyle01
Background.
The class of the page query widget.
virtual void startToPage(int offset)
void page(int index, int total)
static const QString ColorStyle03
QWidget * createPageWidget(QWidget *parent, int total)
static const QString BackgroundStyle07
static const QString BorderStyle02
#define G_DOWNLOAD_QUERY_PTR
The class of the cover data download request.
static QString format(const QString &time, const QString &format)
#define TTK_ERROR_STREAM(msg)
The class of the semaphore event loop.
int totalSize() const noexcept
#define TTKObjectCast(x, y)