wind: Make sure windows have a minimum size to fit the titlebar
This commit is contained in:
parent
17f8ac4f70
commit
877b201496
@ -42,6 +42,8 @@ void Window::focus()
|
|||||||
Window::Window(ui::Rect r, ui::Color c, StringView n) : surface(r), color(c), name(n)
|
Window::Window(ui::Rect r, ui::Color c, StringView n) : surface(r), color(c), name(n)
|
||||||
{
|
{
|
||||||
auto font = ui::Font::default_font();
|
auto font = ui::Font::default_font();
|
||||||
|
if (surface.width < 36) surface.width = 36;
|
||||||
|
if (surface.height < (font->height() + 20)) surface.height = font->height() + 20;
|
||||||
titlebar = ui::Rect { 0, 0, surface.width, font->height() + 20 };
|
titlebar = ui::Rect { 0, 0, surface.width, font->height() + 20 };
|
||||||
close_button = ui::Rect { surface.width - 26, 10, 16, 16 };
|
close_button = ui::Rect { surface.width - 26, 10, 16, 16 };
|
||||||
contents = ui::Rect { 0, font->height() + 20, surface.width, surface.height - (font->height() + 20) };
|
contents = ui::Rect { 0, font->height() + 20, surface.width, surface.height - (font->height() + 20) };
|
||||||
|
Loading…
Reference in New Issue
Block a user