forked from quickshell/quickshell
service/tray: rework tray image providers
This commit is contained in:
parent
aa9f8cd001
commit
7cc1b54587
10 changed files with 163 additions and 82 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
|
||||
#include "../../core/imageprovider.hpp"
|
||||
#include "../../dbus/properties.hpp"
|
||||
#include "dbus_item.h"
|
||||
#include "dbus_item_types.hpp"
|
||||
|
@ -17,6 +18,18 @@ Q_DECLARE_LOGGING_CATEGORY(logStatusNotifierItem);
|
|||
|
||||
namespace qs::service::sni {
|
||||
|
||||
class StatusNotifierItem;
|
||||
|
||||
class TrayImageHandle: public QsImageHandle {
|
||||
public:
|
||||
explicit TrayImageHandle(StatusNotifierItem* item);
|
||||
|
||||
QPixmap requestPixmap(const QString& id, QSize* size, const QSize& requestedSize) override;
|
||||
|
||||
public:
|
||||
StatusNotifierItem* item;
|
||||
};
|
||||
|
||||
class StatusNotifierItem: public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
|
@ -62,6 +75,7 @@ private slots:
|
|||
|
||||
private:
|
||||
DBusStatusNotifierItem* item = nullptr;
|
||||
TrayImageHandle imageHandle {this};
|
||||
bool mReady = false;
|
||||
|
||||
// bumped to inhibit caching
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue