Skip to content

Commit

Permalink
Merge branch 'fix_cs_settings_key_bindings_page' into 'master'
Browse files Browse the repository at this point in the history
Fix CS Key Binding settings page

See merge request OpenMW/openmw!3655
  • Loading branch information
Capostrophic committed Dec 15, 2023
2 parents c969aa4 + a29ae07 commit ba7932f
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/boolsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/coloursetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/doublesetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/enumsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/intsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/modifiersetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion apps/opencs/model/prefs/setting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace CSMPrefs
{
QLabel* mLabel;
QWidget* mInput;
QGridLayout* mLayout;
};

class Setting : public QObject
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/shortcutsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/prefs/stringsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 1 addition & 4 deletions apps/opencs/model/prefs/subcategory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
}
6 changes: 3 additions & 3 deletions apps/opencs/view/prefs/keybindingpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ba7932f

Please sign in to comment.