mirror of
https://git.suyu.dev/suyu/suyu
synced 2025-09-20 21:12:09 -05:00
modifying all the files to match the app
This commit is contained in:
50
src/suyu/configuration/configure_touchscreen_advanced.cpp
Normal file
50
src/suyu/configuration/configure_touchscreen_advanced.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <memory>
|
||||
#include "common/settings.h"
|
||||
#include "ui_configure_touchscreen_advanced.h"
|
||||
#include "suyu/configuration/configure_touchscreen_advanced.h"
|
||||
|
||||
ConfigureTouchscreenAdvanced::ConfigureTouchscreenAdvanced(QWidget* parent)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchscreenAdvanced>()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->restore_defaults_button, &QPushButton::clicked, this,
|
||||
&ConfigureTouchscreenAdvanced::RestoreDefaults);
|
||||
|
||||
LoadConfiguration();
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
ConfigureTouchscreenAdvanced::~ConfigureTouchscreenAdvanced() = default;
|
||||
|
||||
void ConfigureTouchscreenAdvanced::changeEvent(QEvent* event) {
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
RetranslateUI();
|
||||
}
|
||||
|
||||
QDialog::changeEvent(event);
|
||||
}
|
||||
|
||||
void ConfigureTouchscreenAdvanced::RetranslateUI() {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
|
||||
void ConfigureTouchscreenAdvanced::ApplyConfiguration() {
|
||||
Settings::values.touchscreen.diameter_x = ui->diameter_x_box->value();
|
||||
Settings::values.touchscreen.diameter_y = ui->diameter_y_box->value();
|
||||
Settings::values.touchscreen.rotation_angle = ui->angle_box->value();
|
||||
}
|
||||
|
||||
void ConfigureTouchscreenAdvanced::LoadConfiguration() {
|
||||
ui->diameter_x_box->setValue(Settings::values.touchscreen.diameter_x);
|
||||
ui->diameter_y_box->setValue(Settings::values.touchscreen.diameter_y);
|
||||
ui->angle_box->setValue(Settings::values.touchscreen.rotation_angle);
|
||||
}
|
||||
|
||||
void ConfigureTouchscreenAdvanced::RestoreDefaults() {
|
||||
ui->diameter_x_box->setValue(15);
|
||||
ui->diameter_y_box->setValue(15);
|
||||
ui->angle_box->setValue(0);
|
||||
}
|
Reference in New Issue
Block a user