sugar4.graphics.palettewindow

Attributes

print

Classes

MouseSpeedDetector

Detects mouse movement speed for palette activation.

PaletteWindow

Base class for palette windows.

Invoker

Base class for palette invokers.

WidgetInvoker

Invoker for general widgets.

CursorInvoker

Invoker that tracks cursor position.

ToolInvoker

A palette invoker for toolbar buttons and other items. this invoker

TreeViewInvoker

Invoker for TreeView cells.

Module Contents

sugar4.graphics.palettewindow.print[source]
class sugar4.graphics.palettewindow.MouseSpeedDetector(delay, thresh)[source]

Bases: gi.repository.GObject.GObject

Detects mouse movement speed for palette activation.

Create MouseSpeedDetector object.

Parameters:
  • delay – delay in msec

  • thresh – threshold in pixels (per tick of ‘delay’ msec)

__gsignals__[source]
parent = None[source]
start()[source]

Start detecting mouse speed.

stop()[source]

Stop detecting mouse speed.

class sugar4.graphics.palettewindow.PaletteWindow(**kwargs)[source]

Bases: gi.repository.GObject.GObject

Base class for palette windows.

__gsignals__[source]
destroy()[source]
set_invoker(invoker)[source]
get_invoker()[source]
invoker[source]
set_content(widget)[source]

Set the main content widget for the palette window.

is_up()[source]
set_group_id(group_id)[source]
get_group_id()[source]

Get the current group ID.

group_id[source]
update_position()[source]

Update the position of the palette.

get_full_size_request()[source]

Get the full size request for the palette.

popup(immediate=False)[source]

Show the palette.

popdown(immediate=False)[source]

Hide the palette.

on_invoker_enter()[source]
on_invoker_leave()[source]
on_enter()[source]
on_leave()[source]
get_rect()[source]
class sugar4.graphics.palettewindow.Invoker[source]

Bases: gi.repository.GObject.GObject

Base class for palette invokers.

__gtype_name__ = 'SugarPaletteInvoker'[source]
__gsignals__[source]
ANCHORED = 0[source]
AT_CURSOR = 1[source]
BOTTOM[source]
RIGHT[source]
TOP[source]
LEFT[source]
parent = None[source]
locked = False[source]
attach(parent)[source]
detach()[source]
get_position_for_alignment(alignment, palette_dim)[source]

Get position for specific alignment if it fits on screen.

get_position(palette_dim)[source]
get_alignment(palette_dim)[source]
has_rectangle_gap()[source]
draw_rectangle(event, palette)[source]
notify_popup()[source]
notify_popdown()[source]
notify_mouse_enter()[source]
notify_mouse_leave()[source]
notify_right_click(x=None, y=None)[source]

Notify the palette invoker of a right click and expand the palette as required. The x and y args should be that of where the event happened, relative to the root of the screen.

Args
x (float): the x coord of the event relative to the root

of the screen, eg. Gdk.EventTouch.x_root

y (float): the y coord of the event relative to the root

of the screen, eg. Gdk.EventTouch.y_root

notify_toggle_state()[source]
get_palette()[source]
set_palette(palette)[source]
palette[source]
get_cache_palette()[source]
set_cache_palette(cache_palette)[source]
cache_palette[source]
get_toggle_palette()[source]
set_toggle_palette(toggle_palette)[source]
toggle_palette[source]
get_lock_palette()[source]
set_lock_palette(lock_palette)[source]
lock_palette[source]
primary_text_clicked()[source]
get_rect()[source]

Get the rectangle for this invoker - implemented by subclasses.

get_toplevel()[source]

Get the toplevel window - implemented by subclasses.

class sugar4.graphics.palettewindow.WidgetInvoker(parent=None, widget=None)[source]

Bases: Invoker

Invoker for general widgets.

attach_widget(parent, widget=None)[source]
detach()[source]
get_rect()[source]

Get the rectangle for this invoker - implemented by subclasses.

has_rectangle_gap()[source]
draw_rectangle(cr, palette)[source]
get_widget()[source]
set_widget(widget)[source]
widget[source]
get_toplevel()[source]

Get the toplevel window - implemented by subclasses.

notify_popup()[source]
notify_popdown()[source]
class sugar4.graphics.palettewindow.CursorInvoker(parent=None)[source]

Bases: Invoker

Invoker that tracks cursor position.

attach(parent)[source]
detach()[source]

Detach from the parent.

get_rect()[source]

Get the rectangle for this invoker - implemented by subclasses.

get_toplevel()[source]

Get the toplevel window - implemented by subclasses.

class sugar4.graphics.palettewindow.ToolInvoker(parent=None)[source]

Bases: WidgetInvoker

A palette invoker for toolbar buttons and other items. this invoker will properly align the palette so that is perpendicular to the toolbar (a horizontal toolbar will spawn a palette going downwards). it also draws the highlights specific to a toolitem.

for sugar4.graphics.toolbutton.toolbutton and subclasses, you should not use the toolinvoker directly. instead, just subclass the tool button and override the create_palette function.

Parameters:

parent (gtk.widget) – toolitem to connect invoker to

attach_tool(widget)[source]

Attach a toolitem to the invoker. Same behaviour as passing the parent argument to the constructor.

Parameters:

widget (Gtk.Widget) – toolitem to connect invoker to

primary_text_clicked()[source]
notify_popup()[source]
notify_popdown()[source]
class sugar4.graphics.palettewindow.TreeViewInvoker[source]

Bases: Invoker

Invoker for TreeView cells.

palette = None[source]
attach_treeview(tree_view)[source]
detach()[source]
get_rect()[source]

Get the rectangle for this invoker - implemented by subclasses.

get_toplevel()[source]

Get the toplevel window - implemented by subclasses.

notify_popdown()[source]