Dazzle.Suggestion

g Dazzle.Suggestion Dazzle.Suggestion GObject.Object GObject.Object GObject.Object->Dazzle.Suggestion

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_icon ()

get_icon_name ()

get_icon_surface (widget)

get_id ()

get_secondary_icon ()

get_secondary_icon_name ()

get_secondary_icon_surface (widget)

get_subtitle ()

get_title ()

replace_typed_text (typed_text)

set_icon_name (icon_name)

set_id (id)

set_secondary_icon_name (icon_name)

set_subtitle (subtitle)

set_title (title)

suggest_suffix (typed_text)

Virtual Methods

Inherited:

GObject.Object (7)

do_get_icon ()

do_get_icon_surface (widget)

do_get_secondary_icon ()

do_get_secondary_icon_surface (widget)

do_replace_typed_text (typed_text)

do_suggest_suffix (typed_text)

Properties

Name

Type

Flags

Short Description

icon

Gio.Icon

r/en

The Gio.Icon for the suggestion

icon-name

str

r/w/en

The name of the icon to display

id

str

r/w/en

The suggestion identifier

secondary-icon

Gio.Icon

r/en

The secondary Gio.Icon for the suggestion on the right

secondary-icon-name

str

r/w/en

The name of the secondary icon to display

subtitle

str

r/w/en

The subtitle of the suggestion

title

str

r/w/en

The title of the suggestion

Signals

Inherited:

GObject.Object (1)

Name

Short Description

replace-typed-text

suggest-suffix

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Dazzle.Suggestion(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Dazzle.SuggestionClass

classmethod new()
Return type:

Dazzle.Suggestion

get_icon()
Returns:

a Gio.Icon or None

Return type:

Gio.Icon or None

Gets the icon for the suggestion, if any.

New in version 3.30.

get_icon_name()
Return type:

str

get_icon_surface(widget)
Parameters:

widget (Gtk.Widget) – a widget that may contain the surface

Returns:

a cairo.Surface or None

Return type:

cairo.Surface or None

This function allows subclasses to dynamicly generate content for the suggestion such as may be required when integrating with favicons or similar.

widget is provided so that the implementation may determine scale or any other style-specific settings from the style context.

New in version 3.30.

get_id()
Return type:

str

get_secondary_icon()
Returns:

a Gio.Icon or None

Return type:

Gio.Icon or None

Gets the secondary icon for the suggestion, if any.

New in version 3.36.

get_secondary_icon_name()
Return type:

str

get_secondary_icon_surface(widget)
Parameters:

widget (Gtk.Widget) – a widget that may contain the surface

Returns:

a cairo.Surface or None

Return type:

cairo.Surface or None

This function allows subclasses to dynamicly generate content for the suggestion such as may be required when integrating with favicons or similar.

widget is provided so that the implementation may determine scale or any other style-specific settings from the style context.

New in version 3.36.

get_subtitle()
Return type:

str

get_title()
Return type:

str

replace_typed_text(typed_text)
Parameters:

typed_text (str) – the text that was typed into the entry

Returns:

The replacement text to insert into the entry when “tab” is pressed to complete the insertion.

Return type:

str or None

This function is meant to be used to replace the text in the entry with text that represents the suggestion most accurately. This happens when the user presses tab while typing a suggestion. For example, if typing “gno” in the entry, you might have a suggest_suffix of “me.org” so that the user sees “gnome.org”. But the replace_typed_text might include more data such as “https://gnome.org” as it more closely represents the suggestion.

set_icon_name(icon_name)
Parameters:

icon_name (str) –

set_id(id)
Parameters:

id (str) –

set_secondary_icon_name(icon_name)
Parameters:

icon_name (str) –

set_subtitle(subtitle)
Parameters:

subtitle (str) –

set_title(title)
Parameters:

title (str) –

suggest_suffix(typed_text)
Parameters:

typed_text (str) – The user entered text

Returns:

Suffix to append to typed_text or None to leave it unchanged.

Return type:

str or None

This function requests potential text to append to typed_text to make it more clear to the user what they will be activating by selecting this suggestion. For example, if they start typing “gno”, a potential suggested suffix might be “me.org” to create “gnome.org”.

do_get_icon() virtual
Returns:

a Gio.Icon or None

Return type:

Gio.Icon or None

Gets the icon for the suggestion, if any.

New in version 3.30.

do_get_icon_surface(widget) virtual
Parameters:

widget (Gtk.Widget) – a widget that may contain the surface

Returns:

a cairo.Surface or None

Return type:

cairo.Surface or None

This function allows subclasses to dynamicly generate content for the suggestion such as may be required when integrating with favicons or similar.

widget is provided so that the implementation may determine scale or any other style-specific settings from the style context.

New in version 3.30.

do_get_secondary_icon() virtual
Returns:

a Gio.Icon or None

Return type:

Gio.Icon or None

Gets the secondary icon for the suggestion, if any.

New in version 3.36.

do_get_secondary_icon_surface(widget) virtual
Parameters:

widget (Gtk.Widget) – a widget that may contain the surface

Returns:

a cairo.Surface or None

Return type:

cairo.Surface or None

This function allows subclasses to dynamicly generate content for the suggestion such as may be required when integrating with favicons or similar.

widget is provided so that the implementation may determine scale or any other style-specific settings from the style context.

New in version 3.36.

do_replace_typed_text(typed_text) virtual
Parameters:

typed_text (str) – the text that was typed into the entry

Returns:

The replacement text to insert into the entry when “tab” is pressed to complete the insertion.

Return type:

str or None

This function is meant to be used to replace the text in the entry with text that represents the suggestion most accurately. This happens when the user presses tab while typing a suggestion. For example, if typing “gno” in the entry, you might have a suggest_suffix of “me.org” so that the user sees “gnome.org”. But the replace_typed_text might include more data such as “https://gnome.org” as it more closely represents the suggestion.

do_suggest_suffix(typed_text) virtual
Parameters:

typed_text (str) – The user entered text

Returns:

Suffix to append to typed_text or None to leave it unchanged.

Return type:

str or None

This function requests potential text to append to typed_text to make it more clear to the user what they will be activating by selecting this suggestion. For example, if they start typing “gno”, a potential suggested suffix might be “me.org” to create “gnome.org”.

Signal Details

Dazzle.Suggestion.signals.replace_typed_text(suggestion, object)
Signal Name:

replace-typed-text

Flags:

RUN_LAST

Parameters:
Return type:

str

Dazzle.Suggestion.signals.suggest_suffix(suggestion, object)
Signal Name:

suggest-suffix

Flags:

RUN_LAST

Parameters:
Return type:

str

Property Details

Dazzle.Suggestion.props.icon
Name:

icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The Gio.Icon for the suggestion

Dazzle.Suggestion.props.icon_name
Name:

icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The name of the icon to display

Dazzle.Suggestion.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The suggestion identifier

Dazzle.Suggestion.props.secondary_icon
Name:

secondary-icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

The secondary Gio.Icon for the suggestion on the right

Dazzle.Suggestion.props.secondary_icon_name
Name:

secondary-icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The name of the secondary icon to display

Dazzle.Suggestion.props.subtitle
Name:

subtitle

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The subtitle of the suggestion

Dazzle.Suggestion.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The title of the suggestion