gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.WindowControls

Description

GtkWindowControls shows window frame controls, such as minimize, maximize and close buttons, and the window icon.

WindowControls only displays start or end side of the controls (see WindowControls:side), so it's intended to be always used in pair with another WindowControls 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

plain code

windowcontrols
├── [image.icon]
├── [button.minimize]
├── [button.maximize]
╰── [button.close]

A 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 WindowControls:decoration-layout value.

When WindowControls:empty is True, it gets the .empty style class.

Synopsis

Exported types

class (GObject o, IsDescendantOf WindowControls o) => IsWindowControls o Source #

Type class for types which can be safely cast to WindowControls, for instance with toWindowControls.

Instances

Instances details
(GObject o, IsDescendantOf WindowControls o) => IsWindowControls o Source # 
Instance details

Defined in GI.Gtk.Objects.WindowControls

toWindowControls :: (MonadIO m, IsWindowControls o) => o -> m WindowControls Source #

Cast to WindowControls, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getDecorationLayout

windowControlsGetDecorationLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindowControls a) 
=> a

self: a WindowControls

-> m Text

Returns: the decoration layout

Gets the decoration layout set with windowControlsSetDecorationLayout.

getEmpty

windowControlsGetEmpty Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindowControls a) 
=> a

self: a WindowControls

-> m Bool

Returns: True if the widget has window buttons, otherwise False

Gets whether the widget has any window buttons.

getSide

windowControlsGetSide Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindowControls a) 
=> a

self: a WindowControls

-> m PackType

Returns: the side

Gets the side set with windowControlsSetSide.

new

windowControlsNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PackType

side: the side

-> m WindowControls

Returns: a new WindowControls.

Creates a new WindowControls.

setDecorationLayout

windowControlsSetDecorationLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindowControls a) 
=> a

self: a WindowControls

-> Maybe Text

layout: a decoration layout, or Nothing to unset the layout

-> m () 

Sets the decoration layout for the title buttons, overriding the Settings: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 WindowControls:side value is gTKPACKSTART, self will display the part before the colon, otherwise after that.

setSide

windowControlsSetSide Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindowControls a) 
=> a

self: a WindowControls

-> PackType

side: a side

-> m () 

Sets the side for self, determining which part of decoration layout it uses.

See windowControlsSetDecorationLayout

Properties

decorationLayout

The decoration layout for window buttons. If this property is not set, the Settings:gtk-decoration-layout setting is used.

See windowControlsSetDecorationLayout for information about the format of this string.

clearWindowControlsDecorationLayout :: (MonadIO m, IsWindowControls o) => o -> m () Source #

Set the value of the “decoration-layout” property to Nothing. When overloading is enabled, this is equivalent to

clear #decorationLayout

constructWindowControlsDecorationLayout :: (IsWindowControls o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “decoration-layout” property. This is rarely needed directly, but it is used by new.

getWindowControlsDecorationLayout :: (MonadIO m, IsWindowControls o) => o -> m Text Source #

Get the value of the “decoration-layout” property. When overloading is enabled, this is equivalent to

get windowControls #decorationLayout

setWindowControlsDecorationLayout :: (MonadIO m, IsWindowControls o) => o -> Text -> m () Source #

Set the value of the “decoration-layout” property. When overloading is enabled, this is equivalent to

set windowControls [ #decorationLayout := value ]

empty

Whether the widget has any window buttons.

getWindowControlsEmpty :: (MonadIO m, IsWindowControls o) => o -> m Bool Source #

Get the value of the “empty” property. When overloading is enabled, this is equivalent to

get windowControls #empty

side

Whether the widget shows start or end side of the decoration layout.

See windowControlsSetDecorationLayout.

constructWindowControlsSide :: (IsWindowControls o, MonadIO m) => PackType -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “side” property. This is rarely needed directly, but it is used by new.

getWindowControlsSide :: (MonadIO m, IsWindowControls o) => o -> m PackType Source #

Get the value of the “side” property. When overloading is enabled, this is equivalent to

get windowControls #side

setWindowControlsSide :: (MonadIO m, IsWindowControls o) => o -> PackType -> m () Source #

Set the value of the “side” property. When overloading is enabled, this is equivalent to

set windowControls [ #side := value ]