mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-18 14:42:27 +00:00
Merge pull request #2666 from Capostrophic/keybindings
Editor: Add a reset to defaults button to keybindings (feature #4068)
This commit is contained in:
commit
8bfca9830f
@ -205,6 +205,7 @@
|
|||||||
Feature #3980: In-game option to disable controller
|
Feature #3980: In-game option to disable controller
|
||||||
Feature #3999: Shift + Double Click should maximize/restore menu size
|
Feature #3999: Shift + Double Click should maximize/restore menu size
|
||||||
Feature #4001: Toggle sneak controller shortcut
|
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 #4129: Beta Comment to File
|
||||||
Feature #4209: Editor: Faction rank sub-table
|
Feature #4209: Editor: Faction rank sub-table
|
||||||
Feature #4255: Handle broken RepairedOnMe script function
|
Feature #4255: Handle broken RepairedOnMe script function
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "../../model/prefs/setting.hpp"
|
#include "../../model/prefs/setting.hpp"
|
||||||
#include "../../model/prefs/category.hpp"
|
#include "../../model/prefs/category.hpp"
|
||||||
|
#include "../../model/prefs/state.hpp"
|
||||||
|
|
||||||
namespace CSVPrefs
|
namespace CSVPrefs
|
||||||
{
|
{
|
||||||
@ -29,8 +31,18 @@ namespace CSVPrefs
|
|||||||
mPageSelector = new QComboBox();
|
mPageSelector = new QComboBox();
|
||||||
connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int)));
|
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(mPageSelector);
|
||||||
topLayout->addWidget(stackedWidget);
|
topLayout->addWidget(stackedWidget);
|
||||||
|
topLayout->addWidget(lineSeparator);
|
||||||
|
topLayout->addWidget(resetButton);
|
||||||
topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
topLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
|
||||||
|
|
||||||
// Add each option
|
// 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;
|
QStackedLayout* mStackedLayout;
|
||||||
QGridLayout* mPageLayout;
|
QGridLayout* mPageLayout;
|
||||||
QComboBox* mPageSelector;
|
QComboBox* mPageSelector;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void resetKeyBindings();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user