Waybar/include/modules/privacy/privacy_item.hpp

49 lines
1.0 KiB
C++
Raw Normal View History

2023-10-26 21:08:57 +00:00
#pragma once
#include <json/value.h>
#include <string>
#include "gtkmm/box.h"
#include "gtkmm/image.h"
#include "gtkmm/revealer.h"
#include "util/pipewire/privacy_node_info.hpp"
2023-10-28 22:17:53 +00:00
using waybar::util::PipewireBackend::PrivacyNodeInfo;
using waybar::util::PipewireBackend::PrivacyNodeType;
2023-10-26 21:08:57 +00:00
namespace waybar::modules::privacy {
class PrivacyItem : public Gtk::Revealer {
public:
2023-10-28 22:17:53 +00:00
PrivacyItem(const Json::Value &config_, enum PrivacyNodeType privacy_type_,
std::list<PrivacyNodeInfo *> *nodes, const std::string &pos, const uint icon_size,
const uint transition_duration);
2023-10-26 21:08:57 +00:00
enum PrivacyNodeType privacy_type;
2023-10-26 21:08:57 +00:00
void set_in_use(bool in_use);
private:
2023-10-28 22:17:53 +00:00
std::list<PrivacyNodeInfo *> *nodes;
2023-10-26 21:08:57 +00:00
sigc::connection signal_conn;
2023-10-28 22:17:53 +00:00
Gtk::Box tooltip_window;
2023-10-26 21:08:57 +00:00
bool init = false;
bool in_use = false;
// Config
std::string iconName = "image-missing-symbolic";
2023-10-28 22:17:53 +00:00
bool tooltip = true;
uint tooltipIconSize = 24;
2023-10-26 21:08:57 +00:00
Gtk::Box box_;
Gtk::Image icon_;
2023-10-28 22:17:53 +00:00
void update_tooltip();
2023-10-26 21:08:57 +00:00
};
} // namespace waybar::modules::privacy