emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect button highlighting


From: Richard Stallman
Subject: Re: incorrect button highlighting
Date: Fri, 21 Sep 2007 08:23:40 -0400

    Actually, it's nothing to do with widgets. This has the same symptoms:

    (progn
      (switch-to-buffer "*example*")
      (insert-image (create-image "prev-node.xpm")
                    (propertize "prev" 'mouse-face 'custom-button-pressed-face))
      (insert-image (create-image "next-node.xpm")
                    (propertize "next" 'mouse-face 
'custom-button-pressed-face)))

That in itself is not a bug, it is just the way mouse-face works.
However, its consequence for widgets is a bug.

If the bug is simply due to using the a fixed value of mouse-face
on every widget, does this fix it?

*** wid-edit.el 12 Aug 2007 13:52:30 -0400      1.176.2.2
--- wid-edit.el 20 Sep 2007 16:51:56 -0400      
***************
*** 405,411 ****
      (unless (widget-get widget :suppress-face)
        (overlay-put overlay 'face (widget-apply widget :button-face-get))
        (overlay-put overlay 'mouse-face
!                  (widget-apply widget :mouse-face-get)))
      (overlay-put overlay 'pointer 'hand)
      (overlay-put overlay 'follow-link follow-link)
      (overlay-put overlay 'help-echo help-echo)))
--- 405,421 ----
      (unless (widget-get widget :suppress-face)
        (overlay-put overlay 'face (widget-apply widget :button-face-get))
        (overlay-put overlay 'mouse-face
!                  ;; Make new list structure for the mouse-face value
!                  ;; so that different widgets will have
!                  ;; different `mouse-face' property values
!                  ;; and will highlight separately.
!                  (let ((mouse-face-value
!                         (widget-apply widget :mouse-face-get)))
!                    ;; If it's a list, copy it.
!                    (if (listp mouse-face-value)
!                        (copy-sequence mouse-face-value)
!                      ;; If it's a symbol, put it in a list.
!                      (list mouse-face-value)))))
      (overlay-put overlay 'pointer 'hand)
      (overlay-put overlay 'follow-link follow-link)
      (overlay-put overlay 'help-echo help-echo)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]