/* * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include namespace Taskbar { class ClockWidget final : public GUI::Frame { C_OBJECT(ClockWidget); public: virtual ~ClockWidget() override = default; void update_format(DeprecatedString const&); private: ClockWidget(); virtual void paint_event(GUI::PaintEvent&) override; virtual void mousedown_event(GUI::MouseEvent&) override; virtual void context_menu_event(GUI::ContextMenuEvent&) override; void tick_clock() { tzset(); update(); } void open(); void close(); void position_calendar_window(); void jump_to_current_date(); DeprecatedString m_time_format; RefPtr m_calendar_window; RefPtr m_calendar; RefPtr m_next_date; RefPtr m_prev_date; RefPtr m_selected_calendar_button; RefPtr m_jump_to_button; RefPtr m_calendar_launcher; RefPtr m_context_menu; RefPtr m_timer; int m_time_width { 0 }; Gfx::IntSize m_window_size { 158, 186 }; }; }