refactor and shizz
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/button.h>
|
||||
#include "components/base/button.hpp"
|
||||
|
||||
class BluetoothWidget : public Gtk::Box {
|
||||
public:
|
||||
@@ -21,11 +22,11 @@ class BluetoothWidget : public Gtk::Box {
|
||||
|
||||
Gtk::Box statusArea;
|
||||
Gtk::Box *deviceList = nullptr;
|
||||
Gtk::Button *scanButton = nullptr;
|
||||
Gtk::Button *powerButton = nullptr;
|
||||
Button *scanButton = nullptr;
|
||||
Button *powerButton = nullptr;
|
||||
|
||||
void onPowerButtonClicked();
|
||||
void onScanButtonClicked();
|
||||
|
||||
void toggleButton(Gtk::Button *button, bool state);
|
||||
void toggleButton(Button *button, bool state);
|
||||
};
|
||||
@@ -16,15 +16,16 @@
|
||||
#include <string>
|
||||
|
||||
#include "services/tray.hpp"
|
||||
#include "components/base/button.hpp"
|
||||
|
||||
class TrayIconWidget : public Gtk::Button {
|
||||
class TrayIconWidget : public Button {
|
||||
public:
|
||||
TrayIconWidget(TrayService &service, std::string id);
|
||||
TrayIconWidget(std::string id);
|
||||
|
||||
void update(const TrayService::Item &item);
|
||||
|
||||
private:
|
||||
TrayService &service;
|
||||
TrayService &service = *TrayService::getInstance();
|
||||
std::string id;
|
||||
Gtk::Box container;
|
||||
Gtk::Picture picture;
|
||||
@@ -53,11 +54,11 @@ class TrayIconWidget : public Gtk::Button {
|
||||
|
||||
class TrayWidget : public Gtk::Box {
|
||||
public:
|
||||
explicit TrayWidget(TrayService &service);
|
||||
explicit TrayWidget();
|
||||
~TrayWidget() override;
|
||||
|
||||
private:
|
||||
TrayService &service;
|
||||
TrayService *service = TrayService::getInstance();
|
||||
std::map<std::string, std::unique_ptr<TrayIconWidget>> icons;
|
||||
|
||||
sigc::connection addConnection;
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
class WebWidget : public Popover {
|
||||
public:
|
||||
WebWidget(std::string icon, std::string title, std::string url);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -6,22 +6,23 @@
|
||||
#include <sigc++/connection.h>
|
||||
|
||||
#include "services/hyprland.hpp"
|
||||
#include "gtkmm/overlay.h"
|
||||
|
||||
class WorkspaceIndicator : public Gtk::Box {
|
||||
public:
|
||||
WorkspaceIndicator(HyprlandService &service, int monitorId);
|
||||
WorkspaceIndicator(int monitorId);
|
||||
~WorkspaceIndicator() override;
|
||||
|
||||
private:
|
||||
HyprlandService &service;
|
||||
HyprlandService *service = HyprlandService::getInstance();
|
||||
int monitorId;
|
||||
sigc::connection workspaceConnection;
|
||||
sigc::connection monitorConnection;
|
||||
std::map<int, Gtk::Label *> workspaceLabels;
|
||||
std::map<int, Gtk::Overlay *> workspaceIndicators;
|
||||
std::map<int, Glib::RefPtr<Gtk::GestureClick>> workspaceGestures;
|
||||
|
||||
void rebuild();
|
||||
void on_workspace_update();
|
||||
void on_monitor_update();
|
||||
void refreshLabel(Gtk::Label *label, const HyprlandService::WorkspaceState &state);
|
||||
void refreshLabel(Gtk::Overlay *overlay, const HyprlandService::WorkspaceState &state);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user