|
|
@@ -30,8 +30,14 @@ void MeetingSelectionWidget::setupUI()
|
|
|
{
|
|
|
// 主布局
|
|
|
m_mainLayout = new QVBoxLayout(this);
|
|
|
- m_mainLayout->setContentsMargins(50, 50, 50, 50);
|
|
|
- m_mainLayout->setSpacing(30);
|
|
|
+ m_mainLayout->setContentsMargins(40, 35, 40, 35);
|
|
|
+ m_mainLayout->setSpacing(25);
|
|
|
+
|
|
|
+ // 标题区域
|
|
|
+ QWidget *headerWidget = new QWidget(this);
|
|
|
+ QVBoxLayout *headerLayout = new QVBoxLayout(headerWidget);
|
|
|
+ headerLayout->setContentsMargins(0, 0, 0, 20);
|
|
|
+ headerLayout->setSpacing(8);
|
|
|
|
|
|
// 标题
|
|
|
m_titleLabel = new QLabel("智能学习客户端", this);
|
|
|
@@ -42,28 +48,59 @@ void MeetingSelectionWidget::setupUI()
|
|
|
m_welcomeLabel = new QLabel("欢迎使用!请选择您要进行的操作:", this);
|
|
|
m_welcomeLabel->setAlignment(Qt::AlignCenter);
|
|
|
m_welcomeLabel->setObjectName("welcomeLabel");
|
|
|
+
|
|
|
+ headerLayout->addWidget(m_titleLabel);
|
|
|
+ headerLayout->addWidget(m_welcomeLabel);
|
|
|
+
|
|
|
+ // 创建信息卡片区域容器
|
|
|
+ QWidget *cardsContainer = new QWidget(this);
|
|
|
+ QHBoxLayout *cardsLayout = new QHBoxLayout(cardsContainer);
|
|
|
+ cardsLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
+ cardsLayout->setSpacing(20);
|
|
|
+
|
|
|
+ // 创建用户信息卡片容器
|
|
|
+ QFrame *userCardFrame = new QFrame(this);
|
|
|
+ userCardFrame->setObjectName("userCardFrame");
|
|
|
+ QVBoxLayout *userCardLayout = new QVBoxLayout(userCardFrame);
|
|
|
+ userCardLayout->setContentsMargins(30, 25, 30, 25);
|
|
|
+ userCardLayout->setSpacing(0);
|
|
|
|
|
|
// 用户资料卡片(复用现有组件)
|
|
|
m_userProfile = new UserProfileWidget(this);
|
|
|
+ m_userProfile->setObjectName("userProfileCard");
|
|
|
+ userCardLayout->addWidget(m_userProfile);
|
|
|
+
|
|
|
+ // 创建统计信息卡片容器
|
|
|
+ QFrame *statsCardFrame = new QFrame(this);
|
|
|
+ statsCardFrame->setObjectName("statsCardFrame");
|
|
|
+ QVBoxLayout *statsCardLayout = new QVBoxLayout(statsCardFrame);
|
|
|
+ statsCardLayout->setContentsMargins(30, 25, 30, 25);
|
|
|
+ statsCardLayout->setSpacing(0);
|
|
|
|
|
|
// 消息统计(临时迁移到此)
|
|
|
m_statsWidget = new StatsWidget(this);
|
|
|
+ m_statsWidget->setObjectName("statsWidgetCard");
|
|
|
+ statsCardLayout->addWidget(m_statsWidget);
|
|
|
+
|
|
|
+ // 将卡片添加到水平布局
|
|
|
+ cardsLayout->addWidget(userCardFrame);
|
|
|
+ cardsLayout->addWidget(statsCardFrame);
|
|
|
|
|
|
// 按钮容器
|
|
|
m_buttonFrame = new QFrame(this);
|
|
|
m_buttonFrame->setObjectName("buttonFrame");
|
|
|
m_buttonLayout = new QVBoxLayout(m_buttonFrame);
|
|
|
- m_buttonLayout->setContentsMargins(20, 20, 20, 20);
|
|
|
- m_buttonLayout->setSpacing(20);
|
|
|
+ m_buttonLayout->setContentsMargins(30, 30, 30, 30);
|
|
|
+ m_buttonLayout->setSpacing(18);
|
|
|
|
|
|
// 加入会议按钮
|
|
|
- m_joinMeetingBtn = new QPushButton("加入会议", this);
|
|
|
+ m_joinMeetingBtn = new QPushButton("🚀 加入会议", this);
|
|
|
m_joinMeetingBtn->setObjectName("joinMeetingBtn");
|
|
|
m_joinMeetingBtn->setMinimumHeight(60);
|
|
|
connect(m_joinMeetingBtn, &QPushButton::clicked, this, &MeetingSelectionWidget::onJoinMeetingClicked);
|
|
|
|
|
|
// 创建会议按钮
|
|
|
- m_createMeetingBtn = new QPushButton("创建会议", this);
|
|
|
+ m_createMeetingBtn = new QPushButton("✨ 创建会议", this);
|
|
|
m_createMeetingBtn->setObjectName("createMeetingBtn");
|
|
|
m_createMeetingBtn->setMinimumHeight(60);
|
|
|
connect(m_createMeetingBtn, &QPushButton::clicked, this, &MeetingSelectionWidget::onCreateMeetingClicked);
|
|
|
@@ -71,7 +108,7 @@ void MeetingSelectionWidget::setupUI()
|
|
|
// 退出登录按钮
|
|
|
m_logoutBtn = new QPushButton("退出登录", this);
|
|
|
m_logoutBtn->setObjectName("logoutBtn");
|
|
|
- m_logoutBtn->setMinimumHeight(40);
|
|
|
+ m_logoutBtn->setMinimumHeight(45);
|
|
|
connect(m_logoutBtn, &QPushButton::clicked, this, &MeetingSelectionWidget::onLogoutClicked);
|
|
|
|
|
|
// 添加按钮到布局
|
|
|
@@ -81,17 +118,18 @@ void MeetingSelectionWidget::setupUI()
|
|
|
m_buttonLayout->addWidget(m_logoutBtn);
|
|
|
|
|
|
// 添加到主布局
|
|
|
- m_mainLayout->addStretch();
|
|
|
- m_mainLayout->addWidget(m_titleLabel);
|
|
|
- m_mainLayout->addWidget(m_welcomeLabel);
|
|
|
- m_mainLayout->addWidget(m_userProfile, 0, Qt::AlignCenter);
|
|
|
- m_mainLayout->addWidget(m_statsWidget, 0, Qt::AlignCenter); // 新增:消息统计
|
|
|
- m_mainLayout->addStretch();
|
|
|
+ m_mainLayout->addWidget(headerWidget);
|
|
|
+ m_mainLayout->addSpacing(10);
|
|
|
+ m_mainLayout->addWidget(cardsContainer, 0, Qt::AlignCenter);
|
|
|
+ m_mainLayout->addSpacing(25);
|
|
|
m_mainLayout->addWidget(m_buttonFrame, 0, Qt::AlignCenter);
|
|
|
m_mainLayout->addStretch();
|
|
|
|
|
|
- // 设置按钮框架的固定宽度
|
|
|
- m_buttonFrame->setFixedWidth(300);
|
|
|
+ // 设置容器的固定宽度
|
|
|
+ userCardFrame->setFixedWidth(280);
|
|
|
+ statsCardFrame->setFixedWidth(280);
|
|
|
+ m_buttonFrame->setFixedWidth(380);
|
|
|
+ cardsContainer->setFixedWidth(580);
|
|
|
}
|
|
|
|
|
|
void MeetingSelectionWidget::setUserRoles(const QStringList &roles)
|
|
|
@@ -156,79 +194,120 @@ void MeetingSelectionWidget::applyStyles()
|
|
|
{
|
|
|
// 设置整体样式
|
|
|
setStyleSheet("MeetingSelectionWidget {"
|
|
|
- " background-color: #f5f5f5;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #f8f9fa, stop:1 #e9ecef);"
|
|
|
"}"
|
|
|
|
|
|
"#titleLabel {"
|
|
|
- " font-size: 28px;"
|
|
|
+ " font-size: 32px;"
|
|
|
" font-weight: bold;"
|
|
|
" color: #2c3e50;"
|
|
|
- " margin-bottom: 10px;"
|
|
|
+ " margin-bottom: 5px;"
|
|
|
"}"
|
|
|
|
|
|
"#welcomeLabel {"
|
|
|
" font-size: 16px;"
|
|
|
- " color: #7f8c8d;"
|
|
|
- " margin-bottom: 10px;"
|
|
|
+ " color: #6c757d;"
|
|
|
+ " margin-bottom: 5px;"
|
|
|
+ "}"
|
|
|
+
|
|
|
+ "#userCardFrame {"
|
|
|
+ " background-color: white;"
|
|
|
+ " border: none;"
|
|
|
+ " border-radius: 15px;"
|
|
|
+ " margin: 5px;"
|
|
|
+ " box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);"
|
|
|
+ "}"
|
|
|
+
|
|
|
+ "#statsCardFrame {"
|
|
|
+ " background-color: white;"
|
|
|
+ " border: none;"
|
|
|
+ " border-radius: 15px;"
|
|
|
+ " margin: 5px;"
|
|
|
+ " box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);"
|
|
|
+ "}"
|
|
|
+
|
|
|
+ "#userProfileCard {"
|
|
|
+ " background-color: transparent;"
|
|
|
+ " border: none;"
|
|
|
+ "}"
|
|
|
+
|
|
|
+ "#statsWidgetCard {"
|
|
|
+ " background-color: transparent;"
|
|
|
+ " border: none;"
|
|
|
"}"
|
|
|
|
|
|
"#buttonFrame {"
|
|
|
" background-color: white;"
|
|
|
- " border: 1px solid #e0e0e0;"
|
|
|
- " border-radius: 10px;"
|
|
|
+ " border: none;"
|
|
|
+ " border-radius: 15px;"
|
|
|
+ " box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);"
|
|
|
"}"
|
|
|
|
|
|
"#joinMeetingBtn {"
|
|
|
- " background-color: #3498db;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #4fc3f7, stop:1 #29b6f6);"
|
|
|
" color: white;"
|
|
|
" border: none;"
|
|
|
- " border-radius: 8px;"
|
|
|
+ " border-radius: 12px;"
|
|
|
" font-size: 16px;"
|
|
|
" font-weight: bold;"
|
|
|
" padding: 15px;"
|
|
|
"}"
|
|
|
|
|
|
"#joinMeetingBtn:hover {"
|
|
|
- " background-color: #2980b9;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #29b6f6, stop:1 #0288d1);"
|
|
|
+ " transform: translateY(-2px);"
|
|
|
"}"
|
|
|
|
|
|
"#joinMeetingBtn:pressed {"
|
|
|
- " background-color: #21618c;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #0288d1, stop:1 #0277bd);"
|
|
|
+ " transform: translateY(0px);"
|
|
|
"}"
|
|
|
|
|
|
"#createMeetingBtn {"
|
|
|
- " background-color: #27ae60;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #81c784, stop:1 #66bb6a);"
|
|
|
" color: white;"
|
|
|
" border: none;"
|
|
|
- " border-radius: 8px;"
|
|
|
+ " border-radius: 12px;"
|
|
|
" font-size: 16px;"
|
|
|
" font-weight: bold;"
|
|
|
" padding: 15px;"
|
|
|
"}"
|
|
|
|
|
|
"#createMeetingBtn:hover {"
|
|
|
- " background-color: #229954;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #66bb6a, stop:1 #4caf50);"
|
|
|
+ " transform: translateY(-2px);"
|
|
|
"}"
|
|
|
|
|
|
"#createMeetingBtn:pressed {"
|
|
|
- " background-color: #1e8449;"
|
|
|
+ " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
|
|
+ " stop:0 #4caf50, stop:1 #43a047);"
|
|
|
+ " transform: translateY(0px);"
|
|
|
"}"
|
|
|
|
|
|
"#logoutBtn {"
|
|
|
- " background-color: #e74c3c;"
|
|
|
- " color: white;"
|
|
|
- " border: none;"
|
|
|
- " border-radius: 6px;"
|
|
|
+ " background-color: #f8f9fa;"
|
|
|
+ " color: #6c757d;"
|
|
|
+ " border: 1px solid #dee2e6;"
|
|
|
+ " border-radius: 8px;"
|
|
|
" font-size: 14px;"
|
|
|
" padding: 10px;"
|
|
|
"}"
|
|
|
|
|
|
"#logoutBtn:hover {"
|
|
|
- " background-color: #c0392b;"
|
|
|
+ " background-color: #e9ecef;"
|
|
|
+ " color: #495057;"
|
|
|
+ " border-color: #adb5bd;"
|
|
|
"}"
|
|
|
|
|
|
"#logoutBtn:pressed {"
|
|
|
- " background-color: #a93226;"
|
|
|
+ " background-color: #dee2e6;"
|
|
|
+ " color: #343a40;"
|
|
|
"}");
|
|
|
}
|
|
|
|