Handy.ViewSwitcherBar¶
- 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 |
Whether the view switcher is revealed |
||
r/w/en |
Stack |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Handy.ViewSwitcherBar(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A view switcher action bar.
An action bar letting you switch between multiple views offered by a [class`Gtk`.Stack], via an [class`ViewSwitcher`]. It is designed to be put at the bottom of a window and to be revealed only on really narrow windows e.g. on mobile phones. It can’t be revealed if there are less than two pages.
HdyViewSwitcherBar
is intended to be used together with [class`ViewSwitcherTitle`].A common use case is to bind the [property`ViewSwitcherBar`:py:data::reveal<Handy.ViewSwitcherBar.props.reveal>] property to [property`ViewSwitcherTitle`:py:data::title-visible<Handy.ViewSwitcherBar.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
HdyViewSwitcherBar
has a single CSS node with nameviewswitcherbar
.New in version 1.0.
- classmethod new()¶
- Returns:
the newly created
HdyViewSwitcherBar
- Return type:
Creates a new
HdyViewSwitcherBar
.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_reveal()¶
- Returns:
whether self is revealed
- Return type:
Gets whether self should be revealed or hidden.
New in version 1.0.
- get_stack()¶
-
Get the [class`Gtk`.Stack] being controlled by the [class`ViewSwitcher`].
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.
Property Details¶
- Handy.ViewSwitcherBar.props.policy¶
- Name:
policy
- Type:
- Default Value:
- Flags:
The policy used to determine which mode to use.
New in version 1.0.
- Handy.ViewSwitcherBar.props.reveal¶
- Name:
reveal
- Type:
- Default Value:
- Flags:
Whether the bar should be revealed or hidden.
New in version 1.0.