Qt/GraphicsWindow: Fix software renderer breaking layout

This commit is contained in:
spycrab 2018-05-08 17:39:03 +02:00
parent 074a17482b
commit be007b436c
2 changed files with 22 additions and 12 deletions

View File

@ -70,18 +70,22 @@ void GraphicsWindow::CreateMainLayout()
connect(m_software_renderer, &SoftwareRendererWidget::BackendChanged, this,
&GraphicsWindow::OnBackendChanged);
m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 305);
m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 305);
m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 305);
m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 305);
m_wrapped_software = GetWrappedWidget(m_software_renderer, this, 50, 305);
if (SConfig::GetInstance().m_strVideoBackend != "Software Renderer")
{
m_tab_widget->addTab(GetWrappedWidget(m_general_widget, this, 50, 305), tr("General"));
m_tab_widget->addTab(GetWrappedWidget(m_enhancements_widget, this, 50, 305),
tr("Enhancements"));
m_tab_widget->addTab(GetWrappedWidget(m_hacks_widget, this, 50, 305), tr("Hacks"));
m_tab_widget->addTab(GetWrappedWidget(m_advanced_widget, this, 50, 305), tr("Advanced"));
m_tab_widget->addTab(m_wrapped_general, tr("General"));
m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements"));
m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks"));
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
}
else
{
m_tab_widget->addTab(GetWrappedWidget(m_software_renderer, this, 50, 305),
tr("Software Renderer"));
m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer"));
}
setLayout(main_layout);
@ -93,16 +97,16 @@ void GraphicsWindow::OnBackendChanged(const QString& backend)
if (backend == QStringLiteral("Software Renderer") && m_tab_widget->count() > 1)
{
m_tab_widget->clear();
m_tab_widget->addTab(m_software_renderer, tr("Software Renderer"));
m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer"));
}
if (backend != QStringLiteral("Software Renderer") && m_tab_widget->count() == 1)
{
m_tab_widget->clear();
m_tab_widget->addTab(m_general_widget, tr("General"));
m_tab_widget->addTab(m_enhancements_widget, tr("Enhancements"));
m_tab_widget->addTab(m_hacks_widget, tr("Hacks"));
m_tab_widget->addTab(m_advanced_widget, tr("Advanced"));
m_tab_widget->addTab(m_wrapped_general, tr("General"));
m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements"));
m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks"));
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
}
emit BackendChanged(backend);

View File

@ -49,6 +49,12 @@ private:
GeneralWidget* m_general_widget;
SoftwareRendererWidget* m_software_renderer;
QWidget* m_wrapped_advanced;
QWidget* m_wrapped_enhancements;
QWidget* m_wrapped_hacks;
QWidget* m_wrapped_general;
QWidget* m_wrapped_software;
X11Utils::XRRConfiguration* m_xrr_config;
QHash<QObject*, const char*> m_widget_descriptions;