UI: Disable wheel scrolling on QComboBoxes

Adds a new ProxyStyle, OBSIgnoreWheelProxyStyle, and applies it to the
entire program. This style sets a StyleHint to disable mouse wheel
scrolling on QComboBoxes.
The existing OBSProxyStyle, which is used only for the context bar, has
been renamed accordingly.
This commit is contained in:
gxalpha
2022-04-02 16:04:51 -07:00
committed by Jim
parent f2b049c0e7
commit e33b7d2dab
4 changed files with 28 additions and 5 deletions
+2
View File
@@ -39,6 +39,7 @@
#include "qt-wrappers.hpp"
#include "obs-app.hpp"
#include "obs-proxy-style.hpp"
#include "log-viewer.hpp"
#include "slider-ignorewheel.hpp"
#include "window-basic-main.hpp"
@@ -1116,6 +1117,7 @@ bool OBSApp::SetTheme(std::string name, std::string path)
QString mpath = QString("file:///") + path.c_str();
setPalette(defaultPalette);
ParseExtraThemeData(path.c_str());
setStyle(new OBSIgnoreWheelProxyStyle);
setStyleSheet(mpath);
QColor color = palette().text().color();
themeDarkMode = !(color.redF() < 0.5);