diff options
author | Paul Reilly <pmr@pajato.com> | 1994-10-02 12:14:00 +0000 |
---|---|---|
committer | Paul Reilly <pmr@pajato.com> | 1994-10-02 12:14:00 +0000 |
commit | ef799b54dab5c4dec118f24695a9b4ad8edb28e1 (patch) | |
tree | 3530df8c494febf3262badc49d6597cfb605fd71 /lwlib | |
parent | 12a938fe20f3fae3d1d69401e68df711453c76b5 (diff) | |
download | emacs-ef799b54dab5c4dec118f24695a9b4ad8edb28e1.tar.gz |
(display_menu_item): Add support for displaying the title in pop up menus.
Diffstat (limited to 'lwlib')
-rw-r--r-- | lwlib/xlwmenu.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 31773e1e001..4b5e589538f 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -516,10 +516,19 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p, just_compute } else { + int x_offset = x + h_spacing + shadow; char* display_string = resource_widget_value (mw, val); draw_shadow_rectangle (mw, ws->window, x, y, width, height, True); - XDrawString (XtDisplay (mw), ws->window, text_gc, - x + h_spacing + shadow, + + /* Deal with centering a menu title. */ + if (!horizontal_p && !val->contents && !val->call_data) + { + int l = string_width (mw, display_string); + + if (width > l) + x_offset = (width - l) >> 1; + } + XDrawString (XtDisplay (mw), ws->window, text_gc, x_offset, y + v_spacing + shadow + font_ascent, display_string, strlen (display_string)); |