feat(Label): use set_markup

This commit is contained in:
Alexis
2018-11-21 20:49:09 +01:00
parent b3559328f1
commit bd62c4cbc5
9 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@ auto waybar::modules::Memory::update() -> void
parseMeminfo();
if (memtotal_ > 0 && memfree_ >= 0) {
int used_ram_percentage = 100 * (memtotal_ - memfree_) / memtotal_;
label_.set_text(fmt::format(format_, used_ram_percentage));
label_.set_markup(fmt::format(format_, used_ram_percentage));
auto used_ram_gigabytes = (memtotal_ - memfree_) / std::pow(1024, 2);
label_.set_tooltip_text(fmt::format("{:.{}f}Gb used", used_ram_gigabytes, 1));
label_.set_name("memory");