OverlayBar


Object Hierarchy:

Granite.Widgets.OverlayBar Granite.Widgets.OverlayBar Granite.Widgets.OverlayBar Gtk.EventBox Gtk.EventBox Gtk.EventBox->Granite.Widgets.OverlayBar Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.EventBox Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin 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->Gtk.EventBox Atk.Implementor->Gtk.Bin Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.EventBox Gtk.Buildable->Gtk.Bin Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget

Description:


public class OverlayBar : EventBox

A floating status bar that displays a single line of text.

This widget is intended to be used as an overlay for a Gtk.Overlay and is placed in the bottom-right corner by default. You can change its position like you would do for any overlay widget used in a Gtk.Overlay.

The Overlay Bar displays a single line of text that can be changed using the "status" property.

This widget tries to avoid getting in front of the content being displayed inside the Gtk.Overlay by moving itself horizontally to the opposite side from the current one when the mouse pointer enters the widget.

For this widget to function correctly, the event Gdk.EventMask.ENTER_NOTIFY_MASK must be set for the parent Gtk.Overlay. Overlay Bar's constructor takes care of this automatically, if the parent is supplied as a parameter, but you have to be careful not to unset the event for the Gtk.Overlay at a later stage.

Example

public class OverlayBarView : Gtk.Overlay {
construct {
var button = new Gtk.ToggleButton.with_label ("Show Spinner");

var grid = new Gtk.Grid ();
grid.halign = Gtk.Align.CENTER;
grid.valign = Gtk.Align.CENTER;
grid.add (button);

var overlaybar = new Granite.Widgets.OverlayBar (this);
overlaybar.label = "Hover the OverlayBar to change its position";

add (grid);

button.toggled.connect (() => {
overlaybar.active = button.active;
});
}
}

See also:

Gtk.Overlay


Namespace: Granite.Widgets
Package: granite

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.EventBox
All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Container
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Buildable



2022 vala-language.org