Files
ladybird/Servers/WindowServer/WSWindowFrame.h
Andreas Kling 0fc3ccaa52 WindowServer: Make WSButton behave more like a normal button.
Previously it would just close the window on MouseDown. Now we do the normal
thing where we require a MouseUp inside the button rect before committing.
2019-04-05 21:53:45 +02:00

31 lines
634 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);
void invalidate_title_bar();
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;
};