mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix simpleclock module compilation with recent fmt
both `format_` and `tooltip_format` are dynamically provided formats so wrap them in `fmt::runtime()`
This commit is contained in:
parent
e30fba0b8f
commit
abd7a0cf25
@ -18,13 +18,13 @@ auto waybar::modules::Clock::update() -> void {
|
|||||||
tzset(); // Update timezone information
|
tzset(); // Update timezone information
|
||||||
auto now = std::chrono::system_clock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
auto localtime = fmt::localtime(std::chrono::system_clock::to_time_t(now));
|
auto localtime = fmt::localtime(std::chrono::system_clock::to_time_t(now));
|
||||||
auto text = fmt::format(format_, localtime);
|
auto text = fmt::format(fmt::runtime(format_), localtime);
|
||||||
label_.set_markup(text);
|
label_.set_markup(text);
|
||||||
|
|
||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
if (config_["tooltip-format"].isString()) {
|
if (config_["tooltip-format"].isString()) {
|
||||||
auto tooltip_format = config_["tooltip-format"].asString();
|
auto tooltip_format = config_["tooltip-format"].asString();
|
||||||
auto tooltip_text = fmt::format(tooltip_format, localtime);
|
auto tooltip_text = fmt::format(fmt::runtime(tooltip_format), localtime);
|
||||||
label_.set_tooltip_text(tooltip_text);
|
label_.set_tooltip_text(tooltip_text);
|
||||||
} else {
|
} else {
|
||||||
label_.set_tooltip_text(text);
|
label_.set_tooltip_text(text);
|
||||||
|
Loading…
Reference in New Issue
Block a user