fix: 增加设置是否显示最近打开区域的接口

1.增加本地配置,并增加bool类型变量来表示是否显示最近打开应用
2.在应用打开或者退出的时候,根据是否显示最近打开应用的配置来决定是否显示当前应用图标

Log: 增加是否显示最近打开应用接口
Influence: 时尚模式下,调用setShowRecent接口,观察任务栏是否显示最近打开应用
Bug: https://pms.uniontech.com/bug-view-147717.html
Change-Id: I9e2f8a8ea74bf4deb2f1db9af8b87ff1827c2297
This commit is contained in:
donghualin
2022-08-04 13:22:22 +00:00
parent 2a226a1016
commit d7d2f252b7
14 changed files with 356 additions and 163 deletions

View File

@ -31,6 +31,10 @@
#include <QVector>
#include <QObject>
#define ENTRY_NONE 0
#define ENTRY_NORMAL 1
#define ENTRY_RECENT 2
// 单个应用类
class Dock;
class Entry: public QObject
@ -51,13 +55,14 @@ public:
QString getFileName();
AppInfo *getApp();
void setApp(AppInfo *appinfo);
bool getIsDocked();
bool getIsDocked() const;
void setIsDocked(bool value);
void startExport();
void stopExport();
void setMenu(AppMenu *_menu);
void updateMenu();
void updateIcon();
void updateMode();
void forceUpdateIcon();
void updateIsActive();
WindowInfoBase *getWindowInfoByPid(int pid);
@ -87,6 +92,7 @@ public:
void forceQuit();
void presentWindows();
void active(uint32_t timestamp);
int mode();
XWindow getCurrentWindow();
QString getDesktopFile();
@ -107,6 +113,7 @@ Q_SIGNALS:
void desktopFileChanged(QString value);
void currentWindowChanged(uint32_t value);
void windowInfosChanged(const WindowInfoMap &value);
void modeChanged(int);
private:
// 右键菜单项
@ -121,6 +128,7 @@ private:
bool killProcess(int pid);
bool setPropDesktopFile(QString value);
bool isShowOnDock() const;
int getCurrentMode();
private:
Dock *dock;
@ -142,6 +150,7 @@ private:
WindowInfoBase *m_current; // 当前窗口
XWindow m_currentWindow; //当前窗口Id
bool m_winIconPreferred;
int m_mode;
};
#endif // ENTRY_H