Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
60f01dfd by wurstsalat at 2025-01-24T21:58:08+01:00
cfix: GroupchatInviter: Fix icon sizes; add finalization checks
- - - - -
75a25cd8 by wurstsalat at 2025-01-24T21:58:35+01:00
cfix: ContactsFlowBox: Add finalization checks
- - - - -
3 changed files:
- gajim/data/gui/groupchat_inviter.ui
- gajim/gtk/contacts_flowbox.py
- gajim/gtk/groupchat_inviter.py
Changes:
=====================================
gajim/data/gui/groupchat_inviter.ui
=====================================
@@ -61,6 +61,7 @@
<child>
<object class="GtkImage">
<property
name="icon-name">avatar-default-symbolic</property>
+ <property name="pixel-size">48</property>
<style>
<class name="dim-label"/>
</style>
=====================================
gajim/gtk/contacts_flowbox.py
=====================================
@@ -17,12 +17,13 @@
from gajim.common.modules.contacts import GroupchatParticipant
from gajim.gtk.util import iterate_children
+from gajim.gtk.util import SignalManager
-class ContactItem(Gtk.FlowBoxChild):
+class ContactItem(Gtk.FlowBoxChild, SignalManager):
def __init__(self, account: str, jid: str, is_new: bool = False) -> None:
- Gtk.FlowBoxChild.__init__(self)
- self.set_size_request(150, -1)
+ Gtk.FlowBoxChild.__init__(self, width_request=150)
+ SignalManager.__init__(self)
self.account = account
self.jid = jid
@@ -45,6 +46,7 @@ def __init__(self, account: str, jid: str, is_new: bool =
False) -> None:
)
texture = contact.get_avatar(AvatarSize.ROSTER,
self.get_scale_factor())
avatar_image = Gtk.Image.new_from_paintable(texture)
+ avatar_image.set_pixel_size(AvatarSize.ROSTER)
name_label.set_text(contact.name)
name_label.set_tooltip_text(contact.name)
@@ -53,7 +55,7 @@ def __init__(self, account: str, jid: str, is_new: bool =
False) -> None:
remove_button.set_halign(Gtk.Align.END)
remove_button.set_hexpand(True)
remove_button.set_tooltip_text(_("Remove"))
- remove_button.connect("clicked", self._on_remove)
+ self._connect(remove_button, "clicked", self._on_remove)
box = Gtk.Box(spacing=6)
box.set_valign(Gtk.Align.CENTER)
@@ -63,6 +65,11 @@ def __init__(self, account: str, jid: str, is_new: bool =
False) -> None:
box.add_css_class("contact-flowbox-item")
self.set_child(box)
+ def do_unroot(self) -> None:
+ self._disconnect_all()
+ Gtk.FlowBoxChild.do_unroot(self)
+ app.check_finalize(self)
+
def _on_remove(self, _button: Gtk.Button) -> None:
flow_box = cast(ContactsFlowBox, self.get_parent())
flow_box.on_contact_removed(self)
@@ -82,6 +89,10 @@ def __init__(self) -> None:
self.set_valign(Gtk.Align.START)
self.set_can_focus(False)
+ def do_unroot(self) -> None:
+ Gtk.FlowBox.do_unroot(self)
+ app.check_finalize(self)
+
def clear(self) -> None:
self.remove_all()
=====================================
gajim/gtk/groupchat_inviter.py
=====================================
@@ -91,6 +91,10 @@ def __init__(
self.set_child(grid)
+ def do_unroot(self) -> None:
+ Gtk.ListBoxRow.do_unroot(self)
+ app.check_finalize(self)
+
def _get_avatar_image(self, contact: types.BareContact | None) ->
Gtk.Image:
if contact is None:
icon_name = "avatar-default"
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/b230816f43f232d0866a1bb3e9ce8a25624f5edd...75a25cd8d3ce300d81b00422d8827489d1789698
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/b230816f43f232d0866a1bb3e9ce8a25624f5edd...75a25cd8d3ce300d81b00422d8827489d1789698
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]