mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(clock): remove struct waybar_time
The structure was used to pass the locale instance to the date formatter. All the supported versions of `fmt` are passing the locale parameter via `FormatContext.locale()` so we can remove the struct and simplify the code. While we at it, drop `date::make_zoned` in favor of CTAD on a `date::zoned_time` constructor.
This commit is contained in:
@ -5,11 +5,7 @@
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
struct waybar_time;
|
||||
|
||||
namespace modules {
|
||||
namespace waybar::modules {
|
||||
|
||||
const std::string kCalendarPlaceholder = "calendar";
|
||||
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
|
||||
@ -36,12 +32,11 @@ class Clock : public ALabel {
|
||||
std::string fmt_str_weeks_;
|
||||
std::string fmt_str_calendar_;
|
||||
int fmt_weeks_left_pad_{0};
|
||||
auto calendar_text(const waybar_time& wtime) -> std::string;
|
||||
auto calendar_text(const date::zoned_seconds& ztime) -> std::string;
|
||||
auto weekdays_header(const date::weekday& first_dow, std::ostream& os) -> void;
|
||||
auto first_day_of_week() -> date::weekday;
|
||||
const date::time_zone* current_timezone();
|
||||
bool is_timezone_fixed();
|
||||
auto timezones_text(std::chrono::system_clock::time_point* now) -> std::string;
|
||||
};
|
||||
} // namespace modules
|
||||
} // namespace waybar
|
||||
} // namespace waybar::modules
|
||||
|
Reference in New Issue
Block a user