Tabify the #wizcustom menu
This commit is contained in:
+20
-9
@@ -1952,9 +1952,11 @@ wiz_custom(void)
|
||||
|
||||
win = create_nhwindow(NHW_MENU);
|
||||
start_menu(win, MENU_BEHAVE_STANDARD);
|
||||
add_menu_heading(win,
|
||||
" glyph glyph identifier "
|
||||
" sym clr customcolor unicode utf8");
|
||||
const char *heading = iflags.menu_tab_sep
|
||||
? "glyph\tglyph identifier\tsym\tclr\tcustomcolor\tunicode\tutf8"
|
||||
: " glyph glyph identifier "
|
||||
" sym clr customcolor unicode utf8";
|
||||
add_menu_heading(win, heading);
|
||||
Sprintf(bufa, "%s: colorcount=%ld %s", wizcustom,
|
||||
(long) iflags.colorcount,
|
||||
gs.symset[PRIMARYSET].name ? gs.symset[PRIMARYSET].name
|
||||
@@ -2001,26 +2003,35 @@ wizcustom_callback(winid win, int glyphnum, char *id)
|
||||
cgm->u ||
|
||||
#endif
|
||||
cgm->customcolor != 0) {
|
||||
Sprintf(bufa, "[%04d] %-44s", glyphnum, id);
|
||||
Sprintf(bufb, "'\\%03d' %02d",
|
||||
gs.showsyms[cgm->sym.symidx], cgm->sym.color);
|
||||
Sprintf(bufc, "%011lx", (unsigned long) cgm->customcolor);
|
||||
if (iflags.menu_tab_sep) {
|
||||
Sprintf(bufa, "[%04d]\t%s\t", glyphnum, id);
|
||||
Sprintf(bufb, "'\\%03d'\t%02d\t",
|
||||
gs.showsyms[cgm->sym.symidx], cgm->sym.color);
|
||||
Sprintf(bufc, "%011lx\t", (unsigned long) cgm->customcolor);
|
||||
} else {
|
||||
Sprintf(bufa, "[%04d] %-45s", glyphnum, id);
|
||||
Sprintf(bufb, "'\\%03d' %02d ",
|
||||
gs.showsyms[cgm->sym.symidx], cgm->sym.color);
|
||||
Sprintf(bufc, "%011lx ", (unsigned long) cgm->customcolor);
|
||||
}
|
||||
bufu[0] = '\0';
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (cgm->u && cgm->u->utf8str) {
|
||||
uint8 *cp;
|
||||
char sep = iflags.menu_tab_sep ? '\t' : ' ';
|
||||
Sprintf(bufu, "U+%04lx", (unsigned long) cgm->u->utf32ch);
|
||||
cp = cgm->u->utf8str;
|
||||
while (*cp) {
|
||||
char bufd[BUFSZ];
|
||||
Sprintf(bufd, " <%d>", (int) *cp);
|
||||
Sprintf(bufd, "%c<%d>", sep, (int) *cp);
|
||||
Strcat(bufu, bufd);
|
||||
cp++;
|
||||
sep = ' ';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
any.a_int = glyphnum + 1; /* avoid 0 */
|
||||
Snprintf(buf, sizeof buf, "%s %s %s %s", bufa, bufb, bufc, bufu);
|
||||
Snprintf(buf, sizeof buf, "%s%s%s%s", bufa, bufb, bufc, bufu);
|
||||
add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, buf,
|
||||
MENU_ITEMFLAGS_NONE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user