Top |
gint | icon-size | Read / Write |
PangoEllipsizeMode | narrow-ellipsize | Read / Write |
HdyViewSwitcherPolicy | policy | Read / Write |
GtkStack * | stack | Read / Write |
GEnum ╰── HdyViewSwitcherPolicy GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── HdyViewSwitcher
HdyViewSwitcher implements AtkImplementorIface, GtkBuildable and GtkOrientable.
An adaptive view switcher, designed to switch between multiple views in a similar fashion than a GtkStackSwitcher.
Depending on the available width, the view switcher can adapt from a wide mode showing the view's icon and title side by side, to a narrow mode showing the view's icon and title one on top of the other, in a more compact way. This can be controlled via the policy property.
To look good in a header bar, an HdyViewSwitcher requires to fill its full height. Contrary to GtkHeaderBar, HdyHeaderBar doesn't force a vertical alignment on its title widget, so we recommend it over GtkHeaderBar.
HdyViewSwitcher *
hdy_view_switcher_new (void
);
Creates a new HdyViewSwitcher widget.
Since: 0.0.10
HdyViewSwitcherPolicy
hdy_view_switcher_get_policy (HdyViewSwitcher *self
);
Gets the policy of self
.
Since: 0.0.10
void hdy_view_switcher_set_policy (HdyViewSwitcher *self
,HdyViewSwitcherPolicy policy
);
Sets the policy of self
.
Since: 0.0.10
GtkIconSize
hdy_view_switcher_get_icon_size (HdyViewSwitcher *self
);
Get the icon size of the images used in the HdyViewSwitcher.
See: hdy_view_switcher_set_icon_size()
Since: 0.0.10
void hdy_view_switcher_set_icon_size (HdyViewSwitcher *self
,GtkIconSize icon_size
);
Change the icon size hint for the icons in a HdyViewSwitcher.
Since: 0.0.10
PangoEllipsizeMode
hdy_view_switcher_get_narrow_ellipsize
(HdyViewSwitcher *self
);
Get the ellipsizing position of the narrow mode label. See
hdy_view_switcher_set_narrow_ellipsize()
.
Since: 0.0.10
void hdy_view_switcher_set_narrow_ellipsize (HdyViewSwitcher *self
,PangoEllipsizeMode mode
);
Set the mode used to ellipsize the text in narrow mode if there is not enough space to render the entire string.
Since: 0.0.10
GtkStack *
hdy_view_switcher_get_stack (HdyViewSwitcher *self
);
Get the GtkStack being controlled by the HdyViewSwitcher.
See: hdy_view_switcher_set_stack()
Since: 0.0.10
void hdy_view_switcher_set_stack (HdyViewSwitcher *self
,GtkStack *stack
);
Sets the GtkStack to control.
Since: 0.0.10
“icon-size”
property“icon-size” gint
Use the "icon-size" property to hint the icons to use, you almost certainly
want to leave this as GTK_ICON_SIZE_BUTTON
.
Flags: Read / Write
Allowed values: >= 0
Default value: 4
Since: 0.0.10
“narrow-ellipsize”
property“narrow-ellipsize” PangoEllipsizeMode
The preferred place to ellipsize the string, if the narrow mode label does not have enough room to display the entire string, specified as a PangoEllipsizeMode.
Note that setting this property to a value other than PANGO_ELLIPSIZE_NONE
has the side-effect that the label requests only enough space to display
the ellipsis.
Flags: Read / Write
Default value: PANGO_ELLIPSIZE_NONE
Since: 0.0.10
“policy”
property“policy” HdyViewSwitcherPolicy
The HdyViewSwitcherPolicy the view switcher should use to determine which mode to use.
Flags: Read / Write
Default value: HDY_VIEW_SWITCHER_POLICY_AUTO
Since: 0.0.10