Subject: Re: bug#57813: Icon images are non-functional

From: Juri Linkov <[email-masked]>
Date: Sun, 23 Oct 2022 19:55:52 +0300

>> It seems in some cases this can cause an overlap between the heading and
>> the image, like on the screenshot:
>
> It's hard to guess whether the outlines are using buttons or margins.
> Probably buttons, because margins are not displayed in *Completions*.
> Actually the same problem exists for both of them.  By default the
> button/margin face is inherited, because in most modes inheriting
> fontification from the outline heading lines provides a nicer look,
> but your example demonstrates that in some cases that face needs to be
> overridden.  Then there are several variants what face to use instead:
> 1. the default face; 2. the outline faces outline-1, outline-2, ...
> corresponding to the outline level.  So it's not clear what to prefer here.

Now refactored the outline button icon functions to support
the face attribute of the icon for margins and buttons.
So if an icon definition is customized to contain
e.g. ':face default':

  (define-icon outline-open nil
    '((image "outline-open.svg" "outline-open.pbm" :height (0.8 . em)
       :face default)
      (symbol " ▼ "
       :face default))

then it doesn't inherit the outline heading face.

> But there is a simpler way to avoid such a problem: it's possible
> to customize the face 'completions-group-separator' to remove
> the face attribute 'strike-through'.  Then you can also use:
> (setq-local outline-minor-mode-highlight 'override)
> that will use the outline faces on the group headings,
> and the button/margin will inherit it.

For better compatibility with different face combinations,
I changed the 'completions-group-separator' face attribute
'strike-through' to 'underline'.