Package: gtk

Class gtk:window-controls

Superclasses

Documented Subclasses

None

Direct Slots

decoration-layout
The decoration-layout property of type :string (Read / Write)
The decoration layout for window buttons. If this property is not set, the gtk-decoration-layout setting is used.
Default value: nil
empty
The empty property of type :boolean (Read)
Whether the widget has any window buttons.
Default value: true
side
The empty property of type gtk:pack-type (Read / Write)
Whether the widget shows start or end side of the decoration layout.
Default value: :start

Details

The gtk:window-controls widget shows window frame controls, such as Minimize, Maximize and Close buttons, and the window icon.

Figure: GtkWindowControls

The gtk:window-controls widget only displays start or end side of the controls, see the side property, so it is intended to be always used in pair with another gtk:window-controls widget using the opposite side, for example:
<object class="GtkBox">
  <child>
    <object class="GtkWindowControls">
      <property name="side">start</property>
    </object>
  </child>
  ...
  <child>
    <object class="GtkWindowControls">
      <property name="side">end</property>
    </object>
  </child>
</object>  

CSS nodes

windowcontrols
├── [image.icon]
├── [button.minimize]
├── [button.maximize]
╰── [button.close]    
The gtk:window-controls implementation has a CSS node 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 the decoration-layout property. When the empty property is true, it gets the .empty style class.

Accessibility

The gtk:window-controls implementation uses the :group role.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2025-3-29