sugar4.graphics.colorbutton

Classes

ColorToolButton

Color tool button for GTK4 toolbar.

Functions

get_svg_color_string(color)

Convert Gdk.RGBA to SVG hex color string.

setup_accelerator(tool_button)

Module Contents

sugar4.graphics.colorbutton.get_svg_color_string(color)[source]

Convert Gdk.RGBA to SVG hex color string.

sugar4.graphics.colorbutton.setup_accelerator(tool_button)[source]
class sugar4.graphics.colorbutton.ColorToolButton(icon_name='color-preview', **kwargs)[source]

Bases: gi.repository.Gtk.Box

Color tool button for GTK4 toolbar.

__gtype_name__ = 'SugarColorToolButton'[source]
__gsignals__[source]
set_accelerator(accelerator)[source]

Sets keyboard shortcut that activates this button.

Parameters:
  • accelerator (string) – accelerator to be set. Should be in

  • <modifier>Letter (form)

Example

set_accelerator(self, ‘accel’)

get_accelerator()[source]

Returns the above accelerator string.

accelerator[source]
create_palette()[source]

The create_palette function is called when the palette needs to be invoked.

Returns:

sugar4.graphics.palette.Palette, or None to indicate that you do not want a palette shown

get_palette_invoker()[source]
set_palette_invoker(palette_invoker)[source]
palette_invoker[source]
set_expanded(expanded)[source]
get_toolbar_box()[source]
toolbar_box[source]
set_color(color)[source]

Sets the color of the colorbutton

get_color()[source]

Gets the above set color string.

color[source]
set_icon_name(icon_name)[source]

Sets the icon for the tool button from a named themed icon.

Parameters:
  • icon_name (string) – The name for a themed icon.

  • too. (It can be set as 'None')

Example

set_icon_name(‘view-radial’)

get_icon_name()[source]

The get_icon_name() method returns the value of the icon_name property that contains the name of a themed icon or None.

icon_name[source]
set_icon_size(icon_size)[source]

Sets the size of icons in the colorbutton.

get_icon_size()[source]

Gets the size of icons in the colorbutton.

icon_size[source]
set_title(title)[source]

The set_title() method sets the “title” property to the value of title. The “title” property contains the string that is used to set the colorbutton title.

get_title()[source]

Return the above title string.

title[source]