Files
bar/include/widgets/workspaceIndicator.hpp
2025-12-18 11:04:30 +01:00

28 lines
754 B
C++

#pragma once
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/gestureclick.h>
#include <sigc++/connection.h>
#include "services/hyprland.hpp"
class WorkspaceIndicator : public Gtk::Box {
public:
WorkspaceIndicator(HyprlandService &service, int monitorId);
~WorkspaceIndicator() override;
private:
HyprlandService &service;
int monitorId;
sigc::connection workspaceConnection;
sigc::connection monitorConnection;
std::map<int, Gtk::Label *> workspaceLabels;
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);
};