unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org, rms@gnu.org, storm@cua.dk
Subject: Re: Cursor on images not visible
Date: Mon, 20 Feb 2006 02:54:45 +0200	[thread overview]
Message-ID: <871wxyrena.fsf@jurta.org> (raw)
In-Reply-To: <877j7x25r2.fsf@jurta.org> (Juri Linkov's message of "Tue, 14 Feb 2006 19:46:09 +0200")

>> 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	other threads:[~2006-02-20  0:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-07 10:57 Cursor on images not visible Juri Linkov
2006-02-09 17:48 ` Richard M. Stallman
2006-02-09 19:18   ` Juri Linkov
2006-02-10 23:02     ` Richard M. Stallman
2006-02-11 18:51       ` Kim F. Storm
2006-02-12  0:57         ` David Kastrup
2006-02-12 19:28         ` Richard M. Stallman
2006-02-14  1:42           ` Juri Linkov
2006-02-14  9:20             ` martin rudalics
2006-02-14 17:46               ` Juri Linkov
2006-02-20  0:54                 ` Juri Linkov [this message]
2006-02-14 21:27               ` Kim F. Storm
2006-02-15 10:14                 ` martin rudalics
2006-02-14 22:17             ` Richard M. Stallman
2006-02-13  0:40         ` David Kastrup
2006-02-15 12:51           ` Kim F. Storm
2006-02-10 10:17   ` Mathias Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871wxyrena.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).