mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-03-17 03:32:33 +00:00
[Linux] Simplify code, implement tray manager
Implement tray manager Bug fixes Bug fixes
This commit is contained in:
committed by
Tim Gromeyer
parent
e72b4a116e
commit
1946857ca5
40
linux/trayiconmanager.h
Normal file
40
linux/trayiconmanager.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <QObject>
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
class QMenu;
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
|
||||
class TrayIconManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TrayIconManager(QObject *parent = nullptr);
|
||||
|
||||
void updateBatteryStatus(const QString &status);
|
||||
|
||||
void updateNoiseControlState(AirpodsTrayApp::Enums::NoiseControlMode);
|
||||
|
||||
void updateConversationalAwareness(bool enabled);
|
||||
|
||||
private slots:
|
||||
void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||
|
||||
private:
|
||||
QSystemTrayIcon *trayIcon;
|
||||
QMenu *trayMenu;
|
||||
QAction *caToggleAction;
|
||||
QActionGroup *noiseControlGroup;
|
||||
|
||||
void setupMenuActions();
|
||||
|
||||
void updateIconFromBattery(const QString &status);
|
||||
|
||||
signals:
|
||||
void trayClicked();
|
||||
void noiseControlChanged(AirpodsTrayApp::Enums::NoiseControlMode);
|
||||
void conversationalAwarenessToggled(bool enabled);
|
||||
};
|
||||
Reference in New Issue
Block a user