mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
Start adding a Window class.
This commit is contained in:
parent
bd6172e3c7
commit
415c4b90c5
12 changed files with 159 additions and 55 deletions
35
Widgets/Window.h
Normal file
35
Widgets/Window.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include "Object.h"
|
||||
#include "Rect.h"
|
||||
|
||||
class Widget;
|
||||
|
||||
class Window : public Object {
|
||||
public:
|
||||
explicit Window(Object* parent = nullptr);
|
||||
virtual ~Window() override;
|
||||
|
||||
String title() const { return m_title; }
|
||||
void setTitle(String&&);
|
||||
|
||||
int x() const { return m_rect.x(); }
|
||||
int y() const { return m_rect.y(); }
|
||||
int width() const { return m_rect.width(); }
|
||||
int height() const { return m_rect.height(); }
|
||||
|
||||
const Rect& rect() const { return m_rect; }
|
||||
void setRect(const Rect&);
|
||||
|
||||
Widget* mainWidget() { return m_mainWidget; }
|
||||
const Widget* mainWidget() const { return m_mainWidget; }
|
||||
|
||||
void setMainWidget(Widget*);
|
||||
|
||||
private:
|
||||
String m_title;
|
||||
Rect m_rect;
|
||||
Widget* m_mainWidget { nullptr };
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue