mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 时间插件返回大小错误
在切换任务栏位置时时间插件返回的大小有问题。 Log: 修复时间插件显示不完整的问题。 Change-Id: I84c3004728f725fc81e6c46ee1f6817c778fa589
This commit is contained in:
parent
5a0049ff62
commit
a9f403fbee
@ -135,7 +135,7 @@ QSize DatetimeWidget::curTimeSize() const
|
||||
dateSize.setWidth(QFontMetrics(m_dateFont).boundingRect("0000/00/00").size().width());
|
||||
}
|
||||
}
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()) + 2, height());
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()), timeSize.height() + dateSize.height());
|
||||
} else {
|
||||
while (std::max(QFontMetrics(m_timeFont).boundingRect(timeString).size().width(), QFontMetrics(m_dateFont).boundingRect("0000/00/00").size().width()) > (width() - 4)) {
|
||||
m_timeFont.setPixelSize(m_timeFont.pixelSize() - 1);
|
||||
@ -150,7 +150,7 @@ QSize DatetimeWidget::curTimeSize() const
|
||||
}
|
||||
}
|
||||
m_timeOffset = (timeSize.height() - dateSize.height()) / 2 ;
|
||||
return QSize(width(), timeSize.height() + dateSize.height());
|
||||
return QSize(std::max(timeSize.width(), dateSize.width()), timeSize.height() + dateSize.height());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user