Remove Qt focus frame from various controls

This commit is contained in:
Palana 2014-01-25 19:42:55 +01:00
parent 93d15ef254
commit 2aa4c1665a

View File

@ -21,6 +21,8 @@
#include <util/platform.h> #include <util/platform.h>
#include <obs.hpp> #include <obs.hpp>
#include <QProxyStyle>
#include "qt-wrappers.hpp" #include "qt-wrappers.hpp"
#include "obs-app.hpp" #include "obs-app.hpp"
#include "window-basic-main.hpp" #include "window-basic-main.hpp"
@ -259,6 +261,19 @@ void OBSApp::OBSInit()
mainWindow->OBSInit(); mainWindow->OBSInit();
} }
struct NoFocusFrameStyle : QProxyStyle
{
void drawControl(ControlElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget=nullptr)
const override
{
if (element == CE_FocusFrame)
return;
QProxyStyle::drawControl(element, option, painter, widget);
}
};
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int ret = -1; int ret = -1;
@ -267,6 +282,7 @@ int main(int argc, char *argv[])
try { try {
OBSApp program(argc, argv); OBSApp program(argc, argv);
program.setStyle(new NoFocusFrameStyle);
program.OBSInit(); program.OBSInit();
ret = program.exec(); ret = program.exec();