fix: 解决任务栏应用tips弹窗边距异常问题

根据设计师要求将控件左右间距修改为10

Log: 任务栏应用tips弹窗左右间距修改为10
Bug: https://pms.uniontech.com/zentao/bug-view-61164.html
Change-Id: I6353058b02c9e98cdf9f2a597713008a3aadb4f1
This commit is contained in:
chenwei 2021-01-22 09:35:39 +08:00
parent b6503312cc
commit 02a1129b0b

View File

@ -21,7 +21,7 @@ void TipsWidget::setText(const QString &text)
// 同时去掉两边的空白信息例如qBittorrent的提示 // 同时去掉两边的空白信息例如qBittorrent的提示
m_text = document.toPlainText().simplified(); m_text = document.toPlainText().simplified();
setFixedSize(fontMetrics().width(m_text) + 6, fontMetrics().height()); setFixedSize(fontMetrics().width(m_text) + 20, fontMetrics().height());
update(); update();
@ -42,7 +42,7 @@ void TipsWidget::setTextList(const QStringList &textList)
int k = fontMetrics().height() * m_textList.size(); int k = fontMetrics().height() * m_textList.size();
setFixedHeight(k); setFixedHeight(k);
for (QString text : m_textList) { for (QString text : m_textList) {
int fontLength = fontMetrics().width(text) + 6; int fontLength = fontMetrics().width(text) + 20;
maxLength = maxLength > fontLength ? maxLength : fontLength; maxLength = maxLength > fontLength ? maxLength : fontLength;
} }
m_width = maxLength; m_width = maxLength;