Subject: bug#23847: KDE and etc/images/help icon

From: Maxim Nikulin <[email-masked]>
Date: Tue, 2 Jun 2020 19:44:40 +0700

It seems that "n:system-file-manager" is not the only problem
icon in the emacs toolbar. I faced the problem with the Breeze
KDE theme and emacs-25.2 in Ubuntu-18.04.

Is there a particular reason of the choice for the help icon
that appears e.g. for customize mode?

- ("etc/images/help" . ("help-browser" "gtk-help"))

Would not it better to use "n:help-contents" for help? Unlike
"help-browser" that comes from apps, "help-contents" belongs to the
Actions category, so its style is uniform with other toolbar icons. 
Unfortunately I could not suggest an equivalent for "diropen", e.g. 
"n:folder-new" could be misleading.

Maybe I have missed something but it looks like as a quite sour story.

KDE developers believes that the problem should be fixed in emacs, see
https://bugs.kde.org/show_bug.cgi?id=353496
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21659
I am not familiar with Gtk so I am unaware if it is possible to adjust 
breeze gtk theme to override compiled-in icon size (22px as default in 
KDE theme vs. 24px used by Gtk).

I am really puzzled by the following statement, I could not get where
related user preferences could be set:
https://developer.gnome.org/gtk3/stable/GtkToolbar.html#gtk-toolbar-set-icon-size
 > gtk_toolbar_set_icon_size ()
 > ...
 > This should only be used for special-purpose toolbars,
 > normal application toolbars should respect
 > the user preferences for the size of icons.

Preferences in settings.ini are ignored, see
https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-icon-sizes
Likely it is impossible to override GtkToolbar icon-size though theme 
CSS as well.

Obviously KDE-specific hints in index.theme are not taken
into account by Gtk

     ToolbarDefault=22
     ToolbarSizes=16,22,32,48

It looks like that it is completely up to the particular application if
icon sizes other than compiled-in defaults should be used. I would
expect some high-level API in Gtk that ensures reasonable icon
sizes across displays of various sizes with minimal efforts of
developers of an application but from the first glance I have not
noticed any traces of code that runs behind the scene ensuring
meaningful defaults. Maybe there is no simple way to properly handle
screens with significantly different resolution connected to the same
box, so such work must be done in every application.

Other application experienced similar problems as well, e.g. inkscape
and gparted. They were solved by adding dedicated icons, adjusting
Breeze theme to allow scaling of icons in some directories, or by
modifying application code to force desired size through explicit scaling.

I do not know if using of gtk_icon_theme_load_icon()
with GTK_ICON_LOOKUP_FORCE_SIZE is a viable approach for emacs.

Are there any objections against "help-contents" icon for help?

P.S. GtkToolbar has been removed from the Gtk master branch.