diff options
Diffstat (limited to 'src/citron/configuration')
-rw-r--r-- | src/citron/configuration/configure_touch_from_button.cpp | 14 | ||||
-rw-r--r-- | src/citron/configuration/configure_ui.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/citron/configuration/configure_touch_from_button.cpp b/src/citron/configuration/configure_touch_from_button.cpp index 605e96aa0..31816bdb2 100644 --- a/src/citron/configuration/configure_touch_from_button.cpp +++ b/src/citron/configuration/configure_touch_from_button.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 Citra Emulator Project & 2025 Citron Homebrew Project +// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025 // SPDX-License-Identifier: GPL-2.0-or-later #include <QInputDialog> @@ -505,7 +505,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) { if (!coord_label) { return; } - const auto pos = MapToDeviceCoords(event->x(), event->y()); + const auto pos = MapToDeviceCoords(event->position().x(), event->position().y()); if (pos) { coord_label->setText(QStringLiteral("X: %1, Y: %2").arg(pos->x()).arg(pos->y())); } else { @@ -523,7 +523,7 @@ void TouchScreenPreview::mousePressEvent(QMouseEvent* event) { if (event->button() != Qt::MouseButton::LeftButton) { return; } - const auto pos = MapToDeviceCoords(event->x(), event->y()); + const auto pos = MapToDeviceCoords(event->position().x(), event->position().y()); if (pos) { emit DotAdded(*pos); } @@ -539,7 +539,7 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) { emit DotSelected(obj->property(PropId).toInt()); drag_state.dot = qobject_cast<QLabel*>(obj); - drag_state.start_pos = mouse_event->globalPos(); + drag_state.start_pos = mouse_event->globalPosition().toPoint(); return true; } case QEvent::Type::MouseMove: { @@ -549,13 +549,13 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) { const auto mouse_event = static_cast<QMouseEvent*>(event); if (!drag_state.active) { drag_state.active = - (mouse_event->globalPos() - drag_state.start_pos).manhattanLength() >= + (mouse_event->globalPosition().toPoint() - drag_state.start_pos).manhattanLength() >= QApplication::startDragDistance(); if (!drag_state.active) { break; } } - auto current_pos = mapFromGlobal(mouse_event->globalPos()); + auto current_pos = mapFromGlobal(mouse_event->globalPosition().toPoint()); current_pos.setX(std::clamp(current_pos.x(), contentsMargins().left(), contentsMargins().left() + contentsRect().width() - 1)); current_pos.setY(std::clamp(current_pos.y(), contentsMargins().top(), @@ -614,4 +614,4 @@ void TouchScreenPreview::PositionDot(QLabel* const dot, const int device_x, contentsMargins().top() - static_cast<float>(dot->height()) / 2 + 0.5f); dot->move(x_coord, y_coord); -} +}
\ No newline at end of file diff --git a/src/citron/configuration/configure_ui.cpp b/src/citron/configuration/configure_ui.cpp index 60a21a4a1..207d21067 100644 --- a/src/citron/configuration/configure_ui.cpp +++ b/src/citron/configuration/configure_ui.cpp @@ -256,7 +256,7 @@ void ConfigureUi::InitializeLanguageComboBox() { locale.truncate(locale.lastIndexOf(QLatin1Char{'.'})); locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1); const QString lang = QLocale::languageToString(QLocale(locale).language()); - const QString country = QLocale::countryToString(QLocale(locale).country()); + const QString country = QLocale::territoryToString(QLocale(locale).territory()); ui->language_combobox->addItem(QStringLiteral("%1 (%2)").arg(lang, country), locale); } |