apprt/gtk-ng: get-title

This commit is contained in:
Mitchell Hashimoto
2025-07-21 07:15:54 -07:00
parent ef686d62aa
commit e911d53a2e
3 changed files with 11 additions and 3 deletions

View File

@ -36,8 +36,7 @@ pub fn close(self: *Self, process_active: bool) void {
}
pub fn getTitle(self: *Self) ?[:0]const u8 {
_ = self;
return null;
return self.surface.getTitle();
}
pub fn getContentScale(self: *const Self) !apprt.ContentScale {

View File

@ -49,7 +49,11 @@ pub fn Common(
/// A helper that can be used to create a property that reads and
/// writes a private `?[:0]const u8` field type.
///
/// This helper helps properly manage the memory to avoid memory leaks.
/// Reading the property will result in a copy of the string
/// and callers are responsible for freeing it.
///
/// Writing the property will free the previous value and copy
/// the new value into the private field.
///
/// The object class (Self) must still free the private field
/// in finalize!

View File

@ -881,6 +881,11 @@ pub const Surface = extern struct {
//---------------------------------------------------------------
// Properties
/// Returns the title property without a copy.
pub fn getTitle(self: *Self) ?[:0]const u8 {
return self.private().title;
}
fn propMouseHidden(
self: *Self,
_: *gobject.ParamSpec,