AdwWindow

AdwWindow — A freeform window.

Functions

GtkWidget * adw_window_new ()
void adw_window_set_child ()
GtkWidget * adw_window_get_child ()

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkWindow
                ╰── AdwWindow
                    ╰── AdwPreferencesWindow

Implemented Interfaces

AdwWindow implements GtkAccessible, GtkBuildable, GtkConstraintTarget, GtkNative, GtkShortcutManager and GtkRoot.

Description

The AdwWindow widget is a subclass of GtkWindow which has no titlebar area and provides rounded corners on all sides, ensuring they can never be overlapped by the content. This makes it safe to use headerbars in the content area as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
<object class="AdwWindow"/>
  <child>
    <object class="GtkBox">
      <property name="orientation">vertical</property>
      <child>
        <object class="AdwHeaderBar"/>
      </child>
      <child>
        ...
      </child>
    </object>
  </child>
</object>

AdwWindow allows to easily implement titlebar autohiding by putting the headerbar inside a GtkRevealer, and to show titlebar above content by putting it into a GtkOverlay instead of GtkBox.

if the window has a GtkGLArea, it may bring a slight performance regression when the window is not fullscreen, tiled or maximized.

Using gtk_window_get_titlebar() and gtk_window_set_titlebar() is not supported and will result in a crash.

Functions

adw_window_new ()

GtkWidget *
adw_window_new (void);

Creates a new AdwWindow.

Returns

a newly created AdwWindow.

[transfer full]

Since: 1.0


adw_window_set_child ()

void
adw_window_set_child (AdwWindow *self,
                      GtkWidget *child);

Sets the child widget of self .

Parameters

self

a AdwWindow

 

child

the child widget.

[allow-none]

Since: 1.0


adw_window_get_child ()

GtkWidget *
adw_window_get_child (AdwWindow *self);

Gets the child widget of self .

Parameters

self

a AdwWindow

 

Returns

the child widget of self .

[nullable][transfer none]

Since: 1.0

Types and Values

ADW_TYPE_WINDOW

#define ADW_TYPE_WINDOW (adw_window_get_type())

struct AdwWindowClass

struct AdwWindowClass {
  GtkWindowClass parent_class;
};

AdwWindow

typedef struct _AdwWindow AdwWindow;

See Also

AdwApplicationWindow