Top |
HdyCenteringPolicy | centering-policy | Read / Write |
GtkWidget * | custom-title | Read / Write |
gchar * | decoration-layout | Read / Write |
gboolean | decoration-layout-set | Read / Write |
gboolean | has-subtitle | Read / Write |
gboolean | interpolate-size | Read / Write |
gboolean | show-close-button | Read / Write |
gint | spacing | Read / Write |
gchar * | subtitle | Read / Write |
gchar * | title | Read / Write |
guint | transition-duration | Read / Write |
gboolean | transition-running | Read |
#define | HDY_TYPE_HEADER_BAR |
enum | HdyCenteringPolicy |
struct | HdyHeaderBarClass |
HdyHeaderBar |
GEnum ╰── HdyCenteringPolicy GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── HdyHeaderBar
HdyHeaderBar is similar to GtkHeaderBar but is designed to fix some of its shortcomings for adaptive applications.
HdyHeaderBar doesn't force the custom title widget to be vertically centered, hence allowing it to fill up the whole height, which is e.g. needed for HdyViewSwitcher.
When used in a HdyDialog, HdyHeaderBar will replace its window decorations by a back button allowing to close it. It doesn't have to be its direct child and you can use any complex contraption you like as the dialog's titlebar.
GtkWidget *
hdy_header_bar_new (void
);
Creates a new HdyHeaderBar widget.
Since: 0.0.10
const gchar *
hdy_header_bar_get_title (HdyHeaderBar *self
);
Retrieves the title of the header. See hdy_header_bar_set_title()
.
the title of the header, or NULL
if none has
been set explicitly. The returned string is owned by the widget
and must not be modified or freed.
[nullable]
Since: 0.0.10
void hdy_header_bar_set_title (HdyHeaderBar *self
,const gchar *title
);
Sets the title of the HdyHeaderBar. The title should help a user identify the current view. A good title should not include the application name.
Since: 0.0.10
const gchar *
hdy_header_bar_get_subtitle (HdyHeaderBar *self
);
Retrieves the subtitle of the header. See hdy_header_bar_set_subtitle()
.
the subtitle of the header, or NULL
if none has
been set explicitly. The returned string is owned by the widget
and must not be modified or freed.
[nullable]
Since: 0.0.10
void hdy_header_bar_set_subtitle (HdyHeaderBar *self
,const gchar *subtitle
);
Sets the subtitle of the HdyHeaderBar. The title should give a user an additional detail to help him identify the current view.
Note that HdyHeaderBar by default reserves room for the subtitle,
even if none is currently set. If this is not desired, set the
“has-subtitle” property to FALSE
.
Since: 0.0.10
GtkWidget *
hdy_header_bar_get_custom_title (HdyHeaderBar *self
);
Retrieves the custom title widget of the header. See
hdy_header_bar_set_custom_title()
.
the custom title widget
of the header, or NULL
if none has been set explicitly.
[nullable][transfer none]
Since: 0.0.10
void hdy_header_bar_set_custom_title (HdyHeaderBar *self
,GtkWidget *title_widget
);
Sets a custom title for the HdyHeaderBar.
The title should help a user identify the current view. This
supersedes any title set by hdy_header_bar_set_title()
or
hdy_header_bar_set_subtitle()
. To achieve the same style as
the builtin title and subtitle, use the “title” and “subtitle”
style classes.
You should set the custom title to NULL
, for the header title
label to be visible again.
Since: 0.0.10
void hdy_header_bar_pack_start (HdyHeaderBar *self
,GtkWidget *child
);
Adds child
to self
:, packed with reference to the
start of the self
:.
Since: 0.0.10
void hdy_header_bar_pack_end (HdyHeaderBar *self
,GtkWidget *child
);
Adds child
to self
:, packed with reference to the
end of the self
:.
Since: 0.0.10
gboolean
hdy_header_bar_get_show_close_button (HdyHeaderBar *self
);
Returns whether this header bar shows the standard window decorations.
Since: 0.0.10
void hdy_header_bar_set_show_close_button (HdyHeaderBar *self
,gboolean setting
);
Sets whether this header bar shows the standard window decorations, including close, maximize, and minimize.
Since: 0.0.10
gboolean
hdy_header_bar_get_has_subtitle (HdyHeaderBar *self
);
Retrieves whether the header bar reserves space for a subtitle, regardless if one is currently set or not.
Since: 0.0.10
void hdy_header_bar_set_has_subtitle (HdyHeaderBar *self
,gboolean setting
);
Sets whether the header bar should reserve space for a subtitle, even if none is currently set.
Since: 0.0.10
const gchar *
hdy_header_bar_get_decoration_layout (HdyHeaderBar *self
);
Gets the decoration layout set with
hdy_header_bar_set_decoration_layout()
.
Since: 0.0.10
void hdy_header_bar_set_decoration_layout (HdyHeaderBar *self
,const gchar *layout
);
Sets the decoration layout for this header bar, overriding the “gtk-decoration-layout” setting.
There can be valid reasons for overriding the setting, such as a header bar design that does not allow for buttons to take room on the right, or only offers room for a single close button. Split header bars are another example for overriding the 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, icon (the window icon) and menu (a menu button for the fallback app menu).
For example, “menu:minimize,maximize,close” specifies a menu on the left, and minimize, maximize and close buttons on the right.
Since: 0.0.10
HdyCenteringPolicy
hdy_header_bar_get_centering_policy (HdyHeaderBar *self
);
Gets the policy self
follows to horizontally align its center widget.
Since: 0.0.10
void hdy_header_bar_set_centering_policy (HdyHeaderBar *self
,HdyCenteringPolicy centering_policy
);
Sets the policy self
must follow to horizontally align its center widget.
Since: 0.0.10
guint
hdy_header_bar_get_transition_duration
(HdyHeaderBar *self
);
Returns the amount of time (in milliseconds) that
transitions between pages in self
will take.
Since: 0.0.10
void hdy_header_bar_set_transition_duration (HdyHeaderBar *self
,guint duration
);
Sets the duration that transitions between pages in self
will take.
Since: 0.0.10
gboolean
hdy_header_bar_get_transition_running (HdyHeaderBar *self
);
Returns whether the self
is currently in a transition from one page to
another.
Since: 0.0.10
gboolean
hdy_header_bar_get_interpolate_size (HdyHeaderBar *self
);
Gets wether self
should interpolate its size on visible child change.
See hdy_header_bar_set_interpolate_size()
.
Since: 0.0.10
void hdy_header_bar_set_interpolate_size (HdyHeaderBar *self
,gboolean interpolate_size
);
Sets whether or not self
will interpolate the size of its opposing
orientation when changing the visible child. If TRUE
, self
will interpolate
its size between the one of the previous visible child and the one of the new
visible child, according to the set transition duration and the orientation,
e.g. if self
is horizontal, it will interpolate the its height.
Since: 0.0.10
“centering-policy”
property“centering-policy” HdyCenteringPolicy
The policy to horizontally align the center widget.
Flags: Read / Write
Default value: HDY_CENTERING_POLICY_LOOSE
“custom-title”
property“custom-title” GtkWidget *
Custom title widget to display.
Flags: Read / Write
“decoration-layout”
property“decoration-layout” gchar *
The decoration layout for buttons. If this property is not set, the “gtk-decoration-layout” setting is used.
See hdy_header_bar_set_decoration_layout()
for information
about the format of this string.
Flags: Read / Write
Default value: NULL
Since: 0.0.10
“decoration-layout-set”
property“decoration-layout-set” gboolean
Set to TRUE
if “decoration-layout” is set.
Flags: Read / Write
Default value: FALSE
Since: 0.0.10
“has-subtitle”
property“has-subtitle” gboolean
If TRUE
, reserve space for a subtitle, even if none
is currently set.
Flags: Read / Write
Default value: TRUE
Since: 0.0.10
“interpolate-size”
property“interpolate-size” gboolean
Whether or not the size should smoothly change when changing between differently sized children.
Flags: Read / Write
Default value: FALSE
“show-close-button”
property“show-close-button” gboolean
Whether to show window decorations.
Which buttons are actually shown and where is determined by the “decoration-layout” property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).
Flags: Read / Write
Default value: FALSE
Since: 0.0.10
“spacing”
property“spacing” gint
The amount of space between children.
Flags: Read / Write
Allowed values: >= 0
Default value: 6
“subtitle”
property“subtitle” gchar *
The subtitle to display.
Flags: Read / Write
Default value: NULL
“transition-duration”
property“transition-duration” guint
The animation duration, in milliseconds.
Flags: Read / Write
Default value: 200
“transition-running”
property“transition-running” gboolean
Whether or not the transition is currently running.
Flags: Read
Default value: FALSE