Qt screen layout

Simplify a recent change to the screen layout.  Qt can calculate
the details and the recent code resulted in a slight amount of
blank space between the paperdoll and its resize hotspot.

Fix an off-by-one bug in the paperdoll resize routine.  (The one
pixel margin at the top was being overlooked.)
This commit is contained in:
PatR
2020-11-15 08:59:08 -08:00
parent 0f6b3fb6eb
commit 560d324a2f
2 changed files with 9 additions and 10 deletions
+4 -4
View File
@@ -222,13 +222,13 @@ QSize NetHackQtInvUsageWindow::sizeHint(void) const
if (iflags.wc_ascii_map)
qt_settings->doll_is_shown = false;
if (qt_settings->doll_is_shown) {
w = (1 + qt_settings->dollWidth + 1) * 3;
h = (1 + qt_settings->dollHeight + 1) * 6;
w += (1 + qt_settings->dollWidth + 1) * 3;
h += (1 + qt_settings->dollHeight + 1) * 6;
}
#else
if (iflags.wc_tiled_map) {
w = (1 + qt_settings->glyphs().width() + 1) * 3;
h = (1 + qt_settings->glyphs().height() + 1) * 6;
w += (1 + qt_settings->glyphs().width() + 1) * 3;
h += (1 + qt_settings->glyphs().height() + 1) * 6;
}
#endif
return QSize(w, h);