UI: Selectively disable focus frame

NoFocusFrameStyle was meant to disable focus frames around the scenes/sources
list (on OSX); unfortunately it also removed focus frames from controls that
should have focus frames like input boxes in the settings window
This commit is contained in:
Palana committed 2015-05-07 02:08:09 +02:00
1 parent 9ddbb1077a
commit f1f1ca45df
4 files changed
+7 -14

No files matched your search

-14
View File
@@ -410,19 +410,6 @@ QString OBSTranslator::translate(const char *context, const char *sourceText,
return QT_UTF8(out);
}
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);
}
};
static bool get_token(lexer *lex, string &str, base_token_type type)
{
base_token token;
@@ -611,7 +598,6 @@ static int run_program(fstream &logFile, int argc, char *argv[])
create_log_file(logFile);
program.installTranslator(&translator);
program.setStyle(new NoFocusFrameStyle);
ret = program.OBSInit() ? program.exec() : 0;
+3
View File
@@ -119,6 +119,9 @@ OBSBasic::OBSBasic(QWidget *parent)
qRegisterMetaType<OBSSceneItem>("OBSSceneItem");
qRegisterMetaType<OBSSource> ("OBSSource");
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(windowHandle(), &QWindow::screenChanged, [this]() {
struct obs_video_info ovi;
+2
View File
@@ -217,6 +217,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->setupUi(this);
ui->listWidget->setAttribute(Qt::WA_MacShowFocusRect, false);
HookWidget(ui->language, COMBO_CHANGED, GENERAL_CHANGED);
HookWidget(ui->theme, COMBO_CHANGED, GENERAL_CHANGED);
HookWidget(ui->outputMode, COMBO_CHANGED, OUTPUTS_CHANGED);
+2
View File
@@ -164,6 +164,8 @@ OBSBasicSourceSelect::OBSBasicSourceSelect(OBSBasic *parent, const char *id_)
{
ui->setupUi(this);
ui->sourceList->setAttribute(Qt::WA_MacShowFocusRect, false);
QString placeHolderText{QT_UTF8(obs_source_get_display_name(
OBS_SOURCE_TYPE_INPUT, id))};