Skip to content

Commit

Permalink
StatusIcon: Add toggle to force symbolic status icons
Browse files Browse the repository at this point in the history
  • Loading branch information
infirit committed Oct 17, 2024
1 parent 92fd1ff commit 3ab566d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions blueman/plugins/applet/StatusIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ class StatusIcon(AppletPlugin, GObject.GObject):
__icon__ = "bluetooth-symbolic"
__depends__ = ["StandardItems", "Menu"]

__gsettings__ = {
"schema": "org.blueman.general",
"path": None
}
__options__ = {
"symbolic-status-icons": {
"type": bool,
"default": False,
"name": _("Force symbolic status icons"),
"desc": _("When enabled this will force the use of a symbolic version of the blueman statusicon"),
}
}

visible = None

visibility_timeout: Optional[int] = None
Expand All @@ -38,9 +51,7 @@ def on_load(self) -> None:
self._tooltip_title = _("Bluetooth Enabled")
self._tooltip_text = ""

self.general_config = Gio.Settings(schema_id="org.blueman.general")
self.general_config.connect("changed::symbolic-status-icons", self.on_symbolic_config_change)

self._config.connect("changed::symbolic-status-icons", self.on_symbolic_config_change)
self.query_visibility(emit=False)

self.parent.Plugins.connect('plugin-loaded', self._on_plugins_changed)
Expand Down Expand Up @@ -133,7 +144,7 @@ def _get_icon_name(self) -> str:

# depending on configuration, ensure fullcolor icons..
name = name.replace("-symbolic", "")
if self.general_config.get_boolean("symbolic-status-icons"):
if self.get_option("symbolic-status-icons"):
# or symbolic
name = f"{name}-symbolic"

Expand Down

0 comments on commit 3ab566d

Please sign in to comment.