Handy.ViewSwitcherTitle¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), 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 determine the mode to use |
||
r/w/en |
Stack |
||
r/w/en |
The subtitle to display |
||
r/w/en |
The title to display |
||
r/en |
Whether the title label is visible |
||
r/w/en |
Whether the view switcher is enabled |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Handy.ViewSwitcherTitle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A view switcher title.
A widget letting you switch between multiple views contained by a [class`Gtk`.Stack], via an [class`ViewSwitcher`].
It is designed to be used as the title widget of a [class`HeaderBar`], and will display the window’s title when the window is too narrow to fit the view switcher e.g. on mobile phones, or if there are less than two views.
HdyViewSwitcherTitle
is intended to be used together with [class`ViewSwitcherBar`].A common use case is to bind the [property`ViewSwitcherBar`:py:data::reveal<Handy.ViewSwitcherTitle.props.reveal>] property to [property`ViewSwitcherTitle`:py:data::title-visible<Handy.ViewSwitcherTitle.props.title_visible>] to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher, as follows:
``xml <object class=”GtkWindow”/>
- <child type=”titlebar”>
- <object class=”HdyHeaderBar”>
<property name=”centering-policy”>strict</property> <child type=”title”>
- <object class=”HdyViewSwitcherTitle”
id=”view_switcher_title”>
<property name=”stack”>stack</property>
</object>
</child>
</object>
</child> <child>
- <object class=”GtkBox”>
- <child>
<object class=”GtkStack” id=”stack”/>
</child> <child>
- <object class=”HdyViewSwitcherBar”>
<property name=”stack”>stack</property> <property name=”reveal”
bind-source=”view_switcher_title” bind-property=”title-visible” bind-flags=”sync-create”/>
</object>
</child>
</object>
</child>
</object> ``
- CSS nodes
HdyViewSwitcherTitle
has a single CSS node with nameviewswitchertitle
.New in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdyViewSwitcherTitle
- Return type:
Creates a new
HdyViewSwitcherTitle
.New in version 1.0.
- get_policy()¶
- Returns:
the policy of self
- Return type:
Gets the policy of self.
New in version 1.0.
- get_stack()¶
-
Gets the stack controlled by self.
New in version 1.0.
- get_subtitle()¶
-
Gets the subtitle of self.
New in version 1.0.
- get_title()¶
-
Gets the title of self.
New in version 1.0.
- get_title_visible()¶
- Returns:
whether the title of self is currently visible
- Return type:
Gets whether the title of self is currently visible.
New in version 1.0.
- get_view_switcher_enabled()¶
- Returns:
whether the view switcher is enabled
- Return type:
Gets whether self's view switcher is enabled.
New in version 1.0.
- set_policy(policy)¶
- Parameters:
policy (
Handy.ViewSwitcherPolicy
) – the new policy
Sets the policy of self.
New in version 1.0.
- set_stack(stack)¶
-
Sets the [class`Gtk`.Stack] to control.
New in version 1.0.
- set_subtitle(subtitle)¶
-
Sets the subtitle of self.
New in version 1.0.
- set_title(title)¶
-
Sets the title of self.
New in version 1.0.
Property Details¶
- Handy.ViewSwitcherTitle.props.policy¶
- Name:
policy
- Type:
- Default Value:
- Flags:
The policy used to determine which mode to use.
New in version 1.0.
- Handy.ViewSwitcherTitle.props.stack¶
- Name:
stack
- Type:
- Default Value:
- Flags:
The [class`Gtk`.Stack] the [class`ViewSwitcher`] controls.
New in version 1.0.
- Handy.ViewSwitcherTitle.props.subtitle¶
- Name:
subtitle
- Type:
- Default Value:
- Flags:
The subtitle of the [class`ViewSwitcher`].
The subtitle should give a user additional details.
New in version 1.0.
- Handy.ViewSwitcherTitle.props.title¶
- Name:
title
- Type:
- Default Value:
- Flags:
The title of the [class`ViewSwitcher`].
The title should give a user additional details. A good title should not include the application name.
New in version 1.0.
- Handy.ViewSwitcherTitle.props.title_visible¶
- Name:
title-visible
- Type:
- Default Value:
- Flags:
Whether the bar should be revealed or hidden.
New in version 1.0.
- Handy.ViewSwitcherTitle.props.view_switcher_enabled¶
- Name:
view-switcher-enabled
- Type:
- Default Value:
- Flags:
Whether the bar should be revealed or hidden.
If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher even if it fits in the available space.
This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.
New in version 1.0.