mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 解决时间插件显示不全问题
curTimeSize()接口计算的时间控件大小和实际绘制出来的大小不一致,当字体大小调整后重新计算任务栏下各控件的实际大小,可解决当前显示不全问题. Log: 修复时间插件显示不全问题 Bug: https://pms.uniontech.com/zentao/bug-view-90894.html Change-Id: I2fb9062e985403105f3835646b884838384b970b
This commit is contained in:
parent
54bbb1b0bb
commit
cc88ed7135
@ -176,6 +176,14 @@ QSize DatetimeWidget::sizeHint() const
|
||||
return curTimeSize();
|
||||
}
|
||||
|
||||
void DatetimeWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
if (isVisible())
|
||||
emit requestUpdateGeometry();
|
||||
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DatetimeWidget::paintEvent 绘制任务栏时间日期
|
||||
* @param e
|
||||
|
@ -38,6 +38,10 @@ public:
|
||||
bool is24HourFormat() const { return m_24HourFormat; }
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
|
||||
signals:
|
||||
void requestUpdateGeometry() const;
|
||||
|
||||
@ -49,7 +53,6 @@ private Q_SLOTS:
|
||||
void setShortTimeFormat(int type);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
QSize curTimeSize() const;
|
||||
|
||||
private:
|
||||
@ -60,7 +63,6 @@ private:
|
||||
Timedate *m_timedateInter;
|
||||
QString m_shortDateFormat;
|
||||
QString m_shortTimeFormat;
|
||||
|
||||
};
|
||||
|
||||
#endif // DATETIMEWIDGET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user