#include <X11/StringDefs.h>
#include <X11/Shell.h>
#ifdef USE_LUCID
+#include "xsettings.h"
+#include "../lwlib/xlwmenu.h"
#ifdef HAVE_XAW3D
#include <X11/Xaw3d/Paned.h>
#else /* !HAVE_XAW3D */
return 1;
}
+#ifdef USE_LUCID
+static void
+apply_systemfont_to_dialog (w)
+ Widget w;
+{
+ const char *fn = xsettings_get_system_normal_font ();
+ if (fn)
+ {
+ XrmDatabase db = XtDatabase (XtDisplay (w));
+ if (db)
+ XrmPutStringResource (&db, "*dialog.faceName", fn);
+ }
+}
+
+static void
+apply_systemfont_to_menu (w)
+ Widget w;
+{
+ const char *fn = xsettings_get_system_normal_font ();
+ int defflt;
+
+ if (!fn) return;
+
+ if (XtIsShell (w)) /* popup menu */
+ {
+ Widget *childs = NULL;
+
+ XtVaGetValues (w, XtNchildren, &childs, NULL);
+ if (*childs) w = *childs;
+ }
+
+ /* Only use system font if the default is used for the menu. */
+ XtVaGetValues (w, XtNdefaultFace, &defflt, NULL);
+ if (defflt)
+ XtVaSetValues (w, XtNfaceName, fn, NULL);
+}
+#endif
+
/* Set the contents of the menubar widgets of frame F.
The argument FIRST_TIME is currently ignored;
it is set the first time this is called, from initialize_frame_menubar. */
/* Make menu pop down on C-g. */
XtOverrideTranslations (menubar_widget, override);
+ apply_systemfont_to_menu (menubar_widget);
}
{
record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
- if (GTK_WIDGET_MAPPED (menu))
+ if (gtk_widget_get_mapped (menu))
{
/* Set this to one. popup_widget_loop increases it by one, so it becomes
two. show_help_echo uses this to detect popup menus. */
popup_deactivate_callback,
menu_highlight_callback);
+ apply_systemfont_to_menu (menu);
+
dummy.type = ButtonPress;
dummy.serial = 0;
dummy.send_event = 0;
abort();
dialog_id = widget_id_tick++;
+#ifdef HAVE_XFT
+ apply_systemfont_to_dialog (f->output_data.x->widget);
+#endif
lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
f->output_data.x->widget, 1, 0,
dialog_selection_callback, 0, 0);
lw_modify_all_widgets (dialog_id, first_wv->contents, True);
-
/* Display the dialog box. */
lw_pop_up_all_widgets (dialog_id);
popup_activated_flag = 1;