KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Question I'm trying to retrieve the (string) icon name(s) corresponding to a given (string) Gtk stock ID. Example Gtk stock id 'gtk-go-forward' has two corresponding icon names, 'gtk-go-forward-ltr' and 'gtk-go-forward-rtl'. I'd like to retrieve either: both icon names 'gtk-go-forward-ltr' and 'gtk-go-forward-rtl' given the ID 'gtk-go-forward'; OR just the icon name 'gtk-go-forward-ltr' (the "appropriate" one for my text direction). Potential restrictions I'm using the gobject introspection API, not the base C one. Rationale (optional to read) I'm trying to make a St.Icon for the icon specified by the stock ID, but at a largish size (96 px). I can use gtk_icon_set_render_icon with the stock ID 'gtk-go-forward' directly like so (it picks the LTR version) (the syntax is GNOME javscript but this is irrelevant to the quesiton; I'm using the GObject introspection API): let style = Gtk.Widget.get_default_style(); let iconset = style.lookup_icon_set('gtk-go-forward'); let icon = new St.Icon({ gicon: iconset.render_icon(gtkStyle, Gtk.TextDirection.LTR, Gtk.StateType.NORMAL, Gtk.IconSize.DIALOG, null, null), icon_type: St.IconType.FULLCOLOR, icon_size: 96 }); This will give me an icon for stock ID 'gtk-go-forward' (it picks 'gtk-go-forward-ltr'), but the icon is very fuzzy. Alternatively if I feed in the icon name 'gtk-go-forward-ltr' directly, the icon is not fuzzy: let icon = new St.Icon({ gicon: Gio.ThemedIcon.new_with_default_fallbacks('gt
Tags (comma-separated)
Save Edits
Cancel