mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
WindowServer+CPUGraph: Make menu applets be "regular" windows
Instead of implementing menu applets as their own thing, they are now WSWindows of WSWindowType::MenuApplet. This makes it much easier to work with them on the client side, since you can just create a GWindow with the right type and you're in the menubar doing applet stuff :^)
This commit is contained in:
parent
648ed76085
commit
df129bbe0e
13 changed files with 97 additions and 202 deletions
|
@ -118,12 +118,19 @@ public:
|
|||
|
||||
virtual void event(CEvent&) override;
|
||||
|
||||
// Only used by WSWindowType::MenuApplet. Perhaps it could be a WSWindow subclass? I don't know.
|
||||
void set_rect_in_menubar(const Rect& rect) { m_rect_in_menubar = rect; }
|
||||
const Rect& rect_in_menubar() const { return m_rect_in_menubar; }
|
||||
|
||||
const GraphicsBitmap* backing_store() const { return m_backing_store.ptr(); }
|
||||
GraphicsBitmap* backing_store() { return m_backing_store.ptr(); }
|
||||
|
||||
void set_backing_store(RefPtr<GraphicsBitmap>&& backing_store)
|
||||
{
|
||||
m_last_backing_store = move(m_backing_store);
|
||||
m_backing_store = move(backing_store);
|
||||
}
|
||||
|
||||
void swap_backing_stores()
|
||||
{
|
||||
swap(m_backing_store, m_last_backing_store);
|
||||
|
@ -200,6 +207,7 @@ private:
|
|||
unsigned m_wm_event_mask { 0 };
|
||||
DisjointRectSet m_pending_paint_rects;
|
||||
Rect m_unmaximized_rect;
|
||||
Rect m_rect_in_menubar;
|
||||
RefPtr<WSMenu> m_window_menu;
|
||||
int m_minimize_animation_step { -1 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue