mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
update showMessage
This commit is contained in:
@ -17,7 +17,7 @@ SessionFriendArea::SessionFriendArea(QWidget *parent)
|
||||
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
this->verticalScrollBar()->setStyleSheet(R"(
|
||||
QScrollBar:vertical {
|
||||
background-color: rgb(231, 231, 231); /* 滚动条背景透明 */
|
||||
background-color: rgb(228, 228, 228); /* 滚动条背景透明 */
|
||||
width: 6px; /* 默认宽度 */
|
||||
margin: 0px 0px 0px 0px; /* 边距清零 */
|
||||
}
|
||||
@ -84,7 +84,7 @@ SessionFriendItem::SessionFriendItem(QWidget* owner, const QIcon& avatar, const
|
||||
{
|
||||
this->setFixedHeight(70);
|
||||
|
||||
this->setStyleSheet("QWidget { background-color: rgb(231, 231, 231); }");
|
||||
this->setStyleSheet("QWidget { background-color: rgb(228, 228, 228); }");
|
||||
|
||||
|
||||
//创建网格布局管理器
|
||||
@ -122,8 +122,8 @@ SessionFriendItem::SessionFriendItem(QWidget* owner, const QIcon& avatar, const
|
||||
|
||||
//添加到网格布局
|
||||
layout->addWidget(avatarBtn, 0, 0, 2, 2);
|
||||
layout->addWidget(nameLabel, 0, 2, 1, 8);
|
||||
layout->addWidget(messageLabel, 1, 2, 1, 8);
|
||||
layout->addWidget(nameLabel, 0, 2, 1, 25);
|
||||
layout->addWidget(messageLabel, 1, 2, 1, 25);
|
||||
}
|
||||
|
||||
void SessionFriendItem::paintEvent(QPaintEvent *event)
|
||||
@ -150,7 +150,7 @@ void SessionFriendItem::enterEvent(QEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
this->setStyleSheet("QWidget { background-color: rgb(220, 220, 220); }");
|
||||
this->setStyleSheet("QWidget { background-color: rgb(215, 215, 215); }");
|
||||
}
|
||||
|
||||
void SessionFriendItem::leaveEvent(QEvent *event)
|
||||
@ -161,7 +161,7 @@ void SessionFriendItem::leaveEvent(QEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
this->setStyleSheet("QWidget { background-color: rgb(231, 231, 231); }");
|
||||
this->setStyleSheet("QWidget { background-color: rgb(228, 228, 228); }");
|
||||
}
|
||||
|
||||
void SessionFriendItem::select()
|
||||
@ -176,12 +176,12 @@ void SessionFriendItem::select()
|
||||
SessionFriendItem* item = dynamic_cast<SessionFriendItem*>(child);
|
||||
if(item->selected) {
|
||||
item->selected = false;
|
||||
item->setStyleSheet("QWidget { background-color: rgb(231, 231, 231); }");
|
||||
item->setStyleSheet("QWidget { background-color: rgb(228, 228, 228); }");
|
||||
}
|
||||
}
|
||||
//鼠标点击时会触发这个事件
|
||||
//点击时修改背景色
|
||||
this->setStyleSheet("QWidget { background-color: rgb(210, 210, 210); }");
|
||||
this->setStyleSheet("QWidget { background-color: rgb(196, 196, 196); }");
|
||||
this->selected = true;
|
||||
|
||||
//调用Active
|
||||
|
||||
Reference in New Issue
Block a user