mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-31 06:32:39 +00:00
Fix CS Key Binding settings page
This got broken by e07d8f3066. Creating QGridLayout with parent and setting it later has not the same effect.
This commit is contained in:
parent
4dfd2b0f46
commit
a29ae07957
@ -36,7 +36,7 @@ CSMPrefs::SettingWidgets CSMPrefs::BoolSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, &QCheckBox::stateChanged, this, &BoolSetting::valueChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::BoolSetting::updateWidget()
|
||||
|
@ -41,7 +41,7 @@ CSMPrefs::SettingWidgets CSMPrefs::ColourSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, &CSVWidget::ColorEditor::pickingFinished, this, &ColourSetting::valueChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::ColourSetting::updateWidget()
|
||||
|
@ -73,7 +73,7 @@ CSMPrefs::SettingWidgets CSMPrefs::DoubleSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &DoubleSetting::valueChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::DoubleSetting::updateWidget()
|
||||
|
@ -106,7 +106,7 @@ CSMPrefs::SettingWidgets CSMPrefs::EnumSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, qOverload<int>(&QComboBox::currentIndexChanged), this, &EnumSetting::valueChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::EnumSetting::updateWidget()
|
||||
|
@ -65,7 +65,7 @@ CSMPrefs::SettingWidgets CSMPrefs::IntSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, qOverload<int>(&QSpinBox::valueChanged), this, &IntSetting::valueChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::IntSetting::updateWidget()
|
||||
|
@ -47,7 +47,7 @@ namespace CSMPrefs
|
||||
|
||||
connect(widget, &QPushButton::toggled, this, &ModifierSetting::buttonToggled);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = widget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = widget };
|
||||
}
|
||||
|
||||
void ModifierSetting::updateWidget()
|
||||
|
@ -23,7 +23,6 @@ namespace CSMPrefs
|
||||
{
|
||||
QLabel* mLabel;
|
||||
QWidget* mInput;
|
||||
QGridLayout* mLayout;
|
||||
};
|
||||
|
||||
class Setting : public QObject
|
||||
|
@ -51,7 +51,7 @@ namespace CSMPrefs
|
||||
|
||||
connect(widget, &QPushButton::toggled, this, &ShortcutSetting::buttonToggled);
|
||||
|
||||
return SettingWidgets{ .mLabel = label, .mInput = widget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = label, .mInput = widget };
|
||||
}
|
||||
|
||||
void ShortcutSetting::updateWidget()
|
||||
|
@ -36,7 +36,7 @@ CSMPrefs::SettingWidgets CSMPrefs::StringSetting::makeWidgets(QWidget* parent)
|
||||
|
||||
connect(mWidget, &QLineEdit::textChanged, this, &StringSetting::textChanged);
|
||||
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget, .mLayout = nullptr };
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget };
|
||||
}
|
||||
|
||||
void CSMPrefs::StringSetting::updateWidget()
|
||||
|
@ -13,9 +13,6 @@ namespace CSMPrefs
|
||||
|
||||
SettingWidgets Subcategory::makeWidgets(QWidget* /*parent*/)
|
||||
{
|
||||
QGridLayout* const layout = new QGridLayout();
|
||||
layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
||||
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = nullptr, .mLayout = layout };
|
||||
return SettingWidgets{ .mLabel = nullptr, .mInput = nullptr };
|
||||
}
|
||||
}
|
||||
|
@ -81,12 +81,12 @@ namespace CSVPrefs
|
||||
int next = mPageLayout->rowCount();
|
||||
mPageLayout->addWidget(widgets.mInput, next, 0, 1, 2);
|
||||
}
|
||||
else if (widgets.mLayout != nullptr)
|
||||
else
|
||||
{
|
||||
// Create new page
|
||||
QWidget* pageWidget = new QWidget();
|
||||
mPageLayout = widgets.mLayout;
|
||||
mPageLayout->setParent(pageWidget);
|
||||
mPageLayout = new QGridLayout(pageWidget);
|
||||
mPageLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
||||
|
||||
mStackedLayout->addWidget(pageWidget);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user