mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Editor: Add a reset to defaults button to keybindings (feature #4068)
This commit is contained in:
parent
95f9e4f4c9
commit
7659370992
3 changed files with 22 additions and 0 deletions
|
@ -204,6 +204,7 @@
|
|||
Feature #3980: In-game option to disable controller
|
||||
Feature #3999: Shift + Double Click should maximize/restore menu size
|
||||
Feature #4001: Toggle sneak controller shortcut
|
||||
Feature #4068: OpenMW-CS: Add a button to reset key bindings to defaults
|
||||
Feature #4129: Beta Comment to File
|
||||
Feature #4209: Editor: Faction rank sub-table
|
||||
Feature #4255: Handle broken RepairedOnMe script function
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
#include <QPushButton>
|
||||
#include <QStackedLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "../../model/prefs/setting.hpp"
|
||||
#include "../../model/prefs/category.hpp"
|
||||
#include "../../model/prefs/state.hpp"
|
||||
|
||||
namespace CSVPrefs
|
||||
{
|
||||
|
@ -29,8 +31,18 @@ namespace CSVPrefs
|
|||
mPageSelector = new QComboBox();
|
||||
connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int)));
|
||||
|
||||
QFrame* lineSeparator = new QFrame(topWidget);
|
||||
lineSeparator->setFrameShape(QFrame::HLine);
|
||||
lineSeparator->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
// Reset key bindings button
|
||||
QPushButton* resetButton = new QPushButton ("Reset to Defaults", topWidget);
|
||||
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetKeyBindings()));
|
||||
|
||||
topLayout->addWidget(mPageSelector);
|
||||
topLayout->addWidget(stackedWidget);
|
||||
topLayout->addWidget(lineSeparator);
|
||||
topLayout->addWidget(resetButton);
|
||||
topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
||||
|
||||
// Add each option
|
||||
|
@ -85,4 +97,9 @@ namespace CSVPrefs
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KeyBindingPage::resetKeyBindings()
|
||||
{
|
||||
CSMPrefs::State::get().resetCategory("Key Bindings");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ namespace CSVPrefs
|
|||
QStackedLayout* mStackedLayout;
|
||||
QGridLayout* mPageLayout;
|
||||
QComboBox* mPageSelector;
|
||||
|
||||
private slots:
|
||||
|
||||
void resetKeyBindings();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue