Skip to content

Commit

Permalink
fix: 修复字体字号为20的时候锁屏界面切换用户列表文字被遮挡的问题
Browse files Browse the repository at this point in the history
监听字体字号改变信号,实时更新列表宽度

Log:
Bug: linuxdeepin/developer-center#8873
Influence: 切换用户列表文字展示
  • Loading branch information
ut003441 committed Jun 14, 2024
1 parent beba7b8 commit d962b2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/widgets/useritemdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ void UserItemDelegate::drawNameAndType(QPainter *painter, const UserItemData &us
// 绘制userType, +1个像素为了避免字体大小不一样,绘制中心位置不一致
int userTypeLeft = userData.name.isEmpty() ? displayNameRect.left() : displayNameRect.left() + nameWidth + itemSpacing;
QRect userTypeRect = QRect(userTypeLeft, displayNameRect.bottom() + LABEL_SPACE + 1, userTypeAreaWidth + 1, userTypeHeight());
painter->setOpacity(0.7);
painter->drawText(userTypeRect, userData.userStrType, qTextOption);
painter->setOpacity(1);
}

void UserItemDelegate::drawCheckedState(QPainter *painter, const QRect &rect) const
Expand Down

0 comments on commit d962b2b

Please sign in to comment.