chore: update for gnome 45

This commit is contained in:
mdwalters
2023-09-22 13:55:24 -04:00
parent 0fe0a27141
commit 9ebbd867c5
2 changed files with 12 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
{
"app-id" : "ml.mdwalters.Lemonade",
"runtime" : "org.gnome.Platform",
"runtime-version" : "44",
"runtime-version" : "45",
"sdk" : "org.gnome.Sdk",
"command" : "lemonade",
"finish-args" : [

View File

@@ -122,6 +122,9 @@ class LemonadeWindow(Gtk.ApplicationWindow):
def refresh(self, *args):
self.communities = requests.get("https://lemmy.ml/api/v3/community/list?sort=Hot").json()
for community in self.communities["communities"]:
def open_community(self, *args):
print(f"Community {community['community']['id']} clicked")
box = Gtk.Box(
orientation=Gtk.Orientation.HORIZONTAL,
margin_top = 20,
@@ -129,7 +132,14 @@ class LemonadeWindow(Gtk.ApplicationWindow):
margin_start = 20,
margin_end = 20
)
self.listbox.append(box)
button = Gtk.Button.new()
button.set_child(box)
button.get_style_context().add_class("flat")
button.set_has_frame(False)
button.connect("clicked", open_community)
self.listbox.append(button)
label = Gtk.Label.new()
avatar = Adw.Avatar.new(40, community["community"]["title"], True)