mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix(bluetooth): 字体大小改变任务栏tips内容显示不全
字体大小变换后,需要同步更新布局 Log: 增加字体大小变换后,同步布局 Bug: https://pms.uniontech.com/zentao/bug-view-35000.html
This commit is contained in:
parent
6d88feebc2
commit
72669890c0
@ -78,3 +78,15 @@ void TipsWidget::paintEvent(QPaintEvent *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TipsWidget::event(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::FontChange) {
|
||||
if (!m_text.trimmed().isEmpty()) {
|
||||
setFixedSize(fontMetrics().width(m_text) + 6, fontMetrics().height());
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
return QFrame::event(event);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ public:
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QString m_text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user