base function of indicators work again

This commit is contained in:
2026-01-31 15:26:11 +01:00
parent ad5e678c5d
commit 7ad6f46b3c
12 changed files with 212 additions and 523 deletions

View File

@@ -0,0 +1,42 @@
#include "components/workspaceIndicator.hpp"
#include <iostream>
#include "gtkmm/button.h"
#include "gtkmm/label.h"
WorkspaceIndicator::WorkspaceIndicator(std::string label, sigc::slot<void()> onClick)
: Gtk::Box(Gtk::Orientation::HORIZONTAL) {
auto overlay = Gtk::make_managed<Gtk::Overlay>();
auto numLabel = Gtk::make_managed<Gtk::Label>(label);
auto pillContainer = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
// auto gesture = Gtk::GestureClick::create();
// gesture->set_button(GDK_BUTTON_PRIMARY);
// gesture->signal_released().connect([this, i](int, double, double) {
// this->service->switchToWorkspace(
// i + this->monitorId * HyprlandService::kWorkspaceSlotCount);
// });
// overlay->add_controller(gesture);
overlay->add_css_class("workspace-pill");
// if (i == 6 || i == 7) {
// auto indicator = Gtk::make_managed<Gtk::Label>(i == 6 ? "🫱🏻" : "🫲🏻");
// indicator->add_css_class(i == 6 ? "workspace-pill-six" : "workspace-pill-seven");
// indicator->set_valign(Gtk::Align::END);
// overlay->set_child(*indicator);
// overlay->add_overlay(*numLabel);
// pillContainer->append(*overlay);
// } else {
overlay->set_child(*numLabel);
pillContainer->append(*overlay);
// }
append(*pillContainer);
}