add per-app-volume check button

This commit is contained in:
piotr
2023-11-30 12:17:45 +01:00
parent 20b7167078
commit 3b2b83e863
4 changed files with 27 additions and 2 deletions

View File

@@ -3548,6 +3548,7 @@ class EditorWrapper(object):
},
"show-values": False,
"output-switcher": False,
"per-app-volume" : False,
"backlight-controller": "light",
"backlight-device": "",
"interval": 1,
@@ -3622,9 +3623,14 @@ class EditorWrapper(object):
self.ctrl_comp_switcher = builder.get_object("output-switcher")
self.ctrl_comp_switcher.set_label(voc["output-switcher"])
self.ctrl_comp_switcher.set_sensitive(is_command("pamixer"))
self.ctrl_comp_switcher.set_sensitive(is_command("pactl") or is_command("pamixer"))
self.ctrl_comp_switcher.set_active(settings["output-switcher"])
self.ctrl_per_app_vol = builder.get_object("per-app-volume")
self.ctrl_per_app_vol.set_label(voc["per-app-volume"])
self.ctrl_per_app_vol.set_active(settings["per-app-volume"])
self.ctrl_per_app_vol.set_active("per-app-volume" in settings["components"])
self.ctrl_comp_battery = builder.get_object("ctrl-comp-battery")
self.ctrl_comp_battery.set_label(voc["battery"])
self.ctrl_comp_battery.set_tooltip_text(voc["battery-tooltip"])
@@ -3758,6 +3764,13 @@ class EditorWrapper(object):
if "volume" in settings["components"]:
settings["components"].remove("volume")
if self.ctrl_per_app_vol.get_active():
if "per-app-volume" not in settings["components"]:
settings["components"].append("per-app-volume")
else:
if "per-app-volume" in settings["components"]:
settings["components"].remove("per-app-volume")
settings["output-switcher"] = self.ctrl_comp_switcher.get_active()
if self.ctrl_comp_battery.get_active():

View File

@@ -426,7 +426,17 @@ on panel Controls widget pointed</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkCheckButton" id="per-app-volume">
<property name="label" translatable="yes">Per-app volume</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<placeholder/>

View File

@@ -150,6 +150,7 @@
"panel-name": "Panel name",
"panel-settings": "Panel settings",
"panel-widget": "Panel widget",
"per-app-volume": "Per-app volume",
"pick-an-icon": "Pick an icon",
"placement": "Placement",
"playerctl": "Playerctl",

View File

@@ -150,6 +150,7 @@
"panel-name": "Nazwa panelu",
"panel-settings": "Ustawienia panelu",
"panel-widget": "Widżet panelu",
"per-app-volume": "Głośność w aplikacjach",
"pick-an-icon": "Wybierz ikonę",
"placement": "Położenie",
"playerctl": "Kontrola odtwarzacza",