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

Method Layout

outdated/win/Qt3/qt3_win.cpp:2828–2846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2826 prompt.setText(p ? p : "");
2827}
2828void NetHackQtMenuWindow::Layout()
2829{
2830 int butw=totalWidth()/6; // 6 buttons
2831 int buth=fontMetrics().height()+8; // 8 for spacing & mitres
2832 int prompth=(prompt.text().isNull() ? 0 : buth);
2833
2834 prompt.setGeometry(6,buth,dialog->width()-6,prompth);
2835 int h=dialog->height()-buth-prompth;
2836 setGeometry(0,buth+prompth, dialog->width(), h);
2837
2838 // Below, we take care to use up full width
2839 int x=0;
2840 ok->setGeometry(x,0,butw,buth); x+=butw; butw=(dialog->width()-x)/5;
2841 cancel->setGeometry(x,0,butw,buth); x+=butw; butw=(dialog->width()-x)/4;
2842 all->setGeometry(x,0,butw,buth); x+=butw; butw=(dialog->width()-x)/3;
2843 none->setGeometry(x,0,butw,buth); x+=butw; butw=(dialog->width()-x)/2;
2844 invert->setGeometry(x,0,butw,buth); x+=butw; butw=(dialog->width()-x)/1;
2845 search->setGeometry(x,0,butw,buth);
2846}
2847
2848int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list)
2849{

Callers

nothing calls this directly

Calls 2

heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected