Waybar/include/group.hpp

38 lines
914 B
C++
Raw Normal View History

2021-10-31 22:55:13 +00:00
#pragma once
#include <gtkmm/box.h>
2022-04-06 06:37:19 +00:00
#include <gtkmm/widget.h>
2021-10-31 22:55:13 +00:00
#include <json/json.h>
2022-04-06 06:37:19 +00:00
2021-10-31 22:55:13 +00:00
#include "AModule.hpp"
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:
Group(const std::string &, const std::string &, const Json::Value &, bool);
2024-08-03 03:30:56 +00:00
~Group() override = default;
2023-03-02 13:57:07 +00:00
auto update() -> void override;
operator Gtk::Widget &() override;
virtual Gtk::Box &getBox();
void addWidget(Gtk::Widget &widget);
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;
bool is_first_widget = true;
bool is_drawer = false;
2024-07-07 20:08:45 +00:00
bool click_to_reveal = false;
2023-10-14 21:03:27 +00:00
std::string add_class_to_drawer_children;
bool handleMouseEnter(GdkEventCrossing *const &ev) override;
bool handleMouseLeave(GdkEventCrossing *const &ev) override;
2024-07-07 20:08:45 +00:00
bool handleToggle(GdkEventButton *const &ev) override;
void show_group();
void hide_group();
2021-10-31 22:55:13 +00:00
};
} // namespace waybar