From: PatR Date: Sat, 12 Dec 2020 01:15:21 +0000 (-0800) Subject: dowhatis formatting for Qt X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d0900b3a41180fa45ae8eb2739e0d4d5ae82919;p=nethack dowhatis formatting for Qt The '/' command's variants /o, /O, /m, and /M use spaces to align output in columns and that looks quite bad if rendered in a proportional font. Qt normally uses proportional font for text windows but it watches the supplied lines for any with four consecutive spaces and forces fixed-width font if it sees any. So changing the existing separator line from "" to " " makes Qt format the dowhatis data as intended. --- diff --git a/src/pager.c b/src/pager.c index 991b633b9..5d5fdcce4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 pager.c $NHDT-Date: 1607591207 2020/12/10 09:06:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.190 $ */ +/* NetHack 3.7 pager.c $NHDT-Date: 1607735717 2020/12/12 01:15:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.191 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1252,7 +1252,8 @@ coord *click_cc; any.a_char = '?'; add_menu(win, NO_GLYPH, &any, flags.lootabc ? 0 : any.a_char, 'n', ATR_NONE, - "something else (by symbol or name)", MENU_ITEMFLAGS_NONE); + "something else (by symbol or name)", + MENU_ITEMFLAGS_NONE); if (!u.uswallow && !Hallucination) { any = cg.zeroany; add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, @@ -1489,7 +1490,10 @@ boolean do_mons; /* True => monsters, False => objects */ Sprintf(outbuf, "All %s currently shown on the map:", which); putstr(win, 0, outbuf); - putstr(win, 0, ""); + /* hack alert! Qt watches a text window for any line + with 4 consecutive spaces and renders the window + in a fixed-width font it if finds at least one */ + putstr(win, 0, " "); /* separator */ } /* prefix: "coords C " where 'C' is mon or obj symbol */ Sprintf(outbuf, (cmode == GPCOORDS_SCREEN) ? "%s "