mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
More hacking on Widgets.
This commit is contained in:
parent
c37ded0ae4
commit
a4491e9630
9 changed files with 150 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "Widget.h"
|
||||
#include "Event.h"
|
||||
#include "EventLoop.h"
|
||||
#include "WindowManager.h"
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
Widget::Widget(Widget* parent)
|
||||
|
@ -21,6 +22,17 @@ void Widget::setRect(const Rect& rect)
|
|||
update();
|
||||
}
|
||||
|
||||
void Widget::setIsWindow(bool value)
|
||||
{
|
||||
if (m_isWindow == value)
|
||||
return;
|
||||
m_isWindow = value;
|
||||
if (m_isWindow) {
|
||||
WindowManager::the().addWindow(*this);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void Widget::event(Event& event)
|
||||
{
|
||||
switch (event.type()) {
|
||||
|
@ -104,3 +116,10 @@ Widget::HitTestResult Widget::hitTest(int x, int y)
|
|||
return { this, x, y };
|
||||
}
|
||||
|
||||
void Widget::setWindowTitle(String&& title)
|
||||
{
|
||||
if (title == m_windowTitle)
|
||||
return;
|
||||
m_windowTitle = std::move(title);
|
||||
WindowManager::the().notifyTitleChanged(*this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue