feat: 参照dde-weather重构插件,修复显示与弹窗定位

- QML 根元素使用 AppletItem,参照 dde-weather 插件实现
- 使用 Panel.rootObject.dockItemMaxSize 适配任务栏图标尺寸
- dockOrder 设为 21,定位在系统托盘左侧
- 使用 PanelPopup + PanelToolTip + TapHandler 实现点击弹窗和悬停提示
- 弹窗打开前设置 DockPanelPositioner.bounding 修正弹窗定位
- C++ 后端新增 dbusAvailable 属性,D-Bus 不可用时优雅降级
- 使用 isServiceRegistered 正确检测 D-Bus 服务可用性
- install.sh 改用 SCRIPT_DIR 自动定位项目根目录
This commit is contained in:
2026-07-13 20:21:39 +08:00
parent 6654d0d102
commit 9fb80cdfc8
4 changed files with 179 additions and 93 deletions
+4
View File
@@ -22,6 +22,7 @@ class GraphicsDriverApplet : public DApplet
Q_PROPERTY(QString deviceInfo READ deviceInfo NOTIFY deviceInfoChanged)
Q_PROPERTY(int installProgress READ installProgress NOTIFY installProgressChanged)
Q_PROPERTY(bool isInstalling READ isInstalling NOTIFY isInstallingChanged)
Q_PROPERTY(bool dbusAvailable READ dbusAvailable NOTIFY dbusAvailableChanged)
public:
explicit GraphicsDriverApplet(QObject *parent = nullptr);
@@ -34,6 +35,7 @@ public:
QString deviceInfo() const;
int installProgress() const;
bool isInstalling() const;
bool dbusAvailable() const;
Q_INVOKABLE void refreshDeviceInfo();
Q_INVOKABLE void prepareInstall(const QString &driverName);
@@ -49,6 +51,7 @@ signals:
void installSuccess();
void installFailed(const QString &error);
void requestReboot();
void dbusAvailableChanged();
private slots:
void onGetDeviceReply(QDBusPendingCallWatcher *call);
@@ -61,6 +64,7 @@ private:
QDBusInterface *m_dbusInterface;
QTimer *m_progressTimer;
bool m_dbusAvailable;
QString m_currentDriver;
QString m_deviceInfo;