1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00
serenity/Servers/WindowServer/WSWindowFrame.h
Andreas Kling 0d60c56b51 WindowServer: Make WSWindowFrame and WSButton deal in relative coordinates.
This was a bit painful to get right. The code is a lot more pleasant to
deal with now that all coordinates are relative to their local system
instead of being absolute screen coordinates.
2019-04-05 21:33:34 +02:00

29 lines
601 B
C++

#pragma once
#include <AK/Vector.h>
class Painter;
class Rect;
class WSButton;
class WSMouseEvent;
class WSWindow;
class WSWindowFrame {
public:
WSWindowFrame(WSWindow&);
~WSWindowFrame();
Rect rect() const;
void paint(Painter&);
void on_mouse_event(const WSMouseEvent&);
void notify_window_rect_changed(const Rect& old_rect, const Rect& new_rect);
private:
Rect title_bar_rect() const;
Rect title_bar_icon_rect() const;
Rect title_bar_text_rect() const;
Rect middle_border_rect() const;
WSWindow& m_window;
Vector<OwnPtr<WSButton>> m_buttons;
};