no compile errors, fully functional workspace indicators
This commit is contained in:
@@ -1,14 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/button.h"
|
||||
#include "gtkmm/overlay.h"
|
||||
|
||||
class WorkspaceIndicator : public Gtk::Box {
|
||||
public:
|
||||
WorkspaceIndicator(std::string label, sigc::slot<void()> onClick = {});
|
||||
public:
|
||||
|
||||
private:
|
||||
Gtk::Button button;
|
||||
enum InidicatorState {
|
||||
EMPTY,
|
||||
ALIVE,
|
||||
FOCUSED,
|
||||
PRESENTING,
|
||||
URGENT,
|
||||
};
|
||||
|
||||
// meh, Maybe try WorkspaceState struct later
|
||||
WorkspaceIndicator(int id, std::string label, sigc::slot<void(int)> onClick);
|
||||
void setIndicatorState(InidicatorState state);
|
||||
|
||||
private:
|
||||
void clearCssClass();
|
||||
InidicatorState currentState = EMPTY;
|
||||
std::shared_ptr<Gtk::Overlay> overlay;
|
||||
std::map<InidicatorState, std::string> stateToCssClass = {
|
||||
{FOCUSED, "workspace-pill-focused"},
|
||||
{URGENT, "workspace-pill-urgent"},
|
||||
{ALIVE, "workspace-pill-alive"},
|
||||
{PRESENTING, "workspace-pill-presenting"},
|
||||
{EMPTY, "workspace-pill-empty"}, // Default class
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user