sugar4.graphics.window
Window management for Sugar activities.
Provides window classes for managing Sugar activity windows with fullscreen support, toolbar management, and tray integration.
- Classes:
UnfullscreenButton: Button to exit fullscreen mode Window: Main activity window container
Classes
A ready-made "Unfullscreen" button. |
|
A Sugar activity window. |
Module Contents
- class sugar4.graphics.window.UnfullscreenButton[source]
Bases:
gi.repository.Gtk.WindowA ready-made “Unfullscreen” button.
Used by
Windowto exit fullscreen mode using modern window management.
- class sugar4.graphics.window.Window(**kwargs)[source]
Bases:
gi.repository.Gtk.ApplicationWindowA Sugar activity window.
Used as a container to display things that happen in an activity. A window contains a canvas widget, and may contain toolbar and tray widgets.
- The window layout is:
toolbar (optional)
alerts (as overlays)
canvas (main content)
tray (optional)
Window supports fullscreen mode where toolbar and tray are hidden.
- Key bindings:
Escape: exit fullscreen mode
Alt+Space: toggle tray visibility
- reveal()[source]
Make window active.
Brings the window to the top and makes it active, even after invoking on response to non-GTK events.
- is_fullscreen()[source]
Check if the window is fullscreen.
- Returns:
window is fullscreen
- Return type:
- fullscreen()[source]
Make the window fullscreen.
The toolbar and tray will be hidden, and the UnfullscreenButton will be shown for a short time.
- unfullscreen()[source]
Restore the window to non-fullscreen mode.
The UnfullscreenButton will be hidden, and the toolbar and tray will be shown.
- set_canvas(canvas)[source]
Set canvas widget.
- Parameters:
canvas (Gtk.Widget) – the canvas to set
- set_toolbar_box(toolbar_box)[source]
Set toolbar box widget.
- Parameters:
toolbar_box (Gtk.Widget) – the toolbar box to set
- set_tray(tray, position=Gtk.PositionType.BOTTOM)[source]
Set the tray.
- Parameters:
tray (Gtk.Widget) – the tray to set
position (Gtk.PositionType) – the edge to set the tray at
- add_alert(alert)[source]
Add an alert to the window as an overlay.
- Parameters:
alert (Gtk.Widget) – the alert to add
- remove_alert(alert)[source]
Remove an alert from the window.
- Parameters:
alert (Gtk.Widget) – the alert to remove
- set_enable_fullscreen_mode(enable)[source]
Set enable fullscreen mode.
- Parameters:
enable (bool) – enable fullscreen mode