feat(modules): generic label module to allow max-length on all labels

This commit is contained in:
Alexis
2018-08-18 11:43:48 +02:00
parent c128562284
commit b1fd4d7b82
19 changed files with 76 additions and 99 deletions

View File

@ -1,7 +1,7 @@
#include "modules/battery.hpp"
waybar::modules::Battery::Battery(Json::Value config)
: config_(std::move(config))
: ALabel(std::move(config))
{
try {
for (auto &node : fs::directory_iterator(data_dir_)) {
@ -83,8 +83,3 @@ std::string waybar::modules::Battery::getIcon(uint16_t percentage)
auto idx = std::clamp(percentage / (100 / size), 0U, size - 1);
return config_["format-icons"][idx].asString();
}
waybar::modules::Battery::operator Gtk::Widget &()
{
return label_;
}