1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

Userland: Allow the Analog Clock window border to be hidden

Introduce the ability to hide the Analog Clock window borde. With this
feature enabled it looks like the clock is floating and integrated into
the desktop.

The "Cube Demo" has the same feature, and was used as inspiration when
implementing the feature in the Analog Clock.
This commit is contained in:
Brian Gianforcaro 2021-05-09 19:34:33 -07:00 committed by Andreas Kling
parent 3be9af7695
commit 1674d06f78
3 changed files with 39 additions and 3 deletions

View file

@ -13,6 +13,10 @@ class AnalogClock : public GUI::Widget {
C_OBJECT(AnalogClock)
public:
~AnalogClock() override = default;
void set_show_window_frame(bool);
bool show_window_frame() const { return m_show_window_frame; }
Function<void(GUI::ContextMenuEvent&)> on_context_menu_request;
private:
AnalogClock()
@ -32,7 +36,10 @@ private:
double m_hand_tail_length { 22 };
double m_hand_wing_span { 5 };
bool m_show_window_frame { true };
protected:
void context_menu_event(GUI::ContextMenuEvent& event) override;
void paint_event(GUI::PaintEvent&) override;
void draw_face(GUI::Painter&);
void draw_mirrored_graduations(GUI::Painter&, Gfx::IntRect&, int x, int y, int rect_center_offset);