2022-08-23 17:57:53 +00:00
|
|
|
# plugin_row.py
|
|
|
|
#
|
|
|
|
# Change the look of Adwaita, with ease
|
|
|
|
# Copyright (C) 2022 Gradience Team
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2022-08-19 12:23:25 +00:00
|
|
|
|
|
|
|
from gi.repository import Gtk, Gdk, Adw
|
|
|
|
|
2022-08-23 17:38:09 +00:00
|
|
|
from .modules.utils import buglog
|
2022-08-19 12:23:25 +00:00
|
|
|
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):
|
2022-08-23 17:38:09 +00:00
|
|
|
buglog("settings")
|
2022-08-19 18:49:02 +00:00
|
|
|
|
|
|
|
@Gtk.Template.Callback()
|
|
|
|
def on_remove_plugin_clicked(self, *_args):
|
2022-08-23 17:38:09 +00:00
|
|
|
buglog("removed")
|
2022-08-19 18:49:02 +00:00
|
|
|
|
|
|
|
@Gtk.Template.Callback()
|
|
|
|
def on_switch_toggled(self, *_args):
|
2022-08-23 17:38:09 +00:00
|
|
|
buglog("toggled")
|
2022-08-19 18:54:44 +00:00
|
|
|
|
|
|
|
Gtk.Application.get_default().reload_plugins()
|