LibGUI: Add support for changing window title
This commit is contained in:
@@ -287,6 +287,15 @@ namespace LibGUI
|
||||
return on_socket_error(__FUNCTION__);
|
||||
}
|
||||
|
||||
void Window::set_title(BAN::StringView title)
|
||||
{
|
||||
WindowPacket::WindowSetTitle packet;
|
||||
MUST(packet.title.append(title));
|
||||
|
||||
if (auto ret = packet.send_serialized(m_server_fd); ret.is_error())
|
||||
return on_socket_error(__FUNCTION__);
|
||||
}
|
||||
|
||||
void Window::set_position(int32_t x, int32_t y)
|
||||
{
|
||||
WindowPacket::WindowSetPosition packet;
|
||||
|
||||
@@ -165,6 +165,7 @@ namespace LibGUI
|
||||
WindowSetMouseCapture,
|
||||
WindowSetSize,
|
||||
WindowSetFullscreen,
|
||||
WindowSetTitle,
|
||||
|
||||
DestroyWindowEvent,
|
||||
CloseWindowEvent,
|
||||
@@ -230,6 +231,11 @@ namespace LibGUI
|
||||
bool, fullscreen
|
||||
);
|
||||
|
||||
DEFINE_PACKET(
|
||||
WindowSetTitle,
|
||||
BAN::String, title
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
namespace EventPacket
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace LibGUI
|
||||
|
||||
void set_mouse_capture(bool captured);
|
||||
void set_fullscreen(bool fullscreen);
|
||||
void set_title(BAN::StringView title);
|
||||
|
||||
void set_position(int32_t x, int32_t y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user