mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode: - `fmt::format` defaults to compile-time argument checking and requires using `fmt::runtime(format_string)` to bypass that. - `std::format` implementation introduces conflicting declarations and we have to specify the namespace for all `format`/`format_to` calls.
This commit is contained in:
@ -279,7 +279,7 @@ auto waybar::modules::Wireplumber::update() -> void {
|
||||
label_.get_style_context()->remove_class("muted");
|
||||
}
|
||||
|
||||
std::string markup = fmt::format(format, fmt::arg("node_name", node_name_),
|
||||
std::string markup = fmt::format(fmt::runtime(format), fmt::arg("node_name", node_name_),
|
||||
fmt::arg("volume", volume_), fmt::arg("icon", getIcon(volume_)));
|
||||
label_.set_markup(markup);
|
||||
|
||||
@ -291,9 +291,9 @@ auto waybar::modules::Wireplumber::update() -> void {
|
||||
}
|
||||
|
||||
if (!tooltip_format.empty()) {
|
||||
label_.set_tooltip_text(fmt::format(tooltip_format, fmt::arg("node_name", node_name_),
|
||||
fmt::arg("volume", volume_),
|
||||
fmt::arg("icon", getIcon(volume_))));
|
||||
label_.set_tooltip_text(
|
||||
fmt::format(fmt::runtime(tooltip_format), fmt::arg("node_name", node_name_),
|
||||
fmt::arg("volume", volume_), fmt::arg("icon", getIcon(volume_))));
|
||||
} else {
|
||||
label_.set_tooltip_text(node_name_);
|
||||
}
|
||||
|
Reference in New Issue
Block a user