mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +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
39
Widgets/Window.cpp
Normal file
39
Widgets/Window.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include "Window.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
Window::Window(Object* parent)
|
||||
: Object(parent)
|
||||
{
|
||||
WindowManager::the().addWindow(*this);
|
||||
}
|
||||
|
||||
Window::~Window()
|
||||
{
|
||||
}
|
||||
|
||||
void Window::setMainWidget(Widget* widget)
|
||||
{
|
||||
if (m_mainWidget == widget)
|
||||
return;
|
||||
|
||||
m_mainWidget = widget;
|
||||
}
|
||||
|
||||
void Window::setTitle(String&& title)
|
||||
{
|
||||
if (m_title == title)
|
||||
return;
|
||||
|
||||
m_title = std::move(title);
|
||||
WindowManager::the().notifyTitleChanged(*this);
|
||||
}
|
||||
|
||||
|
||||
void Window::setRect(const Rect& rect)
|
||||
{
|
||||
if (m_rect == rect)
|
||||
return;
|
||||
auto oldRect = m_rect;
|
||||
m_rect = rect;
|
||||
WindowManager::the().notifyRectChanged(*this, oldRect, m_rect);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue