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