Skip to content

Commit

Permalink
Fix QComboBox background and transparency workaround on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
chargeflux committed Feb 19, 2019
1 parent 286aafd commit ef0b5e2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Source/Core/DolphinQt/QtUtils/WrapInScrollArea.cpp
Expand Up @@ -15,6 +15,7 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi
int margin_height)
{
auto* scroll = new QScrollArea;
scroll->setBackgroundRole(QPalette::PlaceholderText);
scroll->setWidget(wrapped_widget);
scroll->setWidgetResizable(true);
scroll->setFrameStyle(QFrame::NoFrame);
Expand All @@ -30,18 +31,6 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi
std::max(recommended_height, to_resize->height()));
}

#if defined(_WIN32) || defined(__APPLE__)
// Transparency can cause unwanted side-effects on OSes other than Windows / macOS

// Make sure the background color stays consistent with the parent widget
QPalette p = wrapped_widget->palette();

p.setColor(QPalette::Window, QColor(0, 0, 0, 0));

wrapped_widget->setPalette(p);
scroll->setPalette(p);
#endif

return scroll;
}

Expand Down

0 comments on commit ef0b5e2

Please sign in to comment.