apprt/gtk-ng: get-title
parent
ef686d62aa
commit
e911d53a2e
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue