Merge pull request #1238 from Matan1x/master

round brightness
pull/1250/head^2
Alex 2021-09-17 20:56:28 +02:00 committed by GitHub
commit 73ce2a99ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ auto waybar::modules::Backlight::update() -> void {
return; return;
} }
const auto percent = best->get_max() == 0 ? 100 : best->get_actual() * 100 / best->get_max(); const uint8_t percent = best->get_max() == 0 ? 100 : round(best->get_actual() * 100.0f / best->get_max());
label_.set_markup(fmt::format( label_.set_markup(fmt::format(
format_, fmt::arg("percent", std::to_string(percent)), fmt::arg("icon", getIcon(percent)))); format_, fmt::arg("percent", std::to_string(percent)), fmt::arg("icon", getIcon(percent))));
getState(percent); getState(percent);