Skip to content

Commit

Permalink
Qt: Fix widgets being visible when they shouldn't be
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Aug 19, 2018
1 parent c3b0208 commit 77ebd72
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Core/DolphinQt/MainWindow.cpp
Expand Up @@ -159,6 +159,10 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray());

m_render_widget_geometry = settings.value(QStringLiteral("renderwidget/geometry")).toByteArray();

// Restoring of window states can sometimes go wrong, resulting in widgets being visible when they
// shouldn't be so we have to reapply all our rules afterwards.
Settings::Instance().RefreshWidgetVisibility();
}

MainWindow::~MainWindow()
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/DolphinQt/Settings.cpp
Expand Up @@ -434,6 +434,13 @@ bool Settings::IsJITVisible() const
return QSettings().value(QStringLiteral("debugger/showjit")).toBool();
}

void Settings::RefreshWidgetVisibility()
{
emit DebugModeToggled(IsDebugModeEnabled());
emit LogVisibilityChanged(IsLogVisible());
emit LogConfigVisibilityChanged(IsLogConfigVisible());
}

void Settings::SetDebugFont(QFont font)
{
if (GetDebugFont() != font)
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/Settings.h
Expand Up @@ -66,6 +66,8 @@ class Settings final : public QObject
void SetWidgetsLocked(bool visible);
bool AreWidgetsLocked() const;

void RefreshWidgetVisibility();

// GameList
QStringList GetPaths() const;
void AddPath(const QString& path);
Expand Down

0 comments on commit 77ebd72

Please sign in to comment.