]> granicus.if.org Git - nethack/commitdiff
dowhatis formatting for Qt
authorPatR <rankin@nethack.org>
Sat, 12 Dec 2020 01:15:21 +0000 (17:15 -0800)
committerPatR <rankin@nethack.org>
Sat, 12 Dec 2020 01:15:21 +0000 (17:15 -0800)
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.

src/pager.c

index 991b633b9bbd0fb53cc68bb0a3d569a104b14b97..5d5fdcce48fdf2cb681d71b93aaa247c82b6b8f9 100644 (file)
@@ -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  "