]> granicus.if.org Git - nethack/commitdiff
Qt font selection dropdown menu
authorPatR <rankin@nethack.org>
Tue, 24 Nov 2020 01:39:00 +0000 (17:39 -0800)
committerPatR <rankin@nethack.org>
Tue, 24 Nov 2020 01:39:00 +0000 (17:39 -0800)
In "Qt settings" (or "Preferences" for OSX), the current font size
would show "Medium" if that was the current setting.  So far, so
good.  However, if you clicked on the up/down arrows to get the
dropdown menu, it was truncated to "Mediu" there regardless of
current setting.  Force the menu to be wide enough to show "Medium".

win/Qt/qt_set.cpp

index 939ae89a78721b9290563c10ef11071310b1ff8f..e3e0295b53f992d9993ba3624ff6f4842b8bc001 100644 (file)
@@ -141,6 +141,7 @@ NetHackQtSettings::NetHackQtSettings() :
     connect(&dollheight, SIGNAL(valueChanged(int)), this, SLOT(resizeDoll()));
 #endif
 
+    fontsize.setMinimumContentsLength((int) strlen("Medium"));
     fontsize.addItem("Huge");
     fontsize.addItem("Large");
     fontsize.addItem("Medium");