Skip to content

Commit

Permalink
Work around Qt windows11 theme menu bar padding
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiaholmquist committed Oct 24, 2024
1 parent 287f664 commit 8b6628b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/frontend/qt_sdl/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ MainWindow::MainWindow(int id, EmuInstance* inst, QWidget* parent) :
setAcceptDrops(true);
setFocusPolicy(Qt::ClickFocus);

#ifdef WIN32
// The "windows11" theme has pretty massive padding around menubar items, this makes Config and Help not fit in a window at 1x screen sizing
// So let's reduce the padding a bit.
if (QApplication::style()->name() == "windows11")
setStyleSheet("QMenuBar::item { padding: 4px 8px; }");
#endif

QMenuBar* menubar = new QMenuBar();
{
QMenu* menu = menubar->addMenu("File");
Expand Down

0 comments on commit 8b6628b

Please sign in to comment.