mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(modules): generic label module to allow max-length on all labels
This commit is contained in:
@ -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_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user