nicer button interactivities

This commit is contained in:
2025-12-22 02:32:18 +01:00
parent 5a429a3b8b
commit 8613024f8d
6 changed files with 73 additions and 55 deletions

View File

@@ -13,10 +13,11 @@ class BluetoothService {
sigc::signal<void(bool)> isDiscoveringChangedSignal;
bool getPowerState();
void setPowerState(bool state);
bool getIsDiscovering();
void setIsDiscovering(bool state);
void togglePowerState();
void toggleIsDiscovering();
private:
GDBusProxy *adapter_proxy = nullptr;

View File

@@ -13,9 +13,9 @@ class BluetoothWidget : public Popover {
void setPowerState(bool state);
void setIsDiscovering(bool state);
sigc::signal<void(bool)> powerStateChangedSignal;
sigc::signal<void(bool)> isDiscoveringChangedSignal;
sigc::signal<void()> onPowerStateButtonClickedSignal;
sigc::signal<void()> onIsDiscoveringButtonClickedSignal;
void update();
private:
bool isPowered = false;
@@ -27,5 +27,11 @@ class BluetoothWidget : public Popover {
Gtk::Box *deviceList = nullptr;
Gtk::Button *scanButton = nullptr;
Gtk::Button *toggleButton = nullptr;
Gtk::Button *powerButton = nullptr;
void onPowerButtonClicked();
void onScanButtonClicked();
void toggleButton(Gtk::Button *button, bool state);
};