2021-10-31 22:55:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AModule.hpp"
|
2024-02-24 17:32:14 +00:00
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/eventcontrollermotion.h>
|
2023-10-14 20:17:19 +00:00
|
|
|
#include "gtkmm/revealer.h"
|
2021-10-31 22:55:13 +00:00
|
|
|
|
|
|
|
namespace waybar {
|
|
|
|
|
|
|
|
class Group : public AModule {
|
|
|
|
public:
|
2022-06-13 19:17:17 +00:00
|
|
|
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
2023-10-14 20:17:19 +00:00
|
|
|
virtual ~Group() = default;
|
2023-03-02 13:57:07 +00:00
|
|
|
auto update() -> void override;
|
|
|
|
operator Gtk::Widget&() override;
|
2023-10-14 16:08:44 +00:00
|
|
|
|
|
|
|
virtual Gtk::Box& getBox();
|
2023-10-14 20:17:19 +00:00
|
|
|
void addWidget(Gtk::Widget& widget);
|
|
|
|
|
2023-10-14 16:08:44 +00:00
|
|
|
protected:
|
2021-10-31 22:55:13 +00:00
|
|
|
Gtk::Box box;
|
2023-10-14 20:17:19 +00:00
|
|
|
Gtk::Box revealer_box;
|
|
|
|
Gtk::Revealer revealer;
|
2024-02-24 17:32:14 +00:00
|
|
|
bool is_first_widget{true};
|
|
|
|
bool is_drawer{false};
|
2023-10-14 21:03:27 +00:00
|
|
|
std::string add_class_to_drawer_children;
|
2023-10-14 21:30:27 +00:00
|
|
|
|
2024-02-24 17:32:14 +00:00
|
|
|
private:
|
|
|
|
Glib::RefPtr<Gtk::EventControllerMotion> controllMotion_;
|
2023-10-14 21:30:27 +00:00
|
|
|
void addHoverHandlerTo(Gtk::Widget& widget);
|
2024-02-24 17:32:14 +00:00
|
|
|
void onMotionEnter(double x, double y);
|
|
|
|
void onMotionLeave();
|
2021-10-31 22:55:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace waybar
|