From e397f568b736d169eefda3913224dfe42f148f61 Mon Sep 17 00:00:00 2001 From: Evyatar Stalinsky Date: Tue, 6 Jun 2023 11:42:31 +0300 Subject: [PATCH] Round volume instead of truncating it --- src/modules/wireplumber.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wireplumber.cpp b/src/modules/wireplumber.cpp index cd02d42e..b2d9b39d 100644 --- a/src/modules/wireplumber.cpp +++ b/src/modules/wireplumber.cpp @@ -283,7 +283,7 @@ auto waybar::modules::Wireplumber::update() -> void { 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_), fmt::arg("volume", vol), fmt::arg("icon", getIcon(vol))); label_.set_markup(markup);