Qt menu hack

Prevent a small inventory menu as the first one shown from forcing
all subsequent ones from being the same short height by forcing it
to have room for at least 15 lines.  Temporary hack until someone
figures out why resizing the reused WIN_INVEN isn't working.

Does not affect non-inventory menus which get created on demand and
destroyed when done so don't need to change size to fit different
contents.
This commit is contained in:
PatR
2020-10-08 10:18:44 -07:00
parent 1b0a9f8e31
commit 342323eb15
5 changed files with 59 additions and 22 deletions
+10 -8
View File
@@ -2,8 +2,9 @@
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details.
// Qt Binding for NetHack 3.4
// Qt Binding for NetHack 3.7
//
// [original comment from Warwick]
// Unfortunately, this doesn't use Qt as well as I would like,
// primarily because NetHack is fundamentally a getkey-type
// program rather than being event driven (hence the ugly key
@@ -21,24 +22,25 @@ public:
NetHackQtWindow();
virtual ~NetHackQtWindow();
virtual QWidget* Widget() =0;
virtual QWidget* Widget() = 0;
virtual void Clear();
virtual void Display(bool block);
virtual bool Destroy();
virtual void CursorTo(int x,int y);
virtual void CursorTo(int x, int y);
virtual void PutStr(int attr, const QString& text);
void PutStr(int attr, const char *text)
{
PutStr(attr, QString::fromUtf8(text).replace(QChar(0x200B), ""));
}
virtual void StartMenu();
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
const QString& str, unsigned itemflags);
virtual void StartMenu(bool using_WIN_INVEN = false);
virtual void AddMenu(int glyph, const ANY_P* identifier,
char ch, char gch, int attr,
const QString& str, unsigned itemflags);
virtual void EndMenu(const QString& prompt);
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
virtual void ClipAround(int x,int y);
virtual void PrintGlyph(int x,int y,int glyph);
virtual void ClipAround(int x, int y);
virtual void PrintGlyph(int x, int y, int glyph);
virtual void UseRIP(int how, time_t when);
int nhid;