From 5674bb58e2554e3cfc9e01951de27a81c82f7c67 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 29 Jul 2023 09:58:40 +0200 Subject: [PATCH 1/2] Fix HiDPI issues for menus Menus now use the size that users have set globally for their applications. This is accomplished by removing the fixed font size definition (in points) for `QMenu` in `style.css`. In some places the menus had been set to hard coded font sizes. This code is also removed and applies to the following menus: * Combo box menus * Track operation widget (gear icon on tracks) * The MIDI port menu --- data/themes/default/style.css | 4 ---- src/gui/menus/MidiPortMenu.cpp | 1 - src/gui/tracks/TrackOperationsWidget.cpp | 1 - src/gui/widgets/ComboBox.cpp | 1 - 4 files changed, 7 deletions(-) diff --git a/data/themes/default/style.css b/data/themes/default/style.css index a9646cfe4..12b63cfec 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -115,7 +115,6 @@ QSplashScreen QLabel { QMenu { border-top: 2px solid #08993E; background-color: #15191c; - font-size: 11px; } QMenu::separator { @@ -133,15 +132,12 @@ QMenu::item { QMenu::item:selected { color: #d1d8e4; - font-weight: normal; background-color: #21272b; } QMenu::item:disabled { color: #515459; background-color: #262b30; - font-size: 12px; - font-weight: normal; padding: 4px 32px 4px 20px; } diff --git a/src/gui/menus/MidiPortMenu.cpp b/src/gui/menus/MidiPortMenu.cpp index b1ddf71c9..67ad01f87 100644 --- a/src/gui/menus/MidiPortMenu.cpp +++ b/src/gui/menus/MidiPortMenu.cpp @@ -34,7 +34,6 @@ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : ModelView( nullptr, this ), m_mode( _mode ) { - setFont( pointSize<9>( font() ) ); connect( this, SIGNAL(triggered(QAction*)), this, SLOT(activatedPort(QAction*))); } diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index ddbd2eacd..3e3654974 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -64,7 +64,6 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : "to begin a new drag'n'drop action." ).arg(UI_CTRL_KEY) ); auto toMenu = new QMenu(this); - toMenu->setFont( pointSize<9>( toMenu->font() ) ); connect( toMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu())); diff --git a/src/gui/widgets/ComboBox.cpp b/src/gui/widgets/ComboBox.cpp index bdf78ccce..2377a37ab 100644 --- a/src/gui/widgets/ComboBox.cpp +++ b/src/gui/widgets/ComboBox.cpp @@ -70,7 +70,6 @@ ComboBox::ComboBox( QWidget * _parent, const QString & _name ) : } setFont( pointSize<9>( font() ) ); - m_menu.setFont( pointSize<8>( m_menu.font() ) ); connect( &m_menu, SIGNAL(triggered(QAction*)), this, SLOT(setItem(QAction*))); From d2a0780a6eca1fbddc7b3cd2dc050d283799883d Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Mon, 28 Aug 2023 20:12:09 +0200 Subject: [PATCH 2/2] Adjust classic style sheet Adjust the classic style sheet in the same way that the default style sheet was adjusted. The change also removes the usage of a bold font weight for selected menu items to achieve a more consistent feel. --- data/themes/classic/style.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index 2880fe661..777dbc230 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -82,7 +82,6 @@ lmms--gui--TextFloat, lmms--gui--SimpleTextFloat { QMenu { border:1px solid #747474; background-color: #c9c9c9; - font-size:11px; } QMenu::separator { @@ -98,15 +97,12 @@ QMenu::item { QMenu::item:selected { color: white; - font-weight:bold; background-color: #747474; } QMenu::item:disabled { color: #747474; background-color: #c9c9c9; - font-size:12px; - font-weight: normal; padding: 4px 32px 4px 20px; }