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
+5 -3
View File
@@ -56,13 +56,15 @@ public:
virtual QWidget* Widget();
virtual void StartMenu();
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);
bool is_invent; // using core's WIN_INVEN
public slots:
void All();
void ChooseNone();
@@ -169,7 +171,7 @@ private:
class NetHackQtMenuOrTextWindow : public NetHackQtWindow {
private:
NetHackQtWindow* actual;
QWidget *parent;
QWidget *parent;
public:
NetHackQtMenuOrTextWindow(QWidget *parent = NULL);
@@ -183,7 +185,7 @@ public:
virtual void PutStr(int attr, const QString& text);
// Menu
virtual void StartMenu();
virtual void StartMenu(bool using_WIN_INVENT = false);
virtual void AddMenu(int glyph, const ANY_P *identifier,
char ch, char gch, int attr,
const QString& str, unsigned itemflags);