1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:35:07 +00:00
serenity/Servers/WindowServer/WSWindowFrame.h
Andreas Kling 3fa0b6cd92 WindowServer: Always update the maximize button icon when we should.
We were only updating it in the WSButton callback, not when changing the
maximized state by calling WSWindow::set_maximized().

Fixes #119.
2019-06-02 15:35:00 +02:00

34 lines
739 B
C++

#pragma once
#include <AK/Badge.h>
#include <AK/OwnPtr.h>
#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();
Rect title_bar_rect() const;
Rect title_bar_icon_rect() const;
Rect title_bar_text_rect() const;
void did_set_maximized(Badge<WSWindow>, bool);
private:
WSWindow& m_window;
Vector<OwnPtr<WSButton>> m_buttons;
WSButton* m_maximize_button { nullptr };
};