Handy.HeaderBar¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The policy to horizontally align the center widget |
||
r/w |
Custom title widget to display |
||
r/w |
The layout for window decorations |
||
r/w |
Whether the decoration-layout property has been set |
||
r/w/en |
Whether to reserve space for a subtitle |
||
r/w/en |
Whether or not the size should smoothly change when changing between differently sized children |
||
r/w/en |
Whether to show window decorations |
||
r/w/en |
The amount of space between children |
||
r/w |
The subtitle to display |
||
r/w |
The title to display |
||
r/w/en |
The animation duration, in milliseconds |
||
r |
Whether or not the transition is currently running |
Child Properties¶
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
r/w |
A |
||
|
|
r/w |
The index of the child in the parent |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Handy.HeaderBar(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A title bar widget.
HdyHeaderBar
is similar to [class`Gtk`.HeaderBar] 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 [class`ViewSwitcher`].When used in a mobile dialog,
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.HdyHeaderBar
can be used in window’s content area rather than titlebar, and will still be draggable and will handle right click, middle click and double click as expected from a titlebar. This is particularly useful with [class`Window`] or [class`ApplicationWindow`].- CSS nodes
HdyHeaderBar
has a single CSS node with nameheaderbar
.New in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdyHeaderBar
.- Return type:
Creates a new
HdyHeaderBar
.New in version 1.0.
- get_centering_policy()¶
- Returns:
the centering policy
- Return type:
Gets the policy self follows to horizontally align its center widget.
New in version 1.0.
- get_custom_title()¶
- Returns:
the custom title widget of the header
- Return type:
Gtk.Widget
orNone
Retrieves the custom title widget of the header.
New in version 1.0.
- get_decoration_layout()¶
- Returns:
the decoration layout
- Return type:
Gets the decoration layout.
New in version 1.0.
- get_has_subtitle()¶
- Returns:
TRUE
if the header bar reserves space for a subtitle- Return type:
Gets whether space is reserved for a subtitle, regardless if one is currently set or not.
New in version 1.0.
- get_interpolate_size()¶
- Returns:
whether self interpolates its size on visible child change
- Return type:
Gets whether self should interpolate its size on visible child change.
New in version 1.0.
- get_show_close_button()¶
- Returns:
whether decorations are shown
- Return type:
Gets whether this header bar shows the standard window decorations.
New in version 1.0.
- get_subtitle()¶
-
Gets the subtitle of the header.
New in version 1.0.
- get_title()¶
-
Retrieves the title of the header.
New in version 1.0.
- get_transition_duration()¶
- Returns:
the transition duration, in milliseconds
- Return type:
Gets the amount of time that transitions between pages will take.
New in version 1.0.
- get_transition_running()¶
- Returns:
whether the transition is currently running
- Return type:
Gets whether the self is currently in a transition from one page to another.
New in version 1.0.
- pack_end(child)¶
- Parameters:
child (
Gtk.Widget
) – the widget to be added to self
Adds child to self, packed with reference to the end of the self.
New in version 1.0.
- pack_start(child)¶
- Parameters:
child (
Gtk.Widget
) – the widget to be added to self
Adds child to self, packed with reference to the start of the self.
New in version 1.0.
- set_centering_policy(centering_policy)¶
- Parameters:
centering_policy (
Handy.CenteringPolicy
) – the centering policy
Sets the policy self must follow to horizontally align its center widget.
New in version 1.0.
- set_custom_title(title_widget)¶
- Parameters:
title_widget (
Gtk.Widget
orNone
) – a custom widget to use for a title
Sets a custom title for the header bar.
The title should help a user identify the current view. This supersedes any title set by [method`HeaderBar`.set_title] or [method`HeaderBar`.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.New in version 1.0.
- set_decoration_layout(layout)¶
-
Sets the decoration layout for this header bar.
New in version 1.0.
- set_has_subtitle(setting)¶
- Parameters:
setting (
bool
) –TRUE
to reserve space for a subtitle
Sets whether space is reserved for a subtitle, even if none is currently set.
New in version 1.0.
- set_interpolate_size(interpolate_size)¶
- Parameters:
interpolate_size (
bool
) –TRUE
to interpolate the size
Sets whether self should interpolate its size on visible child change.
New in version 1.0.
- set_show_close_button(setting)¶
- Parameters:
setting (
bool
) –TRUE
to show standard window decorations
Sets whether this header bar shows the standard window decorations.
New in version 1.0.
- set_subtitle(subtitle)¶
-
Sets the subtitle of the header bar.
The title should give a user an additional detail to help them identify the current view.
Note that [class`HeaderBar`] by default reserves room for the subtitle, even if none is currently set. If this is not desired, set the [property`HeaderBar`:py:data::has-subtitle<Handy.HeaderBar.props.has_subtitle>] property to
FALSE
.New in version 1.0.
- set_title(title)¶
-
Sets the title of the [class`HeaderBar`].
The title should help a user identify the current view. A good title should not include the application name.
New in version 1.0.
Property Details¶
- Handy.HeaderBar.props.centering_policy¶
- Name:
centering-policy
- Type:
- Default Value:
- Flags:
The policy for aligning the center widget.
New in version 1.0.
- Handy.HeaderBar.props.custom_title¶
- Name:
custom-title
- Type:
- Default Value:
- Flags:
Custom title widget to display.
New in version 1.0.
- Handy.HeaderBar.props.decoration_layout¶
-
The decoration layout for buttons.
If this property is not set, the [property`Gtk`.Settings:gtk-decoration-layout] setting is used.
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 start from those on the end. 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.
New in version 1.0.
- Handy.HeaderBar.props.decoration_layout_set¶
-
Whether [property`HeaderBar`:py:data::decoration-layout<Handy.HeaderBar.props.decoration_layout>] is set.
New in version 1.0.
- Handy.HeaderBar.props.has_subtitle¶
- Name:
has-subtitle
- Type:
- Default Value:
- Flags:
Whether to reserve space for a subtitle, even if none is currently set.
New in version 1.0.
- Handy.HeaderBar.props.interpolate_size¶
- Name:
interpolate-size
- Type:
- Default Value:
- Flags:
Whether the size should smoothly change when changing between children.
If
TRUE
, the header bar 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 the orientation is horizontal, it will interpolate the its height.New in version 1.0.
- Handy.HeaderBar.props.show_close_button¶
- Name:
show-close-button
- Type:
- Default Value:
- Flags:
Whether to show window decorations.
Which buttons are actually shown and where is determined by the [property`HeaderBar`:py:data::decoration-layout<Handy.HeaderBar.props.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).
New in version 1.0.
- Handy.HeaderBar.props.spacing¶
- Name:
spacing
- Type:
- Default Value:
6
- Flags:
The amount of space between children.
New in version 1.0.
- Handy.HeaderBar.props.subtitle¶
-
The subtitle to display.
New in version 1.0.
- Handy.HeaderBar.props.title¶
-
The title to display.
New in version 1.0.
- Handy.HeaderBar.props.transition_duration¶
- Name:
transition-duration
- Type:
- Default Value:
200
- Flags:
The transition duration, in milliseconds.
New in version 1.0.