diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 18:24:21 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 18:24:21 -0800 |
commit | afc3ec190b28caa4b470ca6617db7d9f009f586e (patch) | |
tree | 8a8f1eff2943218754a98145d3453f5ffa370ac1 | |
parent | 1c6e89d9dda4d41709abfed4522fd801799bfd30 (diff) |
When font fails to load, grey out text instead of unmapping text widget
Before if you selected a pattern that couldn't load, such as a strange
encoding, the text widget would simply stop updating, giving the user
no feedback that they weren't seeing the selected font, and leaving
repaint turds from menus in the text area. Now we are more clear that
something is wrong, and clean up when menus overlap the text.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xfontsel.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1112,7 +1112,7 @@ void SetCurrentFont(XtPointer closure) XFontStruct *font = XLoadQueryFont(dpy, currentFontNameString); String sample_text; if (font == NULL) - XtUnmapWidget(mapWidget); + XtSetSensitive(mapWidget, False); else { int nargs = 1; Arg args[3]; @@ -1137,6 +1137,7 @@ void SetCurrentFont(XtPointer closure) nargs = 3; } XtSetValues( sampleText, args, nargs ); + XtSetSensitive(mapWidget, True); XtMapWidget(mapWidget); if (sampleFont) XFreeFont( dpy, sampleFont ); sampleFont = font; |