Change methods not using its bound instance to staticmethods (#356)

This commit is contained in:
0xMRTT 2022-09-07 17:57:21 +02:00 committed by GitHub
commit d2da78aeb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View file

@ -189,7 +189,8 @@ class GradienceApplication(Adw.Application):
self.reload_variables()
def rgba_from_argb(self, argb, alpha=None) -> str:
@staticmethod
def rgba_from_argb(argb, alpha=None) -> str:
base = "rgba({}, {}, {}, {})"
red = redFromArgb(argb)
@ -812,15 +813,18 @@ This app is written in Python and uses GTK 4 and libadwaita.
self.props.active_window.update_errors(
self.global_errors + plugins_errors)
def show_adwaita_demo(self, *_args):
@staticmethod
def show_adwaita_demo(*_args):
GLib.spawn_command_line_async(
'sh -c "/bin/adwaita-1-demo > /dev/null 2>&1"')
def show_gtk4_demo(self, *_args):
@staticmethod
def show_gtk4_demo(*_args):
GLib.spawn_command_line_async(
'sh -c "/bin/gtk4-demo > /dev/null 2>&1"')
def show_gtk4_widget_factory(self, *_args):
@staticmethod
def show_gtk4_widget_factory(*_args):
GLib.spawn_command_line_async(
'sh -c "/bin/gtk4-widget-factory > /dev/null 2>&1"'
)

View file

@ -211,10 +211,12 @@ class GradiencePresetWindow(Adw.Window):
self.search_entry.connect("search-changed", self.on_search_changed)
self.search_entry.connect("realize", self.on_search_realize)
def on_search_changed(self, widget):
@staticmethod
def on_search_changed(widget):
print("search changed")
def on_search_realize(self, widget):
@staticmethod
def on_search_realize(widget):
print("search realized")
@Gtk.Template.Callback()

View file

@ -120,7 +120,8 @@ class GradienceWelcomeWindow(Adw.Window):
sys.exit()
# TODO: Add adw-gtk3 check
def check_adw_gtk3(self):
@staticmethod
def check_adw_gtk3():
buglog("check if adw-gtk3 installed")
return True