#pragma once #include #include #include #include "AModule.hpp" #include "gtkmm/revealer.h" namespace waybar { class Group : public AModule { sigc::connection reveal_timeout_; public: Group(const std::string&, const std::string&, const Json::Value&, bool); ~Group() override = default; auto update() -> void override; operator Gtk::Widget&() override; virtual Gtk::Box& getBox(); void addWidget(AModule* module); protected: Gtk::Box box; Gtk::Box revealer_box; Gtk::Revealer revealer; bool is_first_widget = true; bool is_drawer = false; bool click_to_reveal = false; std::string always_visible_class; bool empty_if_drawer_empty = false; int reveal_delay = 0; std::string add_class_to_drawer_children; bool handleMouseEnter(GdkEventCrossing* const& ev) override; bool handleMouseLeave(GdkEventCrossing* const& ev) override; bool handleToggle(GdkEventButton* const& ev) override; bool handleScroll(GdkEventScroll* e) override; void show_group(); void hide_group(); void manage_visibility(AModule* module); void show_widget(Gtk::Widget& widget); void hide_widget(Gtk::Widget& widget); void hide_current_widget_if_inactive(); }; } // namespace waybar