]> granicus.if.org Git - nethack/commitdiff
X11 extcmd_height_delta resourse
authorPatR <rankin@nethack.org>
Fri, 4 Mar 2016 08:13:23 +0000 (00:13 -0800)
committerPatR <rankin@nethack.org>
Fri, 4 Mar 2016 08:13:23 +0000 (00:13 -0800)
Umpteenth revision of the X11 extended command menu.  Add a new
resource to NetHack.ad to control its initial size.

I still hope there's a better way to do this, but this is my last
shot at it.

doc/fixes36.1
include/winX.h
win/X11/NetHack.ad
win/X11/winX.c
win/X11/winmisc.c

index 02618470f1bdad38d2c3f1c21e276fe1d82755c1..f1f03b2ccea8366b8d957038a7b0fd4689102031 100644 (file)
@@ -251,6 +251,11 @@ unix: add CHECK_PLNAME-option to sysconf to make WIZARDS, EXPLORERS, and
 X11: new NetHack*highlight_prompt resource to control whether the persistent
        prompt line between the map and message windows for the NetHack*slow
        configuration will be highlighted when it's expecting input
+X11: NetHack*extcmd_height_delta resource can be used to adjust initial size
+       of the extended commands menu
+X11: status display split into three columns to accomodate Stone/Deaf/Lev/&c;
+       NetHack*status_condition.foreground, .background, and .showGrip
+       resources replaced by status_condition[1-3].*
 
 
 NetHack Community Patches (or Variation) Included
index 78648c8b4f89e60f8bbdabc7c5298a3e1372c7a4..796121405cd112b8076492f39677feeafd1869e3 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 winX.h  $NHDT-Date: 1454977916 2016/02/09 00:31:56 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
+/* NetHack 3.6 winX.h  $NHDT-Date: 1457079196 2016/03/04 08:13:16 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.23 $ */
 /* Copyright (c) Dean Luick, 1992                                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -252,6 +252,7 @@ typedef struct {
     String tile_file;         /* name of file to open for tiles */
     String icon;              /* name of desired icon */
     int message_lines;        /* number of lines to attempt to show */
+    int extcmd_height_delta;  /* bottom margin for extended command menu */
     String pet_mark_bitmap;   /* X11 bitmap file used to mark pets */
     Pixel pet_mark_color;     /* color of pet mark */
     String pilemark_bitmap;   /* X11 bitmap file used to mark item piles */
index 89a29fd5899d9c0e8ba5c881fa59774a51a5b8f1..0ad47b36b6afa297ae1c8f3c6923f38755cbb6e0 100644 (file)
@@ -1,4 +1,4 @@
-! $NHDT-Date: 1454977917 2016/02/09 00:31:57 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.10 $
+! $NHDT-Date: 1457079198 2016/03/04 08:13:18 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $
 
 ! The display_file, tombstone, and menu windows are all formatted assuming
 ! a fixed width font.  Text windows may or may not be formatted as above.
@@ -188,6 +188,15 @@ NetHack*extended_commands*help.accelerators: #override\n\
                                :<Key>?:        set() notify() unset()
 NetHack*extended_commands*dismiss.accelerators: #override\n\
                                <Key>Escape:    set() notify() unset()
+!
+! The extended command menu may be too big to fit on the screen so need
+! a vertical scroll bar.  When truncated, its height will be as tall as
+! possible unless height_delta is non-zero, in which case there will be
+! that many pixels of margin left unused.  On OSX, this can be used to
+! avoid overlapping with the desktop docking tray to prevent that from
+! obscuring the bottom of the menu.
+NetHack*extcmd_height_delta: 75
+
 !
 !
 ! The following are the default 15 colors that the nethack map uses.
index 491f6f11e3c69858fdd708336c0451a6bcaa6ac3..25229541a24e98d96623bea849ca226dd014b3db 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 winX.c  $NHDT-Date: 1455389907 2016/02/13 18:58:27 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.40 $ */
+/* NetHack 3.6 winX.c  $NHDT-Date: 1457079197 2016/03/04 08:13:17 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */
 /* Copyright (c) Dean Luick, 1992                                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1064,6 +1064,9 @@ static XtResource resources[] = {
       XtOffset(AppResources *, icon), XtRString, nhStr("nh72") },
     { nhStr("message_lines"), nhStr("Message_lines"), XtRInt, sizeof(int),
       XtOffset(AppResources *, message_lines), XtRString, nhStr("12") },
+    { nhStr("extcmd_height_delta"), nhStr("Extcmd_height_delta"),
+      XtRInt, sizeof (int),
+      XtOffset(AppResources *, extcmd_height_delta), XtRString, nhStr("0") },
     { nhStr("pet_mark_bitmap"), nhStr("Pet_mark_bitmap"), XtRString,
       sizeof(String), XtOffset(AppResources *, pet_mark_bitmap), XtRString,
       nhStr("pet_mark.xbm") },
index 23253f4a3dd832958845696b82cc1cf2646c6135..f9d4a248ae404b2bfcd9d2821e0745cb173b25f7 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 winmisc.c       $NHDT-Date: 1455526714 2016/02/15 08:58:34 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.24 $ */
+/* NetHack 3.6 winmisc.c       $NHDT-Date: 1457079197 2016/03/04 08:13:17 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.25 $ */
 /* Copyright (c) Dean Luick, 1992                                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1199,36 +1199,20 @@ Widget *formp; /* return */
     else
         free((char *) commands);
 
-    /*
-     * We actually want height of topmost background window, which
-     * may or may not be the root window.
-     *
-     * On OSX, screen height includes the space taken up by the
-     * desktop title bar, which isn't accessible to applications
-     * unless the preference settings for X11 are changed to force
-     * full-screen mode (so by default, this 'screen_height' value
-     * ends up being bigger than the available size...).
-     */
-    screen_height = XHeightOfScreen(XtScreen(popup));
-
     /*
      * If the menu's complete height is too big for the display,
      * forcing the height to be smaller will cause the vertical
      * scroll bar (enabled but not forced above) to be included.
      */
+    screen_height = XHeightOfScreen(XtScreen(popup));
+    screen_height -= appResources.extcmd_height_delta; /* NetHack.ad */
     if (cumulative_height >= screen_height) {
-        /* trial and error:
-           25 is a guesstimate for scrollbar width on width adjustment;
-           75 is for cumulative height of 3 title bars (desktop,
-           application, and popup) on height adjustment; that will be
-           bigger than needed if the popup can overlap the application's
-           title bar or if there is no desktop title bar; this ought to
-           be deriveable on the fly, or at least user-controlled by a
-           resource, but for now it's hardcoded--user can manually
-           resize if sufficiently motivated... */
+        /* 25 is a guesstimate for scrollbar width;
+           window manager might override the request for y==1 */
         num_args = 0;
+        XtSetArg(args[num_args], XtNy, 1); num_args++;
         XtSetArg(args[num_args], XtNwidth, max_width + 25); num_args++;
-        XtSetArg(args[num_args], XtNheight, screen_height - 75); num_args++;
+        XtSetArg(args[num_args], XtNheight, screen_height - 1); num_args++;
         XtSetValues(popup, args, num_args);
     }
     XtRealizeWidget(popup);