From 53f43ab00bb9ff7efe5be2d532478e9f09fc89ec Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 3 Dec 2024 19:52:08 +0200 Subject: [PATCH] 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 --- doc/fixes3-7-0.txt | 1 + win/Qt/qt_main.cpp | 6 +++--- win/Qt/qt_menu.cpp | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 5aaf97818..1e546c700 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 after map has been partially overwritten by popup menu or text display tty: previous change resulted in remnants of previous level being shown on diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index 73bade00f..14a4f51f6 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -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(); } diff --git a/win/Qt/qt_menu.cpp b/win/Qt/qt_menu.cpp index 69ab6b747..93a9064f6 100644 --- a/win/Qt/qt_menu.cpp +++ b/win/Qt/qt_menu.cpp @@ -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();