Changeset 867
- Timestamp:
- 04/29/08 21:48:03 (3 months ago)
- Files:
-
- trunk/src/ui-menu.c (modified) (3 diffs)
- trunk/src/ui-menu.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ui-menu.c
r865 r867 20 20 #include "ui-menu.h" 21 21 22 /* Cursor colours */ 23 const byte curs_attrs[2][2] = 24 { 25 { TERM_SLATE, TERM_BLUE }, /* Greyed row */ 26 { TERM_WHITE, TERM_L_BLUE } /* Valid row */ 27 }; 28 22 29 /* Some useful constants */ 23 30 const char lower_case[] = "abcdefghijklmnopqrstuvwxyz"; 24 31 const char upper_case[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 25 26 int jumpscroll = 0;27 int menu_width = 23;28 32 29 33 /* forward declarations */ … … 208 212 /* Keep a certain distance from the top when possible */ 209 213 if ((cursor <= *top) && (*top > 0)) 210 *top = cursor - jumpscroll -1;214 *top = cursor - 1; 211 215 212 216 /* Keep a certain distance from the bottom when possible */ 213 217 if (cursor >= *top + (rows_per_page - 1)) 214 *top = cursor - (rows_per_page - 1) + 1 + jumpscroll;218 *top = cursor - (rows_per_page - 1) + 1; 215 219 216 220 /* Limit the top to legal places */ … … 270 274 int rows_per_page = loc->page_rows; 271 275 int cols = (n + rows_per_page - 1) / rows_per_page; 272 int colw = menu_width;276 int colw = 23; 273 277 274 278 Term_get_size(&w, &h); trunk/src/ui-menu.h
r865 r867 13 13 14 14 /* Colors for interactive menus */ 15 enum { 15 enum 16 { 16 17 CURS_UNKNOWN = 0, /* Use gray; dark blue for cursor */ 17 18 CURS_KNOWN = 1 /* Use white; light blue for cursor */ 18 19 }; 19 static const byte curs_attrs[2][2] = 20 { 21 {TERM_SLATE, TERM_BLUE}, /* Greyed row */ 22 {TERM_WHITE, TERM_L_BLUE} /* Valid row */ 23 }; 20 21 /* Cursor colours for different states */ 22 extern const byte curs_attrs[2][2]; 24 23 25 24 /* Standard menu orderings */ 26 extern const char default_choice[]; /* 1234567890A-Za-z */27 25 extern const char lower_case[]; /* abc..z */ 28 26 extern const char upper_case[]; /* ABC..Z */
