mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-31 15:32:45 +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);
|
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()
|
void CSMPrefs::BoolSetting::updateWidget()
|
||||||
|
@ -41,7 +41,7 @@ CSMPrefs::SettingWidgets CSMPrefs::ColourSetting::makeWidgets(QWidget* parent)
|
|||||||
|
|
||||||
connect(mWidget, &CSVWidget::ColorEditor::pickingFinished, this, &ColourSetting::valueChanged);
|
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()
|
void CSMPrefs::ColourSetting::updateWidget()
|
||||||
|
@ -73,7 +73,7 @@ CSMPrefs::SettingWidgets CSMPrefs::DoubleSetting::makeWidgets(QWidget* parent)
|
|||||||
|
|
||||||
connect(mWidget, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &DoubleSetting::valueChanged);
|
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()
|
void CSMPrefs::DoubleSetting::updateWidget()
|
||||||
|
@ -106,7 +106,7 @@ CSMPrefs::SettingWidgets CSMPrefs::EnumSetting::makeWidgets(QWidget* parent)
|
|||||||
|
|
||||||
connect(mWidget, qOverload<int>(&QComboBox::currentIndexChanged), this, &EnumSetting::valueChanged);
|
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()
|
void CSMPrefs::EnumSetting::updateWidget()
|
||||||
|
@ -65,7 +65,7 @@ CSMPrefs::SettingWidgets CSMPrefs::IntSetting::makeWidgets(QWidget* parent)
|
|||||||
|
|
||||||
connect(mWidget, qOverload<int>(&QSpinBox::valueChanged), this, &IntSetting::valueChanged);
|
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()
|
void CSMPrefs::IntSetting::updateWidget()
|
||||||
|
@ -47,7 +47,7 @@ namespace CSMPrefs
|
|||||||
|
|
||||||
connect(widget, &QPushButton::toggled, this, &ModifierSetting::buttonToggled);
|
connect(widget, &QPushButton::toggled, this, &ModifierSetting::buttonToggled);
|
||||||
|
|
||||||
return SettingWidgets{ .mLabel = label, .mInput = widget, .mLayout = nullptr };
|
return SettingWidgets{ .mLabel = label, .mInput = widget };
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModifierSetting::updateWidget()
|
void ModifierSetting::updateWidget()
|
||||||
|
@ -23,7 +23,6 @@ namespace CSMPrefs
|
|||||||
{
|
{
|
||||||
QLabel* mLabel;
|
QLabel* mLabel;
|
||||||
QWidget* mInput;
|
QWidget* mInput;
|
||||||
QGridLayout* mLayout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Setting : public QObject
|
class Setting : public QObject
|
||||||
|
@ -51,7 +51,7 @@ namespace CSMPrefs
|
|||||||
|
|
||||||
connect(widget, &QPushButton::toggled, this, &ShortcutSetting::buttonToggled);
|
connect(widget, &QPushButton::toggled, this, &ShortcutSetting::buttonToggled);
|
||||||
|
|
||||||
return SettingWidgets{ .mLabel = label, .mInput = widget, .mLayout = nullptr };
|
return SettingWidgets{ .mLabel = label, .mInput = widget };
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutSetting::updateWidget()
|
void ShortcutSetting::updateWidget()
|
||||||
|
@ -36,7 +36,7 @@ CSMPrefs::SettingWidgets CSMPrefs::StringSetting::makeWidgets(QWidget* parent)
|
|||||||
|
|
||||||
connect(mWidget, &QLineEdit::textChanged, this, &StringSetting::textChanged);
|
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()
|
void CSMPrefs::StringSetting::updateWidget()
|
||||||
|
@ -13,9 +13,6 @@ namespace CSMPrefs
|
|||||||
|
|
||||||
SettingWidgets Subcategory::makeWidgets(QWidget* /*parent*/)
|
SettingWidgets Subcategory::makeWidgets(QWidget* /*parent*/)
|
||||||
{
|
{
|
||||||
QGridLayout* const layout = new QGridLayout();
|
return SettingWidgets{ .mLabel = nullptr, .mInput = nullptr };
|
||||||
layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
|
||||||
|
|
||||||
return SettingWidgets{ .mLabel = nullptr, .mInput = nullptr, .mLayout = layout };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,12 +81,12 @@ namespace CSVPrefs
|
|||||||
int next = mPageLayout->rowCount();
|
int next = mPageLayout->rowCount();
|
||||||
mPageLayout->addWidget(widgets.mInput, next, 0, 1, 2);
|
mPageLayout->addWidget(widgets.mInput, next, 0, 1, 2);
|
||||||
}
|
}
|
||||||
else if (widgets.mLayout != nullptr)
|
else
|
||||||
{
|
{
|
||||||
// Create new page
|
// Create new page
|
||||||
QWidget* pageWidget = new QWidget();
|
QWidget* pageWidget = new QWidget();
|
||||||
mPageLayout = widgets.mLayout;
|
mPageLayout = new QGridLayout(pageWidget);
|
||||||
mPageLayout->setParent(pageWidget);
|
mPageLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
||||||
|
|
||||||
mStackedLayout->addWidget(pageWidget);
|
mStackedLayout->addWidget(pageWidget);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user