gtk stock icons are deprecated since 3.10. #50

Closed
opened 2025-02-03 06:51:39 +00:00 by phoepsilonix · 5 comments
phoepsilonix commented 2025-02-03 06:51:39 +00:00 (Migrated from gitlab2.manjaro.org)
https://docs.gtk.org/gtk3/const.STOCK_GO_BACK.html
phoepsilonix commented 2025-02-03 06:51:40 +00:00 (Migrated from gitlab2.manjaro.org)

assigned to @phoepsilonix

assigned to @phoepsilonix
phoepsilonix commented 2025-02-03 06:54:45 +00:00 (Migrated from gitlab2.manjaro.org)

IconTheme seems to be a better choice.

def get_icon_image(icon_name, icon_size):
    icon_theme = Gtk.IconTheme.get_default()
    
    if icon_theme.has_icon(icon_name):
        pixbuf = icon_theme.load_icon(icon_name, icon_size, 0)
        if pixbuf:
            return Gtk.Image.new_from_pixbuf(pixbuf)
        else:
            return Gtk.Image.new_from_icon_name(icon_name, icon_size)
    return None
image = get_icon_image("go-previous", Gtk.IconSize.BUTTON)
IconTheme seems to be a better choice. ```python def get_icon_image(icon_name, icon_size): icon_theme = Gtk.IconTheme.get_default() if icon_theme.has_icon(icon_name): pixbuf = icon_theme.load_icon(icon_name, icon_size, 0) if pixbuf: return Gtk.Image.new_from_pixbuf(pixbuf) else: return Gtk.Image.new_from_icon_name(icon_name, icon_size) return None ``` ```python image = get_icon_image("go-previous", Gtk.IconSize.BUTTON) ```
phoepsilonix commented 2025-02-03 06:54:59 +00:00 (Migrated from gitlab2.manjaro.org)

created branch 50-gtk-stock-icons-are-deprecated-since-3-10 to address this issue

created branch [`50-gtk-stock-icons-are-deprecated-since-3-10`](/applications/manjaro-hello/-/compare/master...50-gtk-stock-icons-are-deprecated-since-3-10) to address this issue
phoepsilonix commented 2025-02-03 06:55:40 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in merge request !159

mentioned in merge request !159
phoepsilonix commented 2025-02-07 19:49:48 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit 496adfc992

mentioned in commit 496adfc9929019b1f8748e192baef7b6c67afaee
phoepsilonix (Migrated from gitlab2.manjaro.org) closed this issue 2025-02-07 19:49:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/manjaro-hello#50
No description provided.