MCPcopy Create free account
hub / github.com/NetHack/NetHack / MenuResize

Method MenuResize

win/Qt/qt_menu.cpp:126–148  ·  view source on GitHub ↗

resize current menu window and the table (rows of entries) inside it

Source from the content-addressed store, hash-verified

124
125// resize current menu window and the table (rows of entries) inside it
126void NetHackQtMenuWindow::MenuResize()
127{
128 // when this was just 'adjustSize()', our sizeHints() was not
129 // being called so explicitly indicate the table widget
130 table->adjustSize();
131 this->adjustSize();
132
133 // Temporary? workaround for scrolling becoming wedged if using
134 // all/none/invert removes all counts so we narrow a non-empty
135 // count column to empty. [That can take away the horizontal
136 // scroll bar but should not be affecting the vertical one, yet
137 // is (Qt 5.11.3).] Typing any digit restored normal scrolling
138 // and the only significant thing about that is that it updates
139 // the prompt line which is outside the table of menu items where
140 // scrolling takes place. Oddly, both prompt changes are needed
141 // (possibly the unnecessary space in the first is being optimized
142 // away but the second call to remove it isn't aware of that, or
143 // perhaps the 'fix' only happens when the line gets shorter).
144 prompt.setText(promptstr + " ");
145 prompt.setText(promptstr);
146 // [Later: becoming wedged doesn't just occur after shrinking the
147 // count column and seems to be triggered by table->adjustSize().]
148}
149
150// Table view columns (0..4):
151//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected