emacs-devel
[Top][All Lists]
Advanced

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

Re: customize-face: inverse-video does not work when customizing the men


From: Eli Zaretskii
Subject: Re: customize-face: inverse-video does not work when customizing the menu face
Date: Mon, 19 Nov 2001 19:00:22 +0200 (IST)

On 18 Nov 2001, Daniel Ortmann wrote:

> "Eli Zaretskii" <address@hidden> writes:
> 
> >> From: Daniel Ortmann <address@hidden>
> >> Date: 18 Nov 2001 11:36:31 -0600
> 
> >> Yes, it can be customized.  I was able to change the foreground and
> >> background colors of the menu face.  I just rechecked the behavior
> >> again to triple-check myself.
> 
> > So you start Emacs with "emacs -q --no-site-file", and the menu bar
> > has the default black-ish on gray-ish appearance.  Then you type "M-x
> > customize-face RET menu RET", change the foreground and the background
> > colors, click "Set for this session" button, and then the menu bar
> > gets new colors?  is that true?
> 
> About 95%.  I had to investigate the "-q --no-site-file" behavior.
> 
> > If this description is inaccurate, please correct what did I say
> > wrong.
> 
> When run with my normal .emacs and default.el file and customize-face,
> the colors are IMMEDIATE changed in the CURRENT FRAME.
> 
> When I run with "-q --no-site-file" (and did set-mouse-color and
> set-cursor-color to see my mouse and cursor), I have to bring up a NEW
> FRAME and THEN I see my specified colors, in this case black on skyblue.

The changes below seem to fix the problem this user was complaining 
about (whereby the inverse-video attribute of the toolkit menus had no 
effect), but there is one subtle issue that is still unresolved.  If the 
colors of the toolkit menus are unspecified (i.e. Emacs uses whatever 
defaults are supplied by the toolkit or the X resources), setting the 
inverse-video attribute of the `menu' face will still have no effect, 
since we don't know what the colors are, and hence don't set them.

Is there some resource which allows to tell the toolkit to invert the 
colors, instead of inverting them ourselves, like the patch below does?  
If not, can someone suggest any other ways of making the menu colors be 
swapped when the colors are not known?

*** src/xfaces.c~0      Wed Aug 22 11:44:15 2001
--- src/xfaces.c        Mon Nov 19 18:20:02 2001
*************** x_update_menu_appearance (f)
*** 4438,4449 ****
        
        if (STRINGP (LFACE_FOREGROUND (lface)))
        {
!         sprintf (line, "%s.%s*foreground: %s",
                   myname, popup_path,
                   XSTRING (LFACE_FOREGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
!         sprintf (line, "%s.pane.menubar*foreground: %s",
!                  myname, XSTRING (LFACE_FOREGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
          changed_p = 1;
        }
--- 4438,4452 ----
        
        if (STRINGP (LFACE_FOREGROUND (lface)))
        {
!         sprintf (line, "%s.%s*%sground: %s",
                   myname, popup_path,
+                  EQ (LFACE_INVERSE (lface), Qt) ? "back" : "fore",
                   XSTRING (LFACE_FOREGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
!         sprintf (line, "%s.pane.menubar*%sground: %s",
!                  myname,
!                  EQ (LFACE_INVERSE (lface), Qt) ? "back" : "fore",
!                  XSTRING (LFACE_FOREGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
          changed_p = 1;
        }
*************** x_update_menu_appearance (f)
*** 4450,4461 ****
  
        if (STRINGP (LFACE_BACKGROUND (lface)))
        {
!         sprintf (line, "%s.%s*background: %s",
                   myname, popup_path,
                   XSTRING (LFACE_BACKGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
!         sprintf (line, "%s.pane.menubar*background: %s",
!                  myname, XSTRING (LFACE_BACKGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
          changed_p = 1;
        }
--- 4453,4467 ----
  
        if (STRINGP (LFACE_BACKGROUND (lface)))
        {
!         sprintf (line, "%s.%s*%sground: %s",
                   myname, popup_path,
+                  EQ (LFACE_INVERSE (lface), Qt) ? "fore" : "back",
                   XSTRING (LFACE_BACKGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
!         sprintf (line, "%s.pane.menubar*%sground: %s",
!                  myname,
!                  EQ (LFACE_INVERSE (lface), Qt) ? "fore" : "back",
!                  XSTRING (LFACE_BACKGROUND (lface))->data);
          XrmPutLineResource (&rdb, line);
          changed_p = 1;
        }



reply via email to

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