Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GtkOverlay is a container which contains a single main child, on top
of which it can place “overlay” widgets. The position of each overlay
widget is determined by its Widget
:halign
and Widget
:valign
properties. E.g. a widget with both alignments set to AlignStart
will be placed at the top left corner of the GtkOverlay container,
whereas an overlay with halign set to AlignCenter
and valign set
to AlignEnd
will be placed a the bottom edge of the GtkOverlay,
horizontally centered. The position can be adjusted by setting the margin
properties of the child to non-zero values.
More complicated placement of overlays is possible by connecting to the getChildPosition signal.
GtkOverlay as GtkBuildable
The GtkOverlay implementation of the GtkBuildable interface
supports placing a child as an overlay by specifying “overlay” as
the “type” attribute of a <child>
element.
CSS nodes
GtkOverlay has a single CSS node with the name “overlay”. Overlay children whose alignments cause them to be positioned at an edge get the style classes “.left”, “.right”, “.top”, and/or “.bottom” according to their position.
Synopsis
- newtype Overlay = Overlay (ManagedPtr Overlay)
- class (GObject o, IsDescendantOf Overlay o) => IsOverlay o
- toOverlay :: (MonadIO m, IsOverlay o) => o -> m Overlay
- noOverlay :: Maybe Overlay
- overlayAddOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> m ()
- overlayGetClipOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> m Bool
- overlayGetMeasureOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> m Bool
- overlayNew :: (HasCallStack, MonadIO m) => m Overlay
- overlaySetClipOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> Bool -> m ()
- overlaySetMeasureOverlay :: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) => a -> b -> Bool -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Overlay Source # | |
IsGValue Overlay Source # | Convert |
GObject Overlay Source # | |
Defined in GI.Gtk.Objects.Overlay gobjectType :: IO GType # | |
HasParentTypes Overlay Source # | |
Defined in GI.Gtk.Objects.Overlay | |
type ParentTypes Overlay Source # | |
Defined in GI.Gtk.Objects.Overlay |
class (GObject o, IsDescendantOf Overlay o) => IsOverlay o Source #
Instances
(GObject o, IsDescendantOf Overlay o) => IsOverlay o Source # | |
Defined in GI.Gtk.Objects.Overlay |
Methods
Overloaded methods
addOverlay
:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) | |
=> a |
|
-> b |
|
-> m () |
Adds widget
to overlay
.
The widget will be stacked on top of the main widget
added with containerAdd
.
The position at which widget
is placed is determined
from its Widget
:halign
and Widget
:valign
properties.
getClipOverlay
overlayGetClipOverlay Source #
:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether the widget is clipped within the parent. |
Convenience function to get the value of the Overlay
:clip-overlay
child property for widget
.
getMeasureOverlay
overlayGetMeasureOverlay Source #
:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether the widget is measured |
Gets whether widget
's size is included in the measurement of
overlay
.
new
:: (HasCallStack, MonadIO m) | |
=> m Overlay | Returns: a new |
Creates a new Overlay
.
setClipOverlay
overlaySetClipOverlay Source #
:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m () |
Convenience function to set the value of the Overlay
:clip-overlay
child property for widget
.
setMeasureOverlay
overlaySetMeasureOverlay Source #
:: (HasCallStack, MonadIO m, IsOverlay a, IsWidget b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m () |
Sets whether widget
is included in the measured size of overlay
.
The overlay will request the size of the largest child that has
this property set to True
. Children who are not included may
be drawn outside of overlay
's allocation if they are too large.