Skip to content

Commit dbd5fd5

Browse files
Ski90Mooclaude
andcommitted
fix: restore white menu bar background after language switch (Qt 6)
In Qt 6 the QMenuBar inherits the parent QMainWindow dark background (#2C3233) instead of using the native platform style. Add explicit QMenuBar rules alongside the existing MainWindow stylesheet so the menu bar stays white with black text regardless of locale or restart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ecb06de commit dbd5fd5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/openstudio_lib/MainWindow.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ MainWindow::MainWindow(bool isPlugin, QWidget* parent)
6969
#endif
7070

7171
setObjectName("MainWindow");
72-
setStyleSheet("QWidget#MainWindow { background-color: #2C3233; }");
72+
setStyleSheet("QWidget#MainWindow { background-color: #2C3233; } "
73+
"QMenuBar { background-color: white; color: black; } "
74+
"QMenuBar::item { background-color: transparent; } "
75+
"QMenuBar::item:selected { background-color: #e0e0e0; } "
76+
"QMenuBar::item:pressed { background-color: #d0d0d0; }");
7377

7478
connect(m_verticalTabWidget, &VerticalTabWidget::tabSelected, this, &MainWindow::verticalTabSelected);
7579
connect(m_verticalTabWidget, &VerticalTabWidget::tabSelected, this, &MainWindow::onVerticalTabSelected);

0 commit comments

Comments
 (0)