Convert the one line message prompt to Xft

This commit is contained in:
Ray Chason
2026-08-19 09:37:41 +03:00
committed by Pasi Kallinen
parent 7c9cf20d1d
commit 8ae58f9347
2 changed files with 37 additions and 0 deletions
+32
View File
@@ -558,4 +558,36 @@ extern void X11_set_highlight(Widget, boolean);
extern void X11_set_percent(Widget, unsigned, Pixel);
extern void X11_blink_labels(void);
/*
* These are for widgets that use the enhanced label services only for text
* rendering; not for percentage bars, underlines and such. They only need
* these services if XFT is in use.
*/
#ifdef USE_XFT
static inline void
X11_wrap_widget_if_Xft(Widget w, int win_type)
{
X11_wrap_widget(w, win_type);
}
static inline void
X11_update_label_if_Xft(Widget w)
{
X11_update_label(w);
}
#else /* !USE_XFT */
static inline void
X11_wrap_widget_if_Xft(Widget w, int win_type)
{
nhUse(w);
nhUse(win_type);
}
static inline void
X11_update_label_if_Xft(Widget w)
{
nhUse(w);
}
#endif /* ?USE_XFT */
#endif /* WINX_H */
+5
View File
@@ -2446,6 +2446,7 @@ X11_yn_function_core(
(void) memset(buf2, 'X', 25), buf2[25] = '\0'; /* 25 'X's */
yn_minwidth = (Dimension) XTextWidth(yn_font, buf2,
(int) strlen(buf2));
X11_wrap_widget_if_Xft(yn_label, NHW_MESSAGE);
}
}
@@ -2454,6 +2455,7 @@ X11_yn_function_core(
num_args = 0;
XtSetArg(args[num_args], XtNlabel, buf); num_args++;
XtSetValues(yn_label, args, num_args);
X11_update_label_if_Xft(yn_label);
/* for !slow, pop up the prompt+response widget */
if (!appResources.slow) {
@@ -2497,6 +2499,7 @@ X11_yn_function_core(
num_args = 0;
XtSetArg(args[num_args], XtNlabel, " "); num_args++;
XtSetValues(yn_label, args, num_args);
X11_update_label_if_Xft(yn_label);
input_func = 0; /* keystrokes now belong to the map */
highlight_yn(FALSE); /* disguise yn_label as part of map */
@@ -2620,6 +2623,7 @@ highlight_yn(boolean init)
XtSetArg(args[0], XtNforeground, vals.foreground);
XtSetArg(args[1], XtNbackground, vals.background);
XtSetValues(yn_label, args, TWO);
X11_update_label_if_Xft(yn_label);
}
} else
swap_fg_bg(yn_label);
@@ -2687,6 +2691,7 @@ init_standard_windows(void)
XtSetArg(args[num_args], nhStr(XtNresizable), True); num_args++;
XtSetArg(args[num_args], nhStr(XtNlabel), " "); num_args++;
XtSetValues(yn_label, args, num_args);
X11_wrap_widget_if_Xft(yn_label, NHW_MESSAGE);
}
/*