mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:25:08 +00:00
LibGUI: Implement GWindow::rect().
This commit is contained in:
parent
2ac697ca09
commit
bf766fc12c
1 changed files with 12 additions and 0 deletions
|
@ -103,6 +103,17 @@ String GWindow::title() const
|
|||
return m_title_when_windowless;
|
||||
}
|
||||
|
||||
Rect GWindow::rect() const
|
||||
{
|
||||
if (m_window_id) {
|
||||
GUI_Rect buffer;
|
||||
int rc = gui_get_window_rect(m_window_id, &buffer);
|
||||
ASSERT(rc >= 0);
|
||||
return buffer;
|
||||
}
|
||||
return m_rect_when_windowless;
|
||||
}
|
||||
|
||||
void GWindow::set_rect(const Rect& a_rect)
|
||||
{
|
||||
m_rect_when_windowless = a_rect;
|
||||
|
@ -191,6 +202,7 @@ void GWindow::set_main_widget(GWidget* widget)
|
|||
if (m_main_widget == widget)
|
||||
return;
|
||||
m_main_widget = widget;
|
||||
m_main_widget->set_relative_rect({ 0, 0, width(), height() });
|
||||
if (widget)
|
||||
widget->set_window(this);
|
||||
update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue