Added custom tooltip with device icon, device name and battery status

This commit is contained in:
Erik Reider
2022-03-19 17:09:55 +01:00
parent 4196e0d5d1
commit 7fac2afb85
6 changed files with 229 additions and 18 deletions

View File

@ -0,0 +1,29 @@
#pragma once
#include <libupower-glib/upower.h>
#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;
std::string getDeviceIcon(UpDeviceKind& kind);
Gtk::Box* contentBox;
uint iconSize;
uint tooltipSpacing;
public:
UPowerTooltip(uint iconSize, uint tooltipSpacing);
~UPowerTooltip();
uint updateTooltip(Devices& devices);
};
} // namespace waybar::modules::upower