0

I'm working with GTK4 and libadwaita, and I'm trying to use an icon with the Adw.EntryRow widget. However, I noticed that the document-edit-symbolic icon seems to be missing.

Here's a simplified code snippet:

import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
from gi.repository import Gtk, Adw

class ExampleWindow(Adw.ApplicationWindow):
    def __init__(self, app):
        super().__init__(application=app, title="EntryRow Example")

        entry_row = Adw.EntryRow.new()
        entry_row.set_title("Edit Document")

        self.set_content(entry_row)

class ExampleApp(Adw.Application):
    def __init__(self):
        super().__init__(application_id="org.example.EntryRowExample")

    def do_activate(self):
        window = ExampleWindow(self)
        window.present()

app = ExampleApp()
app.run()

When I run this code, the icon does not appear. I expected the document-edit-symbolic icon to be available since it's commonly used in earlier GTK versions.

Questions:

Has document-edit-symbolic been deprecated or renamed in GTK4 / libadwaita? Is there a reference or list of available symbolic icons for GTK4/libadwaita? How can I properly use a similar icon with Adw.EntryRow? Any guidance or references to the correct icon naming conventions would be appreciated!

Thx

What I’ve tried:

Used gtk4-icon-browser to search for the icon but couldn’t find it. Tested alternative icons like edit-symbolic, which works. Checked if the current icon theme includes the icon using Gtk.IconTheme.has_icon().

1 Answer 1

0

The icon only appears when the focus is on an element other than Adw.EntryRow. In your example, Adw.EntryRow is the only element and there is no way to remove the focus from it. Replace the content of your ExampleWindow class with the snippet below, run it and click the button..

self.entry_row = Adw.EntryRow.new()
self.entry_row.set_title("Edit Document")
self.box = Gtk.Box()
self.box.append(self.entry_row)

self.button = Gtk.Button.new_with_label("test")
self.box.append(self.button)

self.set_content(self.box)`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.