Merge pull request #3457 from RobertMueller2/issue_3414

Issue #3414/clock: Shift ONLY calendar
This commit is contained in:
Alexis Rouillard 2024-07-22 09:06:08 +02:00 committed by GitHub
commit 003dd3a9a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -163,15 +163,16 @@ auto waybar::modules::Clock::update() -> void {
// std::vformat doesn't support named arguments. // std::vformat doesn't support named arguments.
m_tlpText_ = m_tlpText_ =
std::regex_replace(m_tlpFmt_, std::regex("\\{" + kTZPlaceholder + "\\}"), tzText_); std::regex_replace(m_tlpFmt_, std::regex("\\{" + kTZPlaceholder + "\\}"), tzText_);
m_tlpText_ = m_tlpText_ = std::regex_replace(
std::regex_replace(m_tlpText_, std::regex("\\{" + kCldPlaceholder + "\\}"), cldText_); m_tlpText_, std::regex("\\{" + kCldPlaceholder + "\\}"),
fmt_lib::vformat(m_locale_, cldText_, fmt_lib::make_format_args(shiftedNow)));
m_tlpText_ = m_tlpText_ =
std::regex_replace(m_tlpText_, std::regex("\\{" + kOrdPlaceholder + "\\}"), ordText_); std::regex_replace(m_tlpText_, std::regex("\\{" + kOrdPlaceholder + "\\}"), ordText_);
} else { } else {
m_tlpText_ = m_tlpFmt_; m_tlpText_ = m_tlpFmt_;
} }
m_tlpText_ = fmt_lib::vformat(m_locale_, m_tlpText_, fmt_lib::make_format_args(shiftedNow)); m_tlpText_ = fmt_lib::vformat(m_locale_, m_tlpText_, fmt_lib::make_format_args(now));
m_tooltip_->set_markup(m_tlpText_); m_tooltip_->set_markup(m_tlpText_);
label_.trigger_tooltip_query(); label_.trigger_tooltip_query();
} }