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

Method resizeEvent

win/Qt/qt_icon.cpp:232–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void NetHackQtLabelledIcon::resizeEvent(QResizeEvent*)
233{
234 setAlignments();
235
236 //int labw=label ? label->fontMetrics().width(label->text()) : 0;
237 int labh=label ? label->fontMetrics().height() : 0;
238 int icoh=icon ? icon->height() : 0;
239 int h=icoh+labh;
240 int icoy=(h>height() ? height()-labh-icoh : height()/2-h/2);
241 int laby=icoy+icoh;
242 if (icon) {
243 icon->setGeometry(0,icoy,width(),icoh);
244 }
245 if (label) {
246 label->setGeometry(0,laby,width(),labh);
247 }
248}
249
250void NetHackQtLabelledIcon::setAlignments()
251{

Callers 1

ForceResizeMethod · 0.95

Calls 1

heightMethod · 0.45

Tested by

no test coverage detected