mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00

完成插件区域的引用图标加载、快捷设置的展示、老插件的加载等功能 Log: 完成特效模式下右侧插件区域的功能 Influence: v23任务栏右侧插件区域 Task: https://pms.uniontech.com/task-view-110311.html Change-Id: I1599907d4529c57070ee2e21b70cc0c17f132e5e
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#ifndef DATETIMEDISPLAYER_H
|
|
#define DATETIMEDISPLAYER_H
|
|
|
|
#include "constants.h"
|
|
|
|
#include <QWidget>
|
|
#include <QFont>
|
|
|
|
#include <com_deepin_daemon_timedate.h>
|
|
|
|
using Timedate = com::deepin::daemon::Timedate;
|
|
|
|
class DateTimeDisplayer : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
struct DateTimeInfo {
|
|
QString m_time;
|
|
QString m_date;
|
|
QRect m_timeRect;
|
|
QRect m_dateRect;
|
|
};
|
|
|
|
public:
|
|
explicit DateTimeDisplayer(QWidget *parent = nullptr);
|
|
~DateTimeDisplayer() override;
|
|
void setPositon(Dock::Position position);
|
|
QSize suitableSize();
|
|
|
|
private:
|
|
void initUi();
|
|
void setCurrentPolicy();
|
|
DateTimeInfo dateTimeInfo();
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
private Q_SLOTS:
|
|
void setShortDateFormat(int type);
|
|
void setShortTimeFormat(int type);
|
|
|
|
private:
|
|
Timedate *m_timedateInter;
|
|
QString m_shortDateFormat;
|
|
QString m_shortTimeFormat;
|
|
Dock::Position m_position;
|
|
mutable QFont m_timeFont;
|
|
mutable QFont m_dateFont;
|
|
};
|
|
|
|
#endif // DATETIMEDISPLAYER_H
|