mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
UI: Use native combobox popup on macOS
As recommended by Qt on QTBUG-106162, this fixes QComboBox popups not working with VoiceOver.
This commit is contained in:
parent
cd78ecae50
commit
2272efc91f
|
@ -1249,7 +1249,7 @@ bool OBSApp::SetTheme(std::string name, std::string path)
|
|||
bool OBSApp::InitTheme()
|
||||
{
|
||||
defaultPalette = palette();
|
||||
setStyle(new OBSIgnoreWheelProxyStyle());
|
||||
setStyle(new OBSProxyStyle());
|
||||
|
||||
const char *themeName =
|
||||
config_get_string(globalConfig, "General", "CurrentTheme3");
|
||||
|
|
|
@ -77,13 +77,16 @@ OBSContextBarProxyStyle::generatedIconPixmap(QIcon::Mode iconMode,
|
|||
return QProxyStyle::generatedIconPixmap(iconMode, pixmap, option);
|
||||
}
|
||||
|
||||
int OBSIgnoreWheelProxyStyle::styleHint(StyleHint hint,
|
||||
const QStyleOption *option,
|
||||
const QWidget *widget,
|
||||
QStyleHintReturn *returnData) const
|
||||
int OBSProxyStyle::styleHint(StyleHint hint, const QStyleOption *option,
|
||||
const QWidget *widget,
|
||||
QStyleHintReturn *returnData) const
|
||||
{
|
||||
if (hint == SH_ComboBox_AllowWheelScrolling)
|
||||
return 0;
|
||||
#ifdef __APPLE__
|
||||
if (hint == SH_ComboBox_UseNativePopup)
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
#include <QProxyStyle>
|
||||
|
||||
class OBSIgnoreWheelProxyStyle : public QProxyStyle {
|
||||
class OBSProxyStyle : public QProxyStyle {
|
||||
public:
|
||||
int styleHint(StyleHint hint, const QStyleOption *option,
|
||||
const QWidget *widget,
|
||||
QStyleHintReturn *returnData) const override;
|
||||
};
|
||||
|
||||
class OBSContextBarProxyStyle : public OBSIgnoreWheelProxyStyle {
|
||||
class OBSContextBarProxyStyle : public OBSProxyStyle {
|
||||
public:
|
||||
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
|
||||
const QStyleOption *option) const override;
|
||||
|
|
Loading…
Reference in a new issue