Daniel Brötzmann pushed to branch gtk4 at gajim / gajim
Commits:
19b92cb2 by wurstsalat at 2024-11-04T22:35:21+01:00
refactor: Util: Remove obsolete functions
- - - - -
1 changed file:
- gajim/gtk/util.py
Changes:
=====================================
gajim/gtk/util.py
=====================================
@@ -140,27 +140,6 @@ def get_source_view_style_scheme() ->
GtkSource.StyleScheme | None:
return style_scheme_manager.get_scheme('solarized-light')
-def get_completion_liststore(entry: Gtk.Entry) -> Gtk.ListStore:
- '''
- Create a completion model for entry widget completion list consists of
- (Pixbuf, Text) rows
- '''
- completion = Gtk.EntryCompletion()
- liststore = Gtk.ListStore(str, str)
-
- render_pixbuf = Gtk.CellRendererPixbuf()
- completion.pack_start(render_pixbuf, False)
- completion.add_attribute(render_pixbuf, 'icon_name', 0)
-
- render_text = Gtk.CellRendererText()
- completion.pack_start(render_text, True)
- completion.add_attribute(render_text, 'text', 1)
- completion.set_property('text_column', 1)
- completion.set_model(liststore)
- entry.set_completion(completion)
- return liststore
-
-
def scroll_to_end(widget: Gtk.ScrolledWindow) -> bool:
'''Scrolls to the end of a GtkScrolledWindow.
@@ -197,14 +176,6 @@ def at_the_end(widget: Gtk.ScrolledWindow) -> bool:
return adj_v.get_value() == max_scroll_pos
-def python_month(month: int) -> int:
- return month + 1
-
-
-def gtk_month(month: int) -> int:
- return month - 1
-
-
def convert_rgba_to_hex(rgba: Gdk.RGBA) -> str:
red = int(rgba.red * 255)
green = int(rgba.green * 255)
@@ -506,12 +477,6 @@ def get_gtk_version() -> str:
Gtk.get_micro_version())
-def check_destroy(widget: Gtk.Widget) -> None:
- def _destroy(*args: Any) -> None:
- print('DESTROYED', args)
- widget.connect('destroy', _destroy)
-
-
def _connect_destroy(sender: Any,
func: Any,
detailed_signal: str,
@@ -525,6 +490,7 @@ def _connect_destroy(sender: Any,
This solves the problem that the sender holds a strong reference
to the bound method and the bound to object doesn't get GCed.
'''
+ # TODO GTK4: keep and adapt?
if hasattr(handler, '__self__'):
obj = handler.__self__
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/19b92cb2034f2dea8dce8eb2c930cf9b1c54c3ea
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/19b92cb2034f2dea8dce8eb2c930cf9b1c54c3ea
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]