base function of indicators work again
This commit is contained in:
42
src/components/workspaceIndicator.cpp
Normal file
42
src/components/workspaceIndicator.cpp
Normal 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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user