promote ui

This commit is contained in:
xyz
2025-05-25 19:09:54 +08:00
parent ef7f85e68b
commit 4dcec01d67
9 changed files with 264 additions and 8 deletions

View File

@ -61,7 +61,7 @@ void MainWidget::initMainWindow()
windowLeft->setFixedWidth(70);
windowMid->setFixedWidth(310);
windowMid->setFixedWidth(820);
windowRight->setMinimumWidth(900);
windowLeft->setStyleSheet("QWidget { background-color: rgb(46, 46, 46); }");
@ -163,7 +163,57 @@ void MainWidget::initMidWindow()
void MainWidget::initRightWindow()
{
//创建右侧窗口的布局管理器
QVBoxLayout* vlayout = new QVBoxLayout();
vlayout->setSpacing(0);
vlayout->setContentsMargins(0, 0, 0, 0);
vlayout->setAlignment(Qt::AlignTop);
windowRight->setLayout(vlayout);
//创建上方的标题栏
QWidget* titleWidget = new QWidget();
titleWidget->setFixedHeight(62);
titleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
titleWidget->setObjectName("titleWidget");
titleWidget->setStyleSheet(R"(#titleWidget { border-bottom: 1px solid rgb(230, 230, 230);
border-left: 1px solid rgb(230, 230, 230); }
)");
vlayout->addWidget(titleWidget);
//给标题栏添加 label 和 button
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setSpacing(0);
hlayout->setContentsMargins(10, 0, 10, 0);
titleWidget->setLayout(hlayout);
QLabel* sessionTitleLabel = new QLabel();
sessionTitleLabel->setStyleSheet("QLabel { font-size: 22px; border-bottom: 1px solid rgb(230, 230, 230); }");
#if TEST_UI
//为了测试仅填充从服务器获取的数据
sessionTitleLabel->setText("TEST TITLE");
#endif
hlayout->addWidget(sessionTitleLabel);
QPushButton* extraBtn = new QPushButton();
extraBtn->setFixedSize(30, 30);
extraBtn->setIconSize(QSize(30, 30));
extraBtn->setIcon(QIcon(":/resource/image/more.png"));
extraBtn->setStyleSheet(R"(QPushButton { border: none; background-color: transparent; }
QPushButton:pressed { background-color: rgb(210, 210 ,210); }
)");
hlayout->addWidget(extraBtn);
//添加消息展示区
messageShowArea = new MessageShowArea();
vlayout->addWidget(messageShowArea);
//添加消息编辑区
messageEditArea = new MessageEditArea();
//确保消息编辑区处于窗口正下方
vlayout->addWidget(messageEditArea, 0, Qt::AlignBottom);
}
void MainWidget::initSignalSlot()