Budgie.Applet¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.EventBox (5), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Set the |
||
r/w |
Set the |
||
r/w |
Get/set the supported panel actions |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Used to notify this applet of a change in the panel’s placement on screen, so that it may adjust its own layout to better suit the geometry. |
|
Used to notify this applet of a change in the panel size |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Budgie.Applet(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
A new
Budgie.Applet
- Return type:
- get_applet_settings(uuid)¶
- Parameters:
uuid (
str
) – UUID for this instance- Returns:
A newly created
Gio.Settings
for this applet instance- Return type:
If your
Budgie.Plugin
implementation passes the UUID to yourBudgie.Applet
implementation on construction, you can take advantage of per-instance settings.For most applets, global
Gio.Settings
keys are more than suffice. However, in some situations, it may be beneficial to enable multiple unique instances of your applet, each with their own configuration.To facilitate this, use this function to create a new relocatable settings instance using your UUID. Make sure you set the
Budgie.Applet
:settings-schema
andBudgie.Applet
:settings-prefix
properties first.
- get_settings_prefix()¶
- Return type:
Utility function for Python usage. See:
Budgie.Applet
:settings-prefix
- get_settings_schema()¶
- Return type:
Utility function for Python usage. See
Budgie.Applet
:settings-schema
- get_settings_ui()¶
- Returns:
A GTK Settings UI
- Return type:
Gtk.Widget
orNone
For applets that need to expose settings, they should both override the #BudgieApplet::supports_settings method and return a new widget instance whenever this function is invoked.
This UI will live in the Raven sidebar within the Budgie Desktop, and will be destroyed as soon as it’s not being used. It’s advisable to keep this widget implementation light, and to prefer vertical space.
- get_supported_actions()¶
- Return type:
Utility function for Python bindings. See
Budgie.Applet
:supported-actions
- invoke_action(action)¶
- Parameters:
action (
Budgie.PanelAction
) – Action to invoke
Invoke the given action on this applet. This action will only be one that has been declared in supported actions bitmask.
To allow better integration between the Budgie Desktop, and the applets that live within it, the panel will relay actions to applets that have set their
Budgie.Applet
:supported-actions
to a matching bitmask.For example, if we wish to listen for Menu Key events, we can simply do the following in C:
static void my_applet_invoke_action(BudgieApplet *applet, BudgiePanelAction action) { if (action == BUDGIE_PANEL_ACTION_MENU) { my_applet_do_predict_the_lottery(MY_APPLET(applet)); } } static void my_class_init(GObjectClass *class) { MyClass *mc = MY_CLASS(klass); .. mc->invoke_action = my_applet_invoke_action; }
Likewise, a Vala implementation might look like the following:
public override void invoke_action(Budgie.PanelAction action) { if (action == Budgie.PanelAction.MENU) { this.predict_the_lottery(); } }
- set_settings_prefix(prefix)¶
- Parameters:
prefix (
str
) –
Utility function for Python usage. See:
Budgie.Applet
:settings-prefix
- set_settings_schema(schema)¶
- Parameters:
schema (
str
) –
Utility function for Python usage. See
Budgie.Applet
:settings-schema
- supports_settings()¶
- Returns:
true if this implementation supports a Settings UI
- Return type:
Implementations should override this to return
True
if they support a settings UI
- update_popovers(manager)¶
- Parameters:
manager (
Budgie.PopoverManager
orNone
) –
This virtual method should be implemented by panel applets that wish to support
Gtk.Popover
's natively. As each Budgie Panel may house multipleGtk.Popover
widgets, each one must be registered with the manager.During this call, it is safe to store a reference to the manager. In this call you should invoke #BudgiePopoverManager::register_popover to register your popover with the panel manager.
Each registered popover joins the global menu system of popovers in the panel. It is a requirement to register, otherwise the panel will not know when to expand and collapse the main panel harness to accommodate the
Gtk.Popover
.
- do_get_settings_ui() virtual¶
- Returns:
A GTK Settings UI
- Return type:
Gtk.Widget
orNone
For applets that need to expose settings, they should both override the #BudgieApplet::supports_settings method and return a new widget instance whenever this function is invoked.
This UI will live in the Raven sidebar within the Budgie Desktop, and will be destroyed as soon as it’s not being used. It’s advisable to keep this widget implementation light, and to prefer vertical space.
- do_invoke_action(action) virtual¶
- Parameters:
action (
Budgie.PanelAction
) – Action to invoke
Invoke the given action on this applet. This action will only be one that has been declared in supported actions bitmask.
To allow better integration between the Budgie Desktop, and the applets that live within it, the panel will relay actions to applets that have set their
Budgie.Applet
:supported-actions
to a matching bitmask.For example, if we wish to listen for Menu Key events, we can simply do the following in C:
static void my_applet_invoke_action(BudgieApplet *applet, BudgiePanelAction action) { if (action == BUDGIE_PANEL_ACTION_MENU) { my_applet_do_predict_the_lottery(MY_APPLET(applet)); } } static void my_class_init(GObjectClass *class) { MyClass *mc = MY_CLASS(klass); .. mc->invoke_action = my_applet_invoke_action; }
Likewise, a Vala implementation might look like the following:
public override void invoke_action(Budgie.PanelAction action) { if (action == Budgie.PanelAction.MENU) { this.predict_the_lottery(); } }
- do_panel_position_changed(position) virtual¶
- Parameters:
position (
Budgie.PanelPosition
) –
- do_panel_size_changed(panel_size, icon_size, small_icon_size) virtual¶
-
Virtual panel_size_changed function
- do_supports_settings() virtual¶
- Returns:
true if this implementation supports a Settings UI
- Return type:
Implementations should override this to return
True
if they support a settings UI
- do_update_popovers(manager) virtual¶
- Parameters:
manager (
Budgie.PopoverManager
orNone
) –
This virtual method should be implemented by panel applets that wish to support
Gtk.Popover
's natively. As each Budgie Panel may house multipleGtk.Popover
widgets, each one must be registered with the manager.During this call, it is safe to store a reference to the manager. In this call you should invoke #BudgiePopoverManager::register_popover to register your popover with the panel manager.
Each registered popover joins the global menu system of popovers in the panel. It is a requirement to register, otherwise the panel will not know when to expand and collapse the main panel harness to accommodate the
Gtk.Popover
.
Signal Details¶
- Budgie.Applet.signals.panel_position_changed(applet, position)¶
- Signal Name:
panel-position-changed
- Flags:
- Parameters:
applet (
Budgie.Applet
) – The object which received the signalposition (
Budgie.PanelPosition
) – The new position (screen edge)
Used to notify this applet of a change in the panel’s placement on screen, so that it may adjust its own layout to better suit the geometry.
- Budgie.Applet.signals.panel_size_changed(applet, panel_size, icon_size, small_icon_size)¶
- Signal Name:
panel-size-changed
- Flags:
- Parameters:
applet (
Budgie.Applet
) – The object which received the signalpanel_size (
int
) – The new panel sizeicon_size (
int
) – Larget possible icon size for the panelsmall_icon_size (
int
) – Smaller icon that will still fit on the panel
Used to notify this applet of a change in the panel size
Property Details¶
- Budgie.Applet.props.settings_prefix¶
-
The
Gio.Settings
schema path prefix for this appletFor applets that require unique instance configuration, the panel management must know where to initialise the settings within the tree. The path takes the form:
$SETTINGS_PREFIX/{$UUID}
As an example, the Budgie Menu Applet set’s the
settings-prefix
to:/com/solus-project/budgie-panel/instance/budgie-menu
.This results in relocatable schemas being created at:
/com/solus-project/budgie-panel/instance/budgie-menu/{$UUID}
- Budgie.Applet.props.settings_schema¶
-
The ID of the
Gio.Settings
schema used by this appletThis only takes effect when you’ve also set
Budgie.Applet
:settings-prefix
, and is used by the panel managemen to both initialise and delete your per-instance settings, respectively.As an example, the Budgie Menu Applet uses the schema:
com.solus-project.budgie-menu
as defined by the accompanying gschema XML file. Providing an incorrect schema ID is considered programmer error.
- Budgie.Applet.props.supported_actions¶
- Name:
supported-actions
- Type:
- Default Value:
- Flags:
The actions supported by this applet instance