Gradience/src/plugin_row.py

34 lines
872 B
Python
Raw Normal View History

2022-08-19 12:23:25 +00:00
from gi.repository import Gtk, Gdk, Adw
from .constants import rootdir
@Gtk.Template(resource_path=f"{rootdir}/ui/plugin_row.ui")
2022-08-19 12:44:02 +00:00
class GradiencePluginRow(Adw.ActionRow):
__gtype_name__ = "GradiencePluginRow"
2022-08-19 12:23:25 +00:00
2022-08-19 13:29:52 +00:00
def __init__(self, title, id, **kwargs):
2022-08-19 12:23:25 +00:00
super().__init__(**kwargs)
2022-08-19 13:29:52 +00:00
self.set_name(id)
self.set_title(title)
self.set_subtitle("@" + id)
2022-08-19 18:49:02 +00:00
switch = Gtk.Template.Child("switch")
settings_button = Gtk.Template.Child("settings-button")
remove_button = Gtk.Template.Child("remove-button")
@Gtk.Template.Callback()
def on_settings_plugin_clicked(self, *_args):
print("settings")
@Gtk.Template.Callback()
def on_remove_plugin_clicked(self, *_args):
print("removed")
@Gtk.Template.Callback()
def on_switch_toggled(self, *_args):
print("toggled")