emacs-devel
[Top][All Lists]
Advanced

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

Re: Cursor on images not visible


From: Juri Linkov
Subject: Re: Cursor on images not visible
Date: Mon, 20 Feb 2006 02:54:45 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> Personally, I have even more problems distinguishing active checkboxes
>> from inactive ones, the ticks are hardly visible.  Maybe you could do
>> something about this too?  I currently use
>
> I think the current default value is ok.  But definitely it should be
> easily customizable.

The patch below makes possible the customization of the checkbox's
appearance.  It checks whether files emacs/etc/images/custom/check0.xpm
and emacs/etc/images/custom/check1.xpm exist, then uses them.  Otherwise,
it creates the checkbox image on the fly, exactly as it does now.

> After putting images of two states of the radio button to the files
> emacs/etc/images/radio0.xpm and emacs/etc/images/radio1.xpm, customize
> displayed them instead of their textual representations "(*)" and "( )".
> I wonder why these images isn't in CVS?

I think if someone wants to add images for radio buttons, then the correct
place is emacs/etc/images/custom, not the current emacs/etc/custom.
The same patch below checks for emacs/etc/images/custom, and also
starts using the new variable image-load-path:

Index: lisp/wid-edit.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/wid-edit.el,v
retrieving revision 1.166
diff -c -r1.166 wid-edit.el
*** lisp/wid-edit.el    16 Feb 2006 15:58:32 -0000      1.166
--- lisp/wid-edit.el    20 Feb 2006 00:54:05 -0000
***************
*** 627,633 ****
         image)
        ((stringp image)
         ;; A string.  Look it up in relevant directories.
!        (let* ((load-path (cons widget-image-directory load-path))
                specs)
           (dolist (elt widget-image-conversion)
             (dolist (ext (cdr elt))
--- 627,637 ----
         image)
        ((stringp image)
         ;; A string.  Look it up in relevant directories.
!        (let* ((image-load-path
!                (cons (file-name-as-directory
!                       (expand-file-name "images/custom" data-directory))
!                      (cons widget-image-directory
!                            image-load-path)))
                specs)
           (dolist (elt widget-image-conversion)
             (dolist (ext (cdr elt))
***************
*** 2162,2180 ****
    ;; We could probably do the same job as the images using single
    ;; space characters in a boxed face with a stretch specification to
    ;; make them square.
!   :on-glyph '(create-image "\300\300\141\143\067\076\034\030"
!                          'xbm t :width 8 :height 8
!                          :background "grey75" ; like default mode line
!                          :foreground "black"
!                          :relief -2
!                          :ascent 'center)
    :off "[ ]"
!   :off-glyph '(create-image (make-string 8 0)
!                           'xbm t :width 8 :height 8
!                           :background "grey75"
!                           :foreground "black"
!                           :relief -2
!                           :ascent 'center)
    :help-echo "Toggle this item."
    :action 'widget-checkbox-action)
  
--- 2164,2189 ----
    ;; We could probably do the same job as the images using single
    ;; space characters in a boxed face with a stretch specification to
    ;; make them square.
!   :on-glyph '(if (widget-image-find "check1")
!                "check1"
!              (create-image "\300\300\141\143\067\076\034\030"
!                            'xbm t :width 8 :height 8
!                            :background "grey75" ; like default mode line
!                            :foreground "black"
!                            :relief -2
!                            :margin 1
!                            :ascent 'center)
!              )
    :off "[ ]"
!   :off-glyph '(if (widget-image-find "check0")
!                 "check0"
!               (create-image (make-string 8 0)
!                             'xbm t :width 8 :height 8
!                             :background "grey75"
!                             :foreground "black"
!                             :relief -2
!                             :margin 1
!                             :ascent 'center))
    :help-echo "Toggle this item."
    :action 'widget-checkbox-action)
  
-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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