1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

WindowServer: Start implementing a menu system.

I'm going with a global top-of-the-screen menu instead of per-window menus.
The basic idea is that menus will live in the WindowServer and clients can
create menus via WindowServer requests.
This commit is contained in:
Andreas Kling 2019-02-11 09:47:10 +01:00
parent 7abef6ba9e
commit 443b043b49
14 changed files with 487 additions and 6 deletions

32
WindowServer/WSMenuItem.h Normal file
View file

@ -0,0 +1,32 @@
#pragma once
#include <AK/AKString.h>
#include <SharedGraphics/Rect.h>
class WSMenuItem {
public:
enum Type {
None,
Text,
Separator,
};
explicit WSMenuItem(const String& text);
explicit WSMenuItem(Type);
~WSMenuItem();
Type type() const { return m_type; }
bool enabled() const { return m_enabled; }
String text() const { return m_text; }
void set_rect(const Rect& rect) { m_rect = rect; }
Rect rect() const { return m_rect; }
private:
Type m_type { None };
bool m_enabled { true };
String m_text;
Rect m_rect;
};