:right-sidebar: True WindowControls =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: WindowControls(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` ``GtkWindowControls`` shows window frame controls. Typical window frame controls are minimize, maximize and close buttons, and the window icon. .. image:: https://docs.gtk.org/gtk4/windowcontrols.png ``GtkWindowControls`` only displays start or end side of the controls (see :obj:`~gi.repository.Gtk.WindowControls.props.side`), so it's intended to be always used in pair with another ``GtkWindowControls`` for the opposite side, for example: .. code-block:: :dedent: start ... end CSS nodes --------- .. code-block:: :dedent: windowcontrols ├── [image.icon] ├── [button.minimize] ├── [button.maximize] ╰── [button.close] A ``GtkWindowControls``' 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 :obj:`~gi.repository.Gtk.WindowControls.props.decoration_layout` value. When :obj:`~gi.repository.Gtk.WindowControls.props.empty` is :const:`True`, it gets the .empty style class. Accessibility ------------- ``GtkWindowControls`` uses the :const:`~gi.repository.Gtk.AccessibleRole.GROUP` role. Constructors ------------ .. rst-class:: interim-class .. class:: WindowControls :no-index: .. classmethod:: new(side: ~gi.repository.Gtk.PackType) -> ~gi.repository.Gtk.Widget Creates a new ``GtkWindowControls``. :param side: the side Methods ------- .. rst-class:: interim-class .. class:: WindowControls :no-index: .. method:: get_decoration_layout() -> str | None Gets the decoration layout of this ``GtkWindowControls``. .. method:: get_empty() -> bool Gets whether the widget has any window buttons. .. method:: get_side() -> ~gi.repository.Gtk.PackType Gets the side to which this ``GtkWindowControls`` instance belongs. .. method:: set_decoration_layout(layout: str | None = None) -> None Sets the decoration layout for the title buttons. This overrides the :obj:`~gi.repository.Gtk.Settings.props.gtk_decoration_layout` 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 :obj:`~gi.repository.Gtk.WindowControls.props.side` value is ``GTK_PACK_START``, ``self`` will display the part before the colon, otherwise after that. :param layout: a decoration layout, or :const:`None` to unset the layout .. method:: set_side(side: ~gi.repository.Gtk.PackType) -> None Determines which part of decoration layout the ``GtkWindowControls`` uses. See :obj:`~gi.repository.Gtk.WindowControls.props.decoration_layout`. :param side: a side Properties ---------- .. rst-class:: interim-class .. class:: WindowControls :no-index: .. attribute:: props.decoration_layout :type: str The decoration layout for window buttons. If this property is not set, the :obj:`~gi.repository.Gtk.Settings.props.gtk_decoration_layout` setting is used. .. attribute:: props.empty :type: bool Whether the widget has any window buttons. .. attribute:: props.side :type: ~gi.repository.Gtk.PackType Whether the widget shows start or end side of the decoration layout. See :obj:`~gi.repository.Gtk.WindowControls.props.decoration_layout`.