Flap
Object Hierarchy:
Hdy.Flap
Hdy.Flap
Hdy.Flap
Gtk.Container
Gtk.Container
Gtk.Container->Hdy.Flap
Gtk.Widget
Gtk.Widget
Gtk.Widget->Gtk.Container
GLib.InitiallyUnowned
GLib.InitiallyUnowned
GLib.InitiallyUnowned->Gtk.Widget
GLib.Object
GLib.Object
GLib.Object->GLib.InitiallyUnowned
Atk.Implementor
Atk.Implementor
Atk.Implementor->Hdy.Flap
Atk.Implementor->Gtk.Container
Atk.Implementor->Gtk.Widget
Gtk.Buildable
Gtk.Buildable
Gtk.Buildable->Hdy.Flap
Gtk.Buildable->Gtk.Container
Gtk.Buildable->Gtk.Widget
Gtk.Orientable
Gtk.Orientable
Gtk.Orientable->Hdy.Flap
Hdy.Swipeable
Hdy.Swipeable
Hdy.Swipeable->Hdy.Flap
Description:
[
CCode ( type_id =
"hdy_flap_get_type ()" ) ]
[
Version ( since =
"1.2" ) ]
public class Flap :
Container ,
Implementor ,
Buildable ,
Orientable ,
Swipeable
An adaptive container acting like a box or an overlay.
The `HdyFlap` widget can display its children like a [[email protected] ] does or like a [[email protected] ] does, according to the [
property@Flap:fold-policy] value.
`HdyFlap` has at most three children: [property@Flap:content], [property@Flap:flap] and [property@Flap:separator]. Content is the primary
child, flap is displayed next to it when unfolded, or overlays it when folded. Flap can be shown or hidden by changing the [
property@Flap:reveal-flap] value, as well as via swipe gestures if [property@Flap:swipe-to-open] and/or [property@Flap:swipe-to-close] are
set to `TRUE`.
Optionally, a separator can be provided, which would be displayed between the content and the flap when there's no shadow to separate
them, depending on the transition type.
[property@Flap:flap] is transparent by default; add the `.background` style class to it if this is unwanted.
If [property@Flap:modal] is set to `TRUE`, content becomes completely inaccessible when the flap is revealed while folded.
The position of the flap and separator children relative to the content is determined by orientation, as well as the [
property@Flap:flap-position] value.
Folding the flap will automatically hide the flap widget, and unfolding it will automatically reveal it. If this behavior is not desired,
the [property@Flap:locked] property can be used to override it.
Common use cases include sidebars, header bars that need to be able to overlap the window content (for example, in fullscreen mode) and
bottom sheets.
HdyFlap as GtkBuildable
The `HdyFlap` implementation of the [[email protected] ] interface supports setting the flap child by specifying “flap” as the
“type” attribute of a <child> element, and separator by specifying “separator”. Specifying “content” child type or
omitting it results in setting the content child.
CSS nodes
`HdyFlap` has a single CSS node with name `flap`. The node will get the style classes `.folded` when it is folded, and `.unfolded` when
it's not.
Content:
Properties:
public Widget content { get ; set ; }
The content widget.
public Widget flap { get ; set ; }
The flap widget.
public PackType flap_position { get ; set ; }
The flap position.
public uint fold_duration { get ; set ; }
The fold transition animation duration, in milliseconds.
public FlapFoldPolicy fold_policy { get ; set ; }
The current fold policy.
public bool folded { get ; }
Whether the flap is currently folded.
public bool locked { get ; set ; }
Whether the flap is locked.
public bool modal { get ; set ; }
Whether the flap is modal.
public uint reveal_duration { get ; set ; }
The reveal transition animation duration, in milliseconds.
public bool reveal_flap { get ; set ; }
Whether the flap widget is revealed.
public double reveal_progress { get ; }
The current reveal transition progress.
public Widget separator { get ; set ; }
The separator widget.
public bool swipe_to_close { get ; set ; }
Whether the flap can be closed with a swipe gesture.
public bool swipe_to_open { get ; set ; }
Whether the flap can be opened with a swipe gesture.
public FlapTransitionType transition_type { get ; set ; }
the type of animation used for reveal and fold transitions.
Creation methods:
public Flap ()
Creates a new `HdyFlap`.
Methods:
public unowned Widget ? get_content ()
Gets the content widget for this
public unowned Widget ? get_flap ()
Gets the flap widget for this
public PackType get_flap_position ()
Gets the flap position for this .
public uint get_fold_duration ()
Gets the amount of time that fold transitions will take.
public FlapFoldPolicy get_fold_policy ()
Gets the current fold policy of this
.
public bool get_folded ()
Gets whether this is currently
folded.
public bool get_locked ()
Gets whether this is locked.
public bool get_modal ()
Gets whether the this is modal.
public uint get_reveal_duration ()
Gets the amount of time that reveal transitions will take.
public bool get_reveal_flap ()
Gets whether the flap widget is revealed for
this .
public double get_reveal_progress ()
Gets the current reveal transition progress for
this .
public unowned Widget ? get_separator ()
Gets the separator widget for this .
public bool get_swipe_to_close ()
Gets whether this can be closed with
a swipe gesture.
public bool get_swipe_to_open ()
Gets whether this can be opened with
a swipe gesture.
public FlapTransitionType get_transition_type ()
Gets the type of animation used for reveal and fold transitions in
this .
public void set_content (Widget ? content)
Sets the content widget for this .
public void set_flap (Widget ? flap)
Sets the flap widget for this .
public void set_flap_position (PackType position)
Sets the flap position for this .
public void set_fold_duration (uint duration)
Sets the duration that fold transitions will take.
public void set_fold_policy (FlapFoldPolicy policy)
Sets the current fold policy for this
.
public void set_locked (bool locked)
Sets whether this is locked.
public void set_modal (bool modal)
Sets whether the this can be closed
with a click.
public void set_reveal_duration (uint duration)
Sets the duration that reveal transitions in
this will take.
public void set_reveal_flap (bool reveal_flap)
Sets whether the flap widget is revealed for
this .
public void set_separator (Widget ? separator)
Sets the separator widget for this .
public void set_swipe_to_close (bool swipe_to_close)
Sets whether this can be closed with
a swipe gesture.
public void set_swipe_to_open (bool swipe_to_open)
Sets whether this can be opened with
a swipe gesture.
public void set_transition_type (FlapTransitionType transition_type)
Sets the type of animation used for reveal and fold transitions in
this .
Inherited Members:
All known members inherited from class Gtk.Container
@foreach
add
add_with_properties
border_width
check_resize
child
child_get
child_get_property
child_get_valist
child_notify
child_notify_by_pspec
child_set
child_set_property
child_set_valist
child_type
class_find_child_property
class_list_child_properties
composite_name
find_child_property
forall
forall_internal
get_border_width
get_child_property
get_children
get_focus_chain
get_focus_child
get_focus_hadjustment
get_focus_vadjustment
get_path_for_child
get_resize_mode
handle_border_width
install_child_properties
install_child_property
list_child_properties
propagate_draw
remove
resize_children
resize_mode
set_border_width
set_child_property
set_focus_chain
set_focus_child
set_focus_hadjustment
set_focus_vadjustment
set_reallocate_redraws
set_resize_mode
unset_focus_chain
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Buildable
add_child
construct_child
custom_finished
custom_tag_end
custom_tag_start
get_internal_child
get_name
parser_finished
set_buildable_property
set_name
All known members inherited from interface Gtk.Orientable
All known members inherited from interface Hdy.Swipeable