File: group.hpp

package info (click to toggle)
waybar 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,464 kB
  • sloc: cpp: 25,331; xml: 742; python: 146; ansic: 77; makefile: 29
file content (37 lines) | stat: -rw-r--r-- 910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <gtkmm/box.h>
#include <gtkmm/widget.h>
#include <json/json.h>

#include "AModule.hpp"
#include "gtkmm/revealer.h"

namespace waybar {

class Group : public AModule {
 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(Gtk::Widget& widget);

 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 add_class_to_drawer_children;
  bool handleMouseEnter(GdkEventCrossing* const& ev) override;
  bool handleMouseLeave(GdkEventCrossing* const& ev) override;
  bool handleToggle(GdkEventButton* const& ev) override;
  void show_group();
  void hide_group();
};

}  // namespace waybar