Philipp Hörist pushed to branch vcard at gajim / gajim
Commits:
b2ded0e9 by Philipp Hörist at 2026-09-05T20:30:59+02:00
fix: Show field types as icons
- - - - -
2 changed files:
- gajim/gtk/vcard_listbox.py
- test/gtk/ui_test_vcard_editor.py
Changes:
=====================================
gajim/gtk/vcard_listbox.py
=====================================
@@ -63,6 +63,11 @@
"ReadOnlyRow",
]
+TYPE_DATA = {
+ "home": (_("Home"), "lucide-house"),
+ "work": (_("Work"), "lucide-briefcase"),
+}
+
log = logging.getLogger("gajim.gtk.vcard_listbox")
@@ -70,7 +75,7 @@ def format_property_value(prop: SupportedPropertiesT) -> str:
if isinstance(prop, OrgProperty):
return ", ".join(value for value in prop.values if value)
if isinstance(prop, AdrProperty):
- return ", ".join(
+ return "\n".join(
value for field in ADR_FIELDS for value in getattr(prop, field) if
value
)
if isinstance(prop, GenderProperty):
@@ -506,6 +511,13 @@ def __init__(self, prop: SupportedPropertiesT) -> None:
case _:
self.set_subtitle(value)
+ for supported_type in prop.parameters.get_types():
+ if supported_type in ("work", "home"):
+ type_text, type_icon_name = TYPE_DATA[supported_type]
+ icon = Gtk.Image(icon_name=type_icon_name,
tooltip_text=type_text)
+ self.add_suffix(icon)
+ break
+
def run_destroy(self):
self._disconnect_all()
check_finalize(self)
=====================================
test/gtk/ui_test_vcard_editor.py
=====================================
@@ -136,6 +136,7 @@ def __init__(self):
main_box.append(self._scrolled)
self._vcard_editor = VCardEditor()
+ self._vcard_editor.set_margin_end(18)
self._vcard_editor.set_vcard(VCARD)
self._scrolled.set_child(self._vcard_editor)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/b2ded0e989e526ee67059007457b8ff690e618c7
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/b2ded0e989e526ee67059007457b8ff690e618c7
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]