sugar4.graphics.palette

Classes

Palette

Floating palette implementation.

PaletteActionBar

Module Contents

class sugar4.graphics.palette.Palette(label=None, accel_path=None, text_maxlen=style.MENU_WIDTH_CHARS, **kwargs)[source]

Bases: sugar4.graphics.palettewindow.PaletteWindow

Floating palette implementation.

This class dynamically switches between one of two encapsulated child widget types: a _PaletteWindowWidget or a _PaletteMenuWidget.

The window widget, created by default, acts as the container for any type of widget the user may wish to add. It can optionally display primary text, secondary text, and an icon at the top of the palette.

If the user attempts to access the ‘menu’ property, the window widget is destroyed and the palette is dynamically switched to use a menu widget. This maintains the same look and feel as a normal palette, allowing submenus and so on.

__gsignals__[source]
__gtype_name__ = 'SugarPalette'[source]
action_bar[source]
get_full_size_request()[source]

Get the full size request for the palette.

popup(immediate=False)[source]

Show the palette.

popdown(immediate=False, state=None)[source]

Hide the palette.

Parameters:
  • immediate (bool) – if True, hide instantly. If False, use animation.

  • state – deprecated parameter, ignored.

on_enter()[source]
set_primary_text(label, accel_path=None)[source]
get_primary_text()[source]
primary_text[source]
set_secondary_text(label)[source]
get_secondary_text()[source]
secondary_text[source]
set_icon(icon)[source]
get_icon()[source]
icon[source]
set_icon_visible(visible)[source]
get_icon_visible()[source]
icon_visible[source]
set_content(widget)[source]

Set the main content widget for the palette window.

get_label_width()[source]
get_menu()[source]
menu[source]
class sugar4.graphics.palette.PaletteActionBar[source]

Bases: gi.repository.Gtk.Box

add_action(label, icon_name=None)[source]