Round volume instead of truncating it

This commit is contained in:
Evyatar Stalinsky 2023-06-06 11:42:31 +03:00
parent d22fd3bbd1
commit e397f568b7
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ auto waybar::modules::Wireplumber::update() -> void {
label_.get_style_context()->remove_class("muted"); label_.get_style_context()->remove_class("muted");
} }
int vol = volume_ * 100.0; int vol = round(volume_ * 100.0);
std::string markup = fmt::format(fmt::runtime(format), fmt::arg("node_name", node_name_), std::string markup = fmt::format(fmt::runtime(format), fmt::arg("node_name", node_name_),
fmt::arg("volume", vol), fmt::arg("icon", getIcon(vol))); fmt::arg("volume", vol), fmt::arg("icon", getIcon(vol)));
label_.set_markup(markup); label_.set_markup(markup);