aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds/options-dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/3ds/options-dialog.cpp')
-rw-r--r--backends/platform/3ds/options-dialog.cpp41
1 files changed, 31 insertions, 10 deletions
diff --git a/backends/platform/3ds/options-dialog.cpp b/backends/platform/3ds/options-dialog.cpp
index a6be649ac0..d57daa7cdc 100644
--- a/backends/platform/3ds/options-dialog.cpp
+++ b/backends/platform/3ds/options-dialog.cpp
@@ -61,7 +61,7 @@ OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) {
_screenRadioGroup->setValue(config.screen);
new GUI::StaticTextWidget(this, 0, 100, 110, 15, _("C-Pad Sensitivity:"), Graphics::kTextAlignRight);
- _sensitivity = new GUI::SliderWidget(this, 115, 100, 160, 15, "TODO: Add tooltip", 1);
+ _sensitivity = new GUI::SliderWidget(this, 115, 100, 160, 15);
_sensitivity->setMinValue(-15);
_sensitivity->setMaxValue(30);
_sensitivity->setValue(config.sensitivity);
@@ -72,20 +72,41 @@ OptionsDialog::~OptionsDialog() {
optionMenuOpened = false;
}
-void OptionsDialog::updateConfigManager() {
- config.showCursor = _showCursorCheckbox->getState();
- config.snapToBorder = _snapToBorderCheckbox->getState();
- config.stretchToFit = _stretchToFitCheckbox->getState();
- config.sensitivity = _sensitivity->getValue();
- config.screen = _screenRadioGroup->getValue();
- saveConfig();
- loadConfig();
+bool OptionsDialog::getShowCursor() const {
+ return _showCursorCheckbox->getState();
+}
+
+bool OptionsDialog::getSnapToBorder() const {
+ return _snapToBorderCheckbox->getState();
+}
+
+bool OptionsDialog::getStretchToFit() const {
+ return _stretchToFitCheckbox->getState();
+}
+
+int OptionsDialog::getSensitivity() const {
+ return _sensitivity->getValue();
+}
+
+int OptionsDialog::getScreen() const {
+ return _screenRadioGroup->getValue();
+}
+
+void OptionsDialog::reflowLayout() {
+ const int screenW = g_system->getOverlayWidth();
+ const int screenH = g_system->getOverlayHeight();
+
+ // Center the dialog
+ _x = (screenW - getWidth()) / 2;
+ _y = (screenH - getHeight()) / 2;
+
+ GUI::Dialog::reflowLayout();
}
void OptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
switch(cmd) {
case GUI::kOKCmd:
- updateConfigManager();
+ setResult(1);
// Fall through
case GUI::kCloseCmd:
close();