GNU bug report logs - #57813
Icon images are non-functional

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 14 Sep 2022 19:43:02 UTC

Severity: normal

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: 57813 <at> debbugs.gnu.org
Subject: bug#57813: Icon images are non-functional
Date: Thu, 15 Sep 2022 22:53:07 +0300
[Message part 1 (text/plain, inline)]
> Fixed now in 471414fe6b.

Since now images can be displayed in outlines,
here is a patch that adds nice images to outlines
that look like this:

[outlines.png (image/png, inline)]
[outline-svg.patch (text/x-diff, inline)]
diff --git a/etc/images/outline-close.svg b/etc/images/outline-close.svg
new file mode 100644
index 0000000000..ea9157a5fb
--- /dev/null
+++ b/etc/images/outline-close.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+<title>outline-close</title>
+<g transform="rotate(-90, 10, 10)">
+<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>
+</g>
+</svg>
diff --git a/etc/images/outline-open.svg b/etc/images/outline-open.svg
new file mode 100644
index 0000000000..75cf6aff9f
--- /dev/null
+++ b/etc/images/outline-open.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+<title>outline-open</title>
+<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>
+</svg>
diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el
index 93749a3451..ff4f20c207 100644
--- a/lisp/emacs-lisp/icons.el
+++ b/lisp/emacs-lisp/icons.el
@@ -202,7 +202,7 @@ icons--create
                             :height (if (eq height 'line)
                                         (window-default-line-height)
                                       height)
-                            :scale 1)
+                            :scale 1 :ascent 'center)
             (create-image file))))))
 
 (cl-defmethod icons--create ((_type (eql 'emoji)) icon _keywords)
diff --git a/lisp/outline.el b/lisp/outline.el
index b19e0cf811..364c3bee84 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -292,16 +295,18 @@ outline-minor-mode-use-buttons
   :safe #'booleanp
   :version "29.1")
 
-(define-icon outline-open button
-  '((emoji "🔽")
+(define-icon outline-open nil
+  '((image "outline-open.svg" :height 15 :ascent center)
+    (emoji "🔽")
     (symbol " ▼ ")
     (text " open "))
   "Icon used for buttons for opening a section in outline buffers."
   :version "29.1"
   :help-echo "Open this section")
 
-(define-icon outline-close button
-  '((emoji "▶️")
+(define-icon outline-close nil
+  '((image "outline-close.svg" :height 15 :ascent center)
+    (emoji "▶️")
     (symbol " ▶ ")
     (text " close "))
   "Icon used for buttons for closing a section in outline buffers."

This bug report was last modified 2 years and 270 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.