2022-03-19 16:09:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libupower-glib/upower.h>
|
|
|
|
|
2022-05-23 16:23:00 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2022-03-19 16:09:55 +00:00
|
|
|
#include "gtkmm/box.h"
|
|
|
|
#include "gtkmm/label.h"
|
|
|
|
#include "gtkmm/window.h"
|
|
|
|
|
|
|
|
namespace waybar::modules::upower {
|
|
|
|
|
|
|
|
class UPowerTooltip : public Gtk::Window {
|
|
|
|
private:
|
|
|
|
typedef std::unordered_map<std::string, UpDevice*> Devices;
|
|
|
|
|
2022-03-19 18:22:21 +00:00
|
|
|
const std::string getDeviceIcon(UpDeviceKind& kind);
|
2022-03-19 16:09:55 +00:00
|
|
|
|
|
|
|
Gtk::Box* contentBox;
|
|
|
|
|
|
|
|
uint iconSize;
|
|
|
|
uint tooltipSpacing;
|
2022-03-21 12:50:46 +00:00
|
|
|
uint tooltipPadding;
|
2022-03-19 16:09:55 +00:00
|
|
|
|
|
|
|
public:
|
2022-03-21 12:50:46 +00:00
|
|
|
UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding);
|
2023-03-02 13:57:07 +00:00
|
|
|
virtual ~UPowerTooltip();
|
2022-03-19 16:09:55 +00:00
|
|
|
|
|
|
|
uint updateTooltip(Devices& devices);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace waybar::modules::upower
|