mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Feature Clock: show list of time in other timezones in a tooltip
Introducing new tooltip placeholder: {timezoned_time_list}. It will be replaced with the list of times in different time zones. I've found it useful to hover the mouse pointer on time and see time in all my timezones at once. Current timezone excluding from the list, so if you will scroll over the time module and change the active timezone, this timezone will be excluded from the list and the previous active zone will be added.
This commit is contained in:
@ -18,6 +18,7 @@ struct waybar_time {
|
||||
};
|
||||
|
||||
const std::string kCalendarPlaceholder = "calendar";
|
||||
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
|
||||
|
||||
class Clock : public ALabel {
|
||||
public:
|
||||
@ -33,6 +34,7 @@ class Clock : public ALabel {
|
||||
date::year_month_day cached_calendar_ymd_ = date::January/1/0;
|
||||
std::string cached_calendar_text_;
|
||||
bool is_calendar_in_tooltip_;
|
||||
bool is_timezoned_list_in_tooltip_;
|
||||
|
||||
bool handleScroll(GdkEventScroll* e);
|
||||
|
||||
@ -41,6 +43,7 @@ class Clock : public ALabel {
|
||||
auto first_day_of_week() -> date::weekday;
|
||||
const date::time_zone* current_timezone();
|
||||
bool is_timezone_fixed();
|
||||
auto timezones_text(std::chrono::_V2::system_clock::time_point *now) -> std::string;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
Reference in New Issue
Block a user