Gnome::Gtk4::WindowControls
Description
Gnome::Gtk4::WindowControls shows window frame controls.
Typical window frame controls are minimize, maximize and close buttons, and the window icon.
Gnome::Gtk4::WindowControls only displays start or end side of the controls (see side), so it's intended to be always used in pair with another Gnome::Gtk4::WindowControls for the opposite side, for example:
CSS nodes
A Gnome::Gtk4::WindowControls' CSS node is called windowcontrols. It contains subnodes corresponding to each title button. Which of the title buttons exist and where they are placed exactly depends on the desktop environment and decoration-layout value.
When empty is True
, it gets the .empty style class.
Accessibility
Gnome::Gtk4::WindowControls uses the GTK_ACCESSIBLE_ROLE_GROUP
role.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-windowcontrols
Creates a new Gnome::Gtk4::WindowControls.
method new-windowcontrols ( GtkPackType $side --> Gnome::Gtk4::WindowControls \)
$side; the side.
Methods
get-decoration-layout
Gets the decoration layout of this Gnome::Gtk4::WindowControls.
method get-decoration-layout (--> Str )
Return value; the decoration layout or undefined if it is unset.
get-empty
Gets whether the widget has any window buttons.
method get-empty (--> Bool )
Return value; True
if the widget has window buttons, otherwise False
.
get-side
Gets the side to which this Gnome::Gtk4::WindowControls instance belongs.
method get-side (--> GtkPackType )
Return value; the side.
set-decoration-layout
Sets the decoration layout for the title buttons.
This overrides the gtk-decoration-layout defined in Gnome::Gtk4::Settings setting.
The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close and icon (the window icon).
For example, “icon:minimize,maximize,close” specifies a icon on the left, and minimize, maximize and close buttons on the right.
If side value is $GTK-PACK-START
, $self
will display the part before the colon, otherwise after that.
method set-decoration-layout ( Str $layout )
$layout; a decoration layout, or undefined to unset the layout.
set-side
Determines which part of decoration layout the Gnome::Gtk4::WindowControls uses.
See decoration-layout.
method set-side ( GtkPackType $side )
$side; a side.