LibGUI: Implement set_max_size

I already support set_min_size so why not this :)
This commit is contained in:
2025-06-25 13:31:54 +03:00
parent 85f200bd86
commit bbb490b24f
7 changed files with 58 additions and 2 deletions

View File

@@ -178,6 +178,16 @@ namespace LibGUI
return on_socket_error(__FUNCTION__);
}
void Window::set_max_size(uint32_t width, uint32_t height)
{
WindowPacket::WindowSetMaxSize packet;
packet.width = width;
packet.height = height;
if (auto ret = packet.send_serialized(m_server_fd); ret.is_error())
return on_socket_error(__FUNCTION__);
}
void Window::set_attributes(Attributes attributes)
{
WindowPacket::WindowSetAttributes packet;

View File

@@ -165,6 +165,7 @@ namespace LibGUI
WindowSetMouseCapture,
WindowSetSize,
WindowSetMinSize,
WindowSetMaxSize,
WindowSetFullscreen,
WindowSetTitle,
@@ -234,6 +235,12 @@ namespace LibGUI
uint32_t, height
);
DEFINE_PACKET(
WindowSetMaxSize,
uint32_t, width,
uint32_t, height
);
DEFINE_PACKET(
WindowSetFullscreen,
bool, fullscreen

View File

@@ -47,6 +47,7 @@ namespace LibGUI
void set_attributes(Attributes attributes);
void set_min_size(uint32_t width, uint32_t height);
void set_max_size(uint32_t width, uint32_t height);
// send resize request to window server
// actual resize is only done after resize callback is called