Qt: show main window normally instead of maximized

Sidenote: The main window size calculations are getting stupid.
It would be better to find out the widget sizes and shift
the splitter up, instead of letting it just take up half of the main window.

Idea and part of the code by Richard Henschel
This commit is contained in:
Pasi Kallinen
2024-12-03 19:52:08 +02:00
parent c434b73e94
commit 53f43ab00b
3 changed files with 5 additions and 5 deletions

View File

@@ -2118,6 +2118,7 @@ Qt: with a pick-one menu containing a pre-selected entry, clicking on that
instead of typing the selector letter toggled off preselected entry
but failed to toggle on the explicitly selected one; clicking again
after nothing was pre-selected anymore refused to toggle anything on
Qt: don't show main window and tombstone window maximized by default
tty: redraw unexplored locations as S_unexplored rather than <space> after
map has been partially overwritten by popup menu or text display
tty: previous change resulted in remnants of previous level being shown on

View File

@@ -886,8 +886,8 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
if (qt_settings != NULL) {
auto glyphs = &qt_settings->glyphs();
if (glyphs != NULL) {
maxwn = glyphs->width() * COLNO + 10;
maxhn = glyphs->height() * ROWNO * 6/4;
maxwn = glyphs->width() * (COLNO + 1);
maxhn = glyphs->height() * ROWNO * 6/4 + glyphs->height() * 10;
}
}
@@ -1456,7 +1456,7 @@ void NetHackQtMainWindow::ShowIfReady()
} else {
layout();
}
showMaximized();
showNormal();
} else if (isVisible()) {
hide();
}

View File

@@ -1115,8 +1115,7 @@ void NetHackQtTextWindow::Display(bool block UNUSED)
#endif
int mh = screensize.height()*3/5;
if ( (qt_compact_mode && lines->TotalHeight() > mh) || use_rip ) {
// big, so make it fill
showMaximized();
showNormal();
} else {
move(0, 0);
adjustSize();