mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-09-18 10:02:31 +00:00
Change methods not using its bound instance to staticmethods (#356)
This commit is contained in:
commit
d2da78aeb3
3 changed files with 14 additions and 7 deletions
12
src/main.py
12
src/main.py
|
@ -189,7 +189,8 @@ class GradienceApplication(Adw.Application):
|
||||||
|
|
||||||
self.reload_variables()
|
self.reload_variables()
|
||||||
|
|
||||||
def rgba_from_argb(self, argb, alpha=None) -> str:
|
@staticmethod
|
||||||
|
def rgba_from_argb(argb, alpha=None) -> str:
|
||||||
base = "rgba({}, {}, {}, {})"
|
base = "rgba({}, {}, {}, {})"
|
||||||
|
|
||||||
red = redFromArgb(argb)
|
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.props.active_window.update_errors(
|
||||||
self.global_errors + plugins_errors)
|
self.global_errors + plugins_errors)
|
||||||
|
|
||||||
def show_adwaita_demo(self, *_args):
|
@staticmethod
|
||||||
|
def show_adwaita_demo(*_args):
|
||||||
GLib.spawn_command_line_async(
|
GLib.spawn_command_line_async(
|
||||||
'sh -c "/bin/adwaita-1-demo > /dev/null 2>&1"')
|
'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(
|
GLib.spawn_command_line_async(
|
||||||
'sh -c "/bin/gtk4-demo > /dev/null 2>&1"')
|
'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(
|
GLib.spawn_command_line_async(
|
||||||
'sh -c "/bin/gtk4-widget-factory > /dev/null 2>&1"'
|
'sh -c "/bin/gtk4-widget-factory > /dev/null 2>&1"'
|
||||||
)
|
)
|
||||||
|
|
|
@ -211,10 +211,12 @@ class GradiencePresetWindow(Adw.Window):
|
||||||
self.search_entry.connect("search-changed", self.on_search_changed)
|
self.search_entry.connect("search-changed", self.on_search_changed)
|
||||||
self.search_entry.connect("realize", self.on_search_realize)
|
self.search_entry.connect("realize", self.on_search_realize)
|
||||||
|
|
||||||
def on_search_changed(self, widget):
|
@staticmethod
|
||||||
|
def on_search_changed(widget):
|
||||||
print("search changed")
|
print("search changed")
|
||||||
|
|
||||||
def on_search_realize(self, widget):
|
@staticmethod
|
||||||
|
def on_search_realize(widget):
|
||||||
print("search realized")
|
print("search realized")
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
@Gtk.Template.Callback()
|
||||||
|
|
|
@ -120,7 +120,8 @@ class GradienceWelcomeWindow(Adw.Window):
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# TODO: Add adw-gtk3 check
|
# TODO: Add adw-gtk3 check
|
||||||
def check_adw_gtk3(self):
|
@staticmethod
|
||||||
|
def check_adw_gtk3():
|
||||||
buglog("check if adw-gtk3 installed")
|
buglog("check if adw-gtk3 installed")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue