Commit bce72079 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(x_update_menu_appearance): Renamed from

x_set_menu_face_resources.  Use different resources for popups.
parent 97305dec
......@@ -601,6 +601,10 @@ static void clear_font_table P_ ((struct frame *));
extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
#endif /* WINDOWSNT */
#ifdef USE_X_TOOLKIT
static void x_update_menu_appearance P_ ((struct frame *));
#endif /* USE_X_TOOLKIT */
#endif /* HAVE_WINDOW_SYSTEM */
......@@ -4341,53 +4345,51 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
#endif /* HAVE_WINDOW_SYSTEM */
#ifdef HAVE_X_WINDOWS
/***********************************************************************
Menu face
***********************************************************************/
#ifdef USE_X_TOOLKIT
#if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
void
x_set_menu_face_resources (f)
/* Make menus on frame F appear as specified by the `menu' face. */
static void
x_update_menu_appearance (f)
struct frame *f;
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
XrmDatabase rdb;
if (dpyinfo)
{
Display *dpy = FRAME_X_DISPLAY (f);
XrmDatabase rdb = XrmGetDatabase (dpy);
extern Lisp_Object Vx_resource_name;
if (rdb)
if (dpyinfo
&& (rdb = XrmGetDatabase (FRAME_X_DISPLAY (f)),
rdb != NULL))
{
char line[512];
Lisp_Object lface = lface_from_face_name (f, Qmenu, 1);
struct face *face = FACE_FROM_ID (f, MENU_FACE_ID);
char *myname = XSTRING (Vx_resource_name)->data;
int changes = 0;
int changed_p = 0;
if (STRINGP (LFACE_FOREGROUND (lface)))
{
sprintf (line, "%s.menu*foreground: %s",
sprintf (line, "%s.popup_menu*foreground: %s",
myname, XSTRING (LFACE_FOREGROUND (lface))->data);
XrmPutLineResource (&rdb, line);
sprintf (line, "%s.pane.menubar*foreground: %s",
myname, XSTRING (LFACE_FOREGROUND (lface))->data);
XrmPutLineResource (&rdb, line);
++changes;
changed_p = 1;
}
if (STRINGP (LFACE_BACKGROUND (lface)))
{
sprintf (line, "%s*menu*background: %s",
sprintf (line, "%s.popup_menu*background: %s",
myname, XSTRING (LFACE_BACKGROUND (lface))->data);
XrmPutLineResource (&rdb, line);
sprintf (line, "%s.pane.menubar*background: %s",
myname, XSTRING (LFACE_BACKGROUND (lface))->data);
XrmPutLineResource (&rdb, line);
++changes;
changed_p = 1;
}
if (face->font_name
......@@ -4399,33 +4401,28 @@ x_set_menu_face_resources (f)
|| !UNSPECIFIEDP (LFACE_HEIGHT (lface))))
{
#ifdef USE_MOTIF
char *format1 = "%s.pane.menubar*fontList: %s";
char *format2 = "%s*menu*fontList: %s";
const char *suffix = "List";
#else
char *format1 = "%s.pane.menubar*font: %s";
char *format2 = "%s*menu*font: %s";
const char *suffix = "";
#endif
sprintf (line, format1, myname, face->font_name);
sprintf (line, "%s.pane.menubar*font%s: %s",
myname, suffix, face->font_name);
XrmPutLineResource (&rdb, line);
sprintf (line, format2, myname, face->font_name);
sprintf (line, "%s.popup_menu*font%s: %s",
myname, suffix, face->font_name);
XrmPutLineResource (&rdb, line);
++changes;
changed_p = 1;
}
if (changes && f->output_data.x->menubar_widget)
if (changed_p && f->output_data.x->menubar_widget)
{
free_frame_menubar (f);
set_frame_menubar (f, 1, 1);
XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
}
}
}
}
#endif /* USE_X_TOOLKIT */
#endif /* HAVE_X_WINDOWS */
#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */
......@@ -5972,7 +5969,7 @@ realize_basic_faces (f)
{
menu_face_change_count = 0;
#ifdef USE_X_TOOLKIT
x_set_menu_face_resources (f);
x_update_menu_appearance (f);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment