early-access version 1551
This commit is contained in:
@@ -18,6 +18,7 @@ add_executable(yuzu
|
||||
applets/profile_select.h
|
||||
applets/software_keyboard.cpp
|
||||
applets/software_keyboard.h
|
||||
applets/software_keyboard.ui
|
||||
applets/web_browser.cpp
|
||||
applets/web_browser.h
|
||||
bootmanager.cpp
|
||||
@@ -143,6 +144,9 @@ add_executable(yuzu
|
||||
uisettings.h
|
||||
util/limitable_input_dialog.cpp
|
||||
util/limitable_input_dialog.h
|
||||
util/overlay_dialog.cpp
|
||||
util/overlay_dialog.h
|
||||
util/overlay_dialog.ui
|
||||
util/sequence_dialog/sequence_dialog.cpp
|
||||
util/sequence_dialog/sequence_dialog.h
|
||||
util/url_request_interceptor.cpp
|
||||
|
||||
+12
-10
@@ -19,11 +19,11 @@ QtErrorDisplay::~QtErrorDisplay() = default;
|
||||
void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const {
|
||||
callback = std::move(finished);
|
||||
emit MainWindowDisplayError(
|
||||
tr("An error has occurred.\nPlease try again or contact the developer of the "
|
||||
"software.\n\nError Code: %1-%2 (0x%3)")
|
||||
tr("Error Code: %1-%2 (0x%3)")
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')));
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')),
|
||||
tr("An error has occurred.\nPlease try again or contact the developer of the software."));
|
||||
}
|
||||
|
||||
void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time,
|
||||
@@ -32,13 +32,14 @@ void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::secon
|
||||
|
||||
const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count());
|
||||
emit MainWindowDisplayError(
|
||||
tr("An error occurred on %1 at %2.\nPlease try again or contact the "
|
||||
"developer of the software.\n\nError Code: %3-%4 (0x%5)")
|
||||
.arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy")))
|
||||
.arg(date_time.toString(QStringLiteral("h:mm:ss A")))
|
||||
tr("Error Code: %1-%2 (0x%3)")
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')));
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')),
|
||||
tr("An error occurred on %1 at %2.\nPlease try again or contact the developer of the "
|
||||
"software.")
|
||||
.arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy")))
|
||||
.arg(date_time.toString(QStringLiteral("h:mm:ss A"))));
|
||||
}
|
||||
|
||||
void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text,
|
||||
@@ -46,10 +47,11 @@ void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_te
|
||||
std::function<void()> finished) const {
|
||||
callback = std::move(finished);
|
||||
emit MainWindowDisplayError(
|
||||
tr("An error has occurred.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5")
|
||||
tr("Error Code: %1-%2 (0x%3)")
|
||||
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0'))
|
||||
.arg(error.raw, 8, 16, QChar::fromLatin1('0')),
|
||||
tr("An error has occurred.\n\n%1\n\n%2")
|
||||
.arg(QString::fromStdString(dialog_text))
|
||||
.arg(QString::fromStdString(fullscreen_text)));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
std::function<void()> finished) const override;
|
||||
|
||||
signals:
|
||||
void MainWindowDisplayError(QString error) const;
|
||||
void MainWindowDisplayError(QString error_code, QString error_text) const;
|
||||
|
||||
private:
|
||||
void MainWindowFinishedError();
|
||||
|
||||
+1601
-113
File diff suppressed because it is too large
Load Diff
@@ -1,54 +1,228 @@
|
||||
// Copyright 2018 yuzu Emulator Project
|
||||
// Copyright 2021 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QValidator>
|
||||
|
||||
#include "core/frontend/applets/software_keyboard.h"
|
||||
|
||||
enum class HIDButton : u8;
|
||||
|
||||
class InputInterpreter;
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class QtSoftwareKeyboardDialog;
|
||||
}
|
||||
|
||||
class GMainWindow;
|
||||
class QDialogButtonBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QVBoxLayout;
|
||||
class QtSoftwareKeyboard;
|
||||
|
||||
class QtSoftwareKeyboardValidator final : public QValidator {
|
||||
public:
|
||||
explicit QtSoftwareKeyboardValidator(Core::Frontend::SoftwareKeyboardParameters parameters);
|
||||
State validate(QString& input, int& pos) const override;
|
||||
|
||||
private:
|
||||
Core::Frontend::SoftwareKeyboardParameters parameters;
|
||||
};
|
||||
|
||||
class QtSoftwareKeyboardDialog final : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtSoftwareKeyboardDialog(QWidget* parent,
|
||||
Core::Frontend::SoftwareKeyboardParameters parameters);
|
||||
QtSoftwareKeyboardDialog(QWidget* parent, Core::System& system_, bool is_inline_,
|
||||
Core::Frontend::KeyboardInitializeParameters initialize_parameters_);
|
||||
~QtSoftwareKeyboardDialog() override;
|
||||
|
||||
void accept() override;
|
||||
void ShowNormalKeyboard(QPoint pos, QSize size);
|
||||
|
||||
void ShowTextCheckDialog(Service::AM::Applets::SwkbdTextCheckResult text_check_result,
|
||||
std::u16string text_check_message);
|
||||
|
||||
void ShowInlineKeyboard(Core::Frontend::InlineAppearParameters appear_parameters, QPoint pos,
|
||||
QSize size);
|
||||
|
||||
void HideInlineKeyboard();
|
||||
|
||||
void InlineTextChanged(Core::Frontend::InlineTextParameters text_parameters);
|
||||
|
||||
void ExitKeyboard();
|
||||
|
||||
signals:
|
||||
void SubmitNormalText(Service::AM::Applets::SwkbdResult result,
|
||||
std::u16string submitted_text) const;
|
||||
|
||||
void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type,
|
||||
std::u16string submitted_text, s32 cursor_position) const;
|
||||
|
||||
public slots:
|
||||
void open() override;
|
||||
void reject() override;
|
||||
|
||||
std::u16string GetText() const;
|
||||
protected:
|
||||
/// We override the keyPressEvent for inputting text into the inline software keyboard.
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
private:
|
||||
std::u16string text;
|
||||
enum class Direction {
|
||||
Left,
|
||||
Up,
|
||||
Right,
|
||||
Down,
|
||||
};
|
||||
|
||||
QDialogButtonBox* buttons;
|
||||
QLabel* header_label;
|
||||
QLabel* sub_label;
|
||||
QLabel* guide_label;
|
||||
QLabel* length_label;
|
||||
QLineEdit* line_edit;
|
||||
QVBoxLayout* layout;
|
||||
enum class BottomOSKIndex {
|
||||
LowerCase,
|
||||
UpperCase,
|
||||
NumberPad,
|
||||
};
|
||||
|
||||
Core::Frontend::SoftwareKeyboardParameters parameters;
|
||||
/**
|
||||
* Moves and resizes the window to a specified position and size.
|
||||
*
|
||||
* @param pos Top-left window position
|
||||
* @param size Window size
|
||||
*/
|
||||
void MoveAndResizeWindow(QPoint pos, QSize size);
|
||||
|
||||
/**
|
||||
* Rescales all keyboard elements to account for High DPI displays.
|
||||
*
|
||||
* @param width Window width
|
||||
* @param height Window height
|
||||
* @param dpi_scale Display scaling factor
|
||||
*/
|
||||
void RescaleKeyboardElements(float width, float height, float dpi_scale);
|
||||
|
||||
/// Sets the keyboard type based on initialize_parameters.
|
||||
void SetKeyboardType();
|
||||
|
||||
/// Sets the password mode based on initialize_parameters.
|
||||
void SetPasswordMode();
|
||||
|
||||
/// Sets the text draw type based on initialize_parameters.
|
||||
void SetTextDrawType();
|
||||
|
||||
/// Sets the controller image at the bottom left of the software keyboard.
|
||||
void SetControllerImage();
|
||||
|
||||
/// Disables buttons based on initialize_parameters.
|
||||
void DisableKeyboardButtons();
|
||||
|
||||
/// Changes whether the backspace or/and ok buttons should be enabled or disabled.
|
||||
void SetBackspaceOkEnabled();
|
||||
|
||||
/**
|
||||
* Validates the input text sent in based on the parameters in initialize_parameters.
|
||||
*
|
||||
* @param input_text Input text
|
||||
*
|
||||
* @returns True if the input text is valid, false otherwise.
|
||||
*/
|
||||
bool ValidateInputText(const QString& input_text);
|
||||
|
||||
/// Switches between LowerCase and UpperCase (Shift and Caps Lock)
|
||||
void ChangeBottomOSKIndex();
|
||||
|
||||
/// Processes a keyboard button click from the UI as normal keyboard input.
|
||||
void NormalKeyboardButtonClicked(QPushButton* button);
|
||||
|
||||
/// Processes a keyboard button click from the UI as inline keyboard input.
|
||||
void InlineKeyboardButtonClicked(QPushButton* button);
|
||||
|
||||
/**
|
||||
* Inserts a string of arbitrary length into the current_text at the current cursor position.
|
||||
* This is only used for the inline software keyboard.
|
||||
*/
|
||||
void InlineTextInsertString(std::u16string_view string);
|
||||
|
||||
/// Setup the mouse hover workaround for "focusing" buttons. This should only be called once.
|
||||
void SetupMouseHover();
|
||||
|
||||
/**
|
||||
* Handles button presses and converts them into keyboard input.
|
||||
*
|
||||
* @tparam HIDButton The list of buttons that can be converted into keyboard input.
|
||||
*/
|
||||
template <HIDButton... T>
|
||||
void HandleButtonPressedOnce();
|
||||
|
||||
/**
|
||||
* Handles button holds and converts them into keyboard input.
|
||||
*
|
||||
* @tparam HIDButton The list of buttons that can be converted into keyboard input.
|
||||
*/
|
||||
template <HIDButton... T>
|
||||
void HandleButtonHold();
|
||||
|
||||
/**
|
||||
* Translates a button press to focus or click a keyboard button.
|
||||
*
|
||||
* @param button The button press to process.
|
||||
*/
|
||||
void TranslateButtonPress(HIDButton button);
|
||||
|
||||
/**
|
||||
* Moves the focus of a button in a certain direction.
|
||||
*
|
||||
* @param direction The direction to move.
|
||||
*/
|
||||
void MoveButtonDirection(Direction direction);
|
||||
|
||||
/**
|
||||
* Moves the text cursor in a certain direction.
|
||||
*
|
||||
* @param direction The direction to move.
|
||||
*/
|
||||
void MoveTextCursorDirection(Direction direction);
|
||||
|
||||
void StartInputThread();
|
||||
void StopInputThread();
|
||||
|
||||
/// The thread where input is being polled and processed.
|
||||
void InputThread();
|
||||
|
||||
std::unique_ptr<Ui::QtSoftwareKeyboardDialog> ui;
|
||||
|
||||
Core::System& system;
|
||||
|
||||
// True if it is the inline software keyboard.
|
||||
bool is_inline;
|
||||
|
||||
// Common software keyboard initialize parameters.
|
||||
Core::Frontend::KeyboardInitializeParameters initialize_parameters;
|
||||
|
||||
// Used only by the inline software keyboard since the QLineEdit or QTextEdit is hidden.
|
||||
std::u16string current_text;
|
||||
s32 cursor_position{0};
|
||||
|
||||
static constexpr std::size_t NUM_ROWS_NORMAL = 5;
|
||||
static constexpr std::size_t NUM_COLUMNS_NORMAL = 12;
|
||||
static constexpr std::size_t NUM_ROWS_NUMPAD = 4;
|
||||
static constexpr std::size_t NUM_COLUMNS_NUMPAD = 4;
|
||||
|
||||
// Stores the normal keyboard layout.
|
||||
std::array<std::array<std::array<QPushButton*, NUM_COLUMNS_NORMAL>, NUM_ROWS_NORMAL>, 2>
|
||||
keyboard_buttons;
|
||||
// Stores the numberpad keyboard layout.
|
||||
std::array<std::array<QPushButton*, NUM_COLUMNS_NUMPAD>, NUM_ROWS_NUMPAD> numberpad_buttons;
|
||||
|
||||
// Contains a set of all buttons used in keyboard_buttons and numberpad_buttons.
|
||||
std::array<QPushButton*, 110> all_buttons;
|
||||
|
||||
std::size_t row{0};
|
||||
std::size_t column{0};
|
||||
|
||||
BottomOSKIndex bottom_osk_index{BottomOSKIndex::LowerCase};
|
||||
std::atomic<bool> caps_lock_enabled{false};
|
||||
|
||||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
|
||||
std::thread input_thread;
|
||||
|
||||
std::atomic<bool> input_thread_running{};
|
||||
};
|
||||
|
||||
class QtSoftwareKeyboard final : public QObject, public Core::Frontend::SoftwareKeyboardApplet {
|
||||
@@ -58,19 +232,54 @@ public:
|
||||
explicit QtSoftwareKeyboard(GMainWindow& parent);
|
||||
~QtSoftwareKeyboard() override;
|
||||
|
||||
void RequestText(std::function<void(std::optional<std::u16string>)> out,
|
||||
Core::Frontend::SoftwareKeyboardParameters parameters) const override;
|
||||
void SendTextCheckDialog(std::u16string error_message,
|
||||
std::function<void()> finished_check_) const override;
|
||||
void InitializeKeyboard(
|
||||
bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters,
|
||||
std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)>
|
||||
submit_normal_callback_,
|
||||
std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
|
||||
submit_inline_callback_) override;
|
||||
|
||||
void ShowNormalKeyboard() const override;
|
||||
|
||||
void ShowTextCheckDialog(Service::AM::Applets::SwkbdTextCheckResult text_check_result,
|
||||
std::u16string text_check_message) const override;
|
||||
|
||||
void ShowInlineKeyboard(
|
||||
Core::Frontend::InlineAppearParameters appear_parameters) const override;
|
||||
|
||||
void HideInlineKeyboard() const override;
|
||||
|
||||
void InlineTextChanged(Core::Frontend::InlineTextParameters text_parameters) const override;
|
||||
|
||||
void ExitKeyboard() const override;
|
||||
|
||||
signals:
|
||||
void MainWindowGetText(Core::Frontend::SoftwareKeyboardParameters parameters) const;
|
||||
void MainWindowTextCheckDialog(std::u16string error_message) const;
|
||||
void MainWindowInitializeKeyboard(
|
||||
bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters) const;
|
||||
|
||||
void MainWindowShowNormalKeyboard() const;
|
||||
|
||||
void MainWindowShowTextCheckDialog(Service::AM::Applets::SwkbdTextCheckResult text_check_result,
|
||||
std::u16string text_check_message) const;
|
||||
|
||||
void MainWindowShowInlineKeyboard(
|
||||
Core::Frontend::InlineAppearParameters appear_parameters) const;
|
||||
|
||||
void MainWindowHideInlineKeyboard() const;
|
||||
|
||||
void MainWindowInlineTextChanged(Core::Frontend::InlineTextParameters text_parameters) const;
|
||||
|
||||
void MainWindowExitKeyboard() const;
|
||||
|
||||
private:
|
||||
void MainWindowFinishedText(std::optional<std::u16string> text);
|
||||
void MainWindowFinishedCheckDialog();
|
||||
void SubmitNormalText(Service::AM::Applets::SwkbdResult result,
|
||||
std::u16string submitted_text) const;
|
||||
|
||||
mutable std::function<void(std::optional<std::u16string>)> text_output;
|
||||
mutable std::function<void()> finished_check;
|
||||
void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type,
|
||||
std::u16string submitted_text, s32 cursor_position) const;
|
||||
|
||||
mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)>
|
||||
submit_normal_callback;
|
||||
mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
|
||||
submit_inline_callback;
|
||||
};
|
||||
|
||||
Executable
+3503
File diff suppressed because it is too large
Load Diff
@@ -771,6 +771,7 @@ void Config::ReadRendererValues() {
|
||||
ReadSettingGlobal(Settings::values.renderer_backend, QStringLiteral("backend"), 0);
|
||||
ReadSettingGlobal(Settings::values.renderer_debug, QStringLiteral("debug"), false);
|
||||
ReadSettingGlobal(Settings::values.vulkan_device, QStringLiteral("vulkan_device"), 0);
|
||||
ReadSettingGlobal(Settings::values.fullscreen_mode, QStringLiteral("fullscreen_mode"), 0);
|
||||
ReadSettingGlobal(Settings::values.aspect_ratio, QStringLiteral("aspect_ratio"), 0);
|
||||
ReadSettingGlobal(Settings::values.max_anisotropy, QStringLiteral("max_anisotropy"), 0);
|
||||
ReadSettingGlobal(Settings::values.use_frame_limit, QStringLiteral("use_frame_limit"), true);
|
||||
@@ -1334,6 +1335,7 @@ void Config::SaveRendererValues() {
|
||||
Settings::values.renderer_backend.UsingGlobal(), 0);
|
||||
WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false);
|
||||
WriteSettingGlobal(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0);
|
||||
WriteSettingGlobal(QStringLiteral("fullscreen_mode"), Settings::values.fullscreen_mode, 0);
|
||||
WriteSettingGlobal(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0);
|
||||
WriteSettingGlobal(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0);
|
||||
WriteSettingGlobal(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true);
|
||||
|
||||
@@ -77,18 +77,25 @@ void ConfigureGraphics::SetConfiguration() {
|
||||
|
||||
if (Settings::IsConfiguringGlobal()) {
|
||||
ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue()));
|
||||
ui->fullscreen_mode_combobox->setCurrentIndex(Settings::values.fullscreen_mode.GetValue());
|
||||
ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue());
|
||||
} else {
|
||||
ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend);
|
||||
ConfigurationShared::SetHighlight(ui->api_layout,
|
||||
!Settings::values.renderer_backend.UsingGlobal());
|
||||
|
||||
ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox,
|
||||
&Settings::values.fullscreen_mode);
|
||||
ConfigurationShared::SetHighlight(ui->fullscreen_mode_label,
|
||||
!Settings::values.fullscreen_mode.UsingGlobal());
|
||||
|
||||
ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox,
|
||||
&Settings::values.aspect_ratio);
|
||||
ConfigurationShared::SetHighlight(ui->ar_label,
|
||||
!Settings::values.aspect_ratio.UsingGlobal());
|
||||
|
||||
ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1);
|
||||
ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
|
||||
ConfigurationShared::SetHighlight(ui->ar_label,
|
||||
!Settings::values.aspect_ratio.UsingGlobal());
|
||||
ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
|
||||
}
|
||||
|
||||
@@ -107,6 +114,9 @@ void ConfigureGraphics::ApplyConfiguration() {
|
||||
if (Settings::values.vulkan_device.UsingGlobal()) {
|
||||
Settings::values.vulkan_device.SetValue(vulkan_device);
|
||||
}
|
||||
if (Settings::values.fullscreen_mode.UsingGlobal()) {
|
||||
Settings::values.fullscreen_mode.SetValue(ui->fullscreen_mode_combobox->currentIndex());
|
||||
}
|
||||
if (Settings::values.aspect_ratio.UsingGlobal()) {
|
||||
Settings::values.aspect_ratio.SetValue(ui->aspect_ratio_combobox->currentIndex());
|
||||
}
|
||||
@@ -140,6 +150,8 @@ void ConfigureGraphics::ApplyConfiguration() {
|
||||
}
|
||||
}
|
||||
|
||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode,
|
||||
ui->fullscreen_mode_combobox);
|
||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio,
|
||||
ui->aspect_ratio_combobox);
|
||||
|
||||
@@ -253,6 +265,7 @@ void ConfigureGraphics::SetupPerGameUI() {
|
||||
if (Settings::IsConfiguringGlobal()) {
|
||||
ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal());
|
||||
ui->device->setEnabled(Settings::values.renderer_backend.UsingGlobal());
|
||||
ui->fullscreen_mode_combobox->setEnabled(Settings::values.fullscreen_mode.UsingGlobal());
|
||||
ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal());
|
||||
ui->use_asynchronous_gpu_emulation->setEnabled(
|
||||
Settings::values.use_asynchronous_gpu_emulation.UsingGlobal());
|
||||
@@ -278,6 +291,8 @@ void ConfigureGraphics::SetupPerGameUI() {
|
||||
|
||||
ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label,
|
||||
Settings::values.aspect_ratio.GetValue(true));
|
||||
ConfigurationShared::SetColoredComboBox(ui->fullscreen_mode_combobox, ui->fullscreen_mode_label,
|
||||
Settings::values.fullscreen_mode.GetValue(true));
|
||||
ConfigurationShared::InsertGlobalItem(
|
||||
ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true)));
|
||||
}
|
||||
|
||||
@@ -104,9 +104,48 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="fullscreen_mode_layout" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="fullscreen_mode_label">
|
||||
<property name="text">
|
||||
<string>Fullscreen Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fullscreen_mode_combobox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Borderless Windowed (Default)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Exclusive Fullscreen</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="aspect_ratio_layout" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
|
||||
+210
-31
@@ -101,6 +101,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||
#include "core/settings.h"
|
||||
#include "core/telemetry_session.h"
|
||||
#include "input_common/main.h"
|
||||
#include "util/overlay_dialog.h"
|
||||
#include "video_core/gpu.h"
|
||||
#include "video_core/shader_notify.h"
|
||||
#include "yuzu/about_dialog.h"
|
||||
@@ -225,6 +226,8 @@ GMainWindow::GMainWindow()
|
||||
SetDiscordEnabled(UISettings::values.enable_discord_presence);
|
||||
discord_rpc->Update();
|
||||
|
||||
RegisterMetaTypes();
|
||||
|
||||
InitializeWidgets();
|
||||
InitializeDebugWidgets();
|
||||
InitializeRecentFileMenuActions();
|
||||
@@ -373,6 +376,55 @@ GMainWindow::~GMainWindow() {
|
||||
delete render_window;
|
||||
}
|
||||
|
||||
void GMainWindow::RegisterMetaTypes() {
|
||||
// Register integral and floating point types
|
||||
qRegisterMetaType<u8>("u8");
|
||||
qRegisterMetaType<u16>("u16");
|
||||
qRegisterMetaType<u32>("u32");
|
||||
qRegisterMetaType<u64>("u64");
|
||||
qRegisterMetaType<u128>("u128");
|
||||
qRegisterMetaType<s8>("s8");
|
||||
qRegisterMetaType<s16>("s16");
|
||||
qRegisterMetaType<s32>("s32");
|
||||
qRegisterMetaType<s64>("s64");
|
||||
qRegisterMetaType<f32>("f32");
|
||||
qRegisterMetaType<f64>("f64");
|
||||
|
||||
// Register string types
|
||||
qRegisterMetaType<std::string>("std::string");
|
||||
qRegisterMetaType<std::wstring>("std::wstring");
|
||||
qRegisterMetaType<std::u8string>("std::u8string");
|
||||
qRegisterMetaType<std::u16string>("std::u16string");
|
||||
qRegisterMetaType<std::u32string>("std::u32string");
|
||||
qRegisterMetaType<std::string_view>("std::string_view");
|
||||
qRegisterMetaType<std::wstring_view>("std::wstring_view");
|
||||
qRegisterMetaType<std::u8string_view>("std::u8string_view");
|
||||
qRegisterMetaType<std::u16string_view>("std::u16string_view");
|
||||
qRegisterMetaType<std::u32string_view>("std::u32string_view");
|
||||
|
||||
// Register applet types
|
||||
|
||||
// Controller Applet
|
||||
qRegisterMetaType<Core::Frontend::ControllerParameters>("Core::Frontend::ControllerParameters");
|
||||
|
||||
// Software Keyboard Applet
|
||||
qRegisterMetaType<Core::Frontend::KeyboardInitializeParameters>(
|
||||
"Core::Frontend::KeyboardInitializeParameters");
|
||||
qRegisterMetaType<Core::Frontend::InlineAppearParameters>(
|
||||
"Core::Frontend::InlineAppearParameters");
|
||||
qRegisterMetaType<Core::Frontend::InlineTextParameters>("Core::Frontend::InlineTextParameters");
|
||||
qRegisterMetaType<Service::AM::Applets::SwkbdResult>("Service::AM::Applets::SwkbdResult");
|
||||
qRegisterMetaType<Service::AM::Applets::SwkbdTextCheckResult>(
|
||||
"Service::AM::Applets::SwkbdTextCheckResult");
|
||||
qRegisterMetaType<Service::AM::Applets::SwkbdReplyType>("Service::AM::Applets::SwkbdReplyType");
|
||||
|
||||
// Web Browser Applet
|
||||
qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason");
|
||||
|
||||
// Register loader types
|
||||
qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
|
||||
}
|
||||
|
||||
void GMainWindow::ControllerSelectorReconfigureControllers(
|
||||
const Core::Frontend::ControllerParameters& parameters) {
|
||||
QtControllerSelectorDialog dialog(this, parameters, input_subsystem.get());
|
||||
@@ -412,25 +464,112 @@ void GMainWindow::ProfileSelectorSelectProfile() {
|
||||
emit ProfileSelectorFinishedSelection(uuid);
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardGetText(
|
||||
const Core::Frontend::SoftwareKeyboardParameters& parameters) {
|
||||
QtSoftwareKeyboardDialog dialog(this, parameters);
|
||||
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint |
|
||||
Qt::WindowTitleHint | Qt::WindowSystemMenuHint |
|
||||
Qt::WindowCloseButtonHint);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
|
||||
if (dialog.exec() == QDialog::Rejected) {
|
||||
emit SoftwareKeyboardFinishedText(std::nullopt);
|
||||
void GMainWindow::SoftwareKeyboardInitialize(
|
||||
bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters) {
|
||||
if (software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is already initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
emit SoftwareKeyboardFinishedText(dialog.GetText());
|
||||
software_keyboard = new QtSoftwareKeyboardDialog(render_window, Core::System::GetInstance(),
|
||||
is_inline, std::move(initialize_parameters));
|
||||
|
||||
if (is_inline) {
|
||||
connect(
|
||||
software_keyboard, &QtSoftwareKeyboardDialog::SubmitInlineText, this,
|
||||
[this](Service::AM::Applets::SwkbdReplyType reply_type, std::u16string submitted_text,
|
||||
s32 cursor_position) {
|
||||
emit SoftwareKeyboardSubmitInlineText(reply_type, submitted_text, cursor_position);
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
} else {
|
||||
connect(
|
||||
software_keyboard, &QtSoftwareKeyboardDialog::SubmitNormalText, this,
|
||||
[this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text) {
|
||||
emit SoftwareKeyboardSubmitNormalText(result, submitted_text);
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardInvokeCheckDialog(std::u16string error_message) {
|
||||
QMessageBox::warning(this, tr("Text Check Failed"), QString::fromStdU16String(error_message));
|
||||
emit SoftwareKeyboardFinishedCheckDialog();
|
||||
void GMainWindow::SoftwareKeyboardShowNormal() {
|
||||
if (!software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is not initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& layout = render_window->GetFramebufferLayout();
|
||||
|
||||
const auto x = layout.screen.left;
|
||||
const auto y = layout.screen.top;
|
||||
const auto w = layout.screen.GetWidth();
|
||||
const auto h = layout.screen.GetHeight();
|
||||
|
||||
software_keyboard->ShowNormalKeyboard(render_window->mapToGlobal(QPoint(x, y)), QSize(w, h));
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardShowTextCheck(
|
||||
Service::AM::Applets::SwkbdTextCheckResult text_check_result,
|
||||
std::u16string text_check_message) {
|
||||
if (!software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is not initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
software_keyboard->ShowTextCheckDialog(text_check_result, text_check_message);
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardShowInline(
|
||||
Core::Frontend::InlineAppearParameters appear_parameters) {
|
||||
if (!software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is not initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& layout = render_window->GetFramebufferLayout();
|
||||
|
||||
const auto x =
|
||||
static_cast<int>(layout.screen.left + (0.5f * layout.screen.GetWidth() *
|
||||
((2.0f * appear_parameters.key_top_translate_x) +
|
||||
(1.0f - appear_parameters.key_top_scale_x))));
|
||||
const auto y =
|
||||
static_cast<int>(layout.screen.top + (layout.screen.GetHeight() *
|
||||
((2.0f * appear_parameters.key_top_translate_y) +
|
||||
(1.0f - appear_parameters.key_top_scale_y))));
|
||||
const auto w = static_cast<int>(layout.screen.GetWidth() * appear_parameters.key_top_scale_x);
|
||||
const auto h = static_cast<int>(layout.screen.GetHeight() * appear_parameters.key_top_scale_y);
|
||||
|
||||
software_keyboard->ShowInlineKeyboard(std::move(appear_parameters),
|
||||
render_window->mapToGlobal(QPoint(x, y)), QSize(w, h));
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardHideInline() {
|
||||
if (!software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is not initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
software_keyboard->HideInlineKeyboard();
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardInlineTextChanged(
|
||||
Core::Frontend::InlineTextParameters text_parameters) {
|
||||
if (!software_keyboard) {
|
||||
LOG_ERROR(Frontend, "The software keyboard is not initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
software_keyboard->InlineTextChanged(std::move(text_parameters));
|
||||
}
|
||||
|
||||
void GMainWindow::SoftwareKeyboardExit() {
|
||||
if (!software_keyboard) {
|
||||
return;
|
||||
}
|
||||
|
||||
software_keyboard->ExitKeyboard();
|
||||
|
||||
software_keyboard = nullptr;
|
||||
}
|
||||
|
||||
void GMainWindow::WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args,
|
||||
@@ -976,6 +1115,10 @@ void GMainWindow::ConnectWidgetEvents() {
|
||||
connect(this, &GMainWindow::EmulationStopping, render_window,
|
||||
&GRenderWindow::OnEmulationStopping);
|
||||
|
||||
// Software Keyboard Applet
|
||||
connect(this, &GMainWindow::EmulationStarting, this, &GMainWindow::SoftwareKeyboardExit);
|
||||
connect(this, &GMainWindow::EmulationStopping, this, &GMainWindow::SoftwareKeyboardExit);
|
||||
|
||||
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
|
||||
}
|
||||
|
||||
@@ -2185,15 +2328,6 @@ void GMainWindow::OnStartGame() {
|
||||
|
||||
emu_thread->SetRunning(true);
|
||||
|
||||
qRegisterMetaType<Core::Frontend::ControllerParameters>("Core::Frontend::ControllerParameters");
|
||||
qRegisterMetaType<Core::Frontend::SoftwareKeyboardParameters>(
|
||||
"Core::Frontend::SoftwareKeyboardParameters");
|
||||
qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
|
||||
qRegisterMetaType<std::string>("std::string");
|
||||
qRegisterMetaType<std::optional<std::u16string>>("std::optional<std::u16string>");
|
||||
qRegisterMetaType<std::string_view>("std::string_view");
|
||||
qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason");
|
||||
|
||||
connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError);
|
||||
|
||||
ui.action_Start->setEnabled(false);
|
||||
@@ -2242,8 +2376,11 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
|
||||
BootGame(last_filename_booted, program_index);
|
||||
}
|
||||
|
||||
void GMainWindow::ErrorDisplayDisplayError(QString body) {
|
||||
QMessageBox::critical(this, tr("Error Display"), body);
|
||||
void GMainWindow::ErrorDisplayDisplayError(QString error_code, QString error_text) {
|
||||
OverlayDialog dialog(render_window, Core::System::GetInstance(), error_code, error_text,
|
||||
QString{}, tr("OK"), Qt::AlignLeft | Qt::AlignVCenter);
|
||||
dialog.exec();
|
||||
|
||||
emit ErrorDisplayFinished();
|
||||
}
|
||||
|
||||
@@ -2295,24 +2432,66 @@ void GMainWindow::ToggleFullscreen() {
|
||||
void GMainWindow::ShowFullscreen() {
|
||||
if (ui.action_Single_Window_Mode->isChecked()) {
|
||||
UISettings::values.geometry = saveGeometry();
|
||||
|
||||
ui.menubar->hide();
|
||||
statusBar()->hide();
|
||||
showFullScreen();
|
||||
|
||||
if (Settings::values.fullscreen_mode.GetValue() == 1) {
|
||||
showFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
hide();
|
||||
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
||||
const auto screen_geometry = QApplication::desktop()->screenGeometry(this);
|
||||
setGeometry(screen_geometry.x(), screen_geometry.y(), screen_geometry.width(),
|
||||
screen_geometry.height() + 1);
|
||||
raise();
|
||||
showNormal();
|
||||
} else {
|
||||
UISettings::values.renderwindow_geometry = render_window->saveGeometry();
|
||||
render_window->showFullScreen();
|
||||
|
||||
if (Settings::values.fullscreen_mode.GetValue() == 1) {
|
||||
render_window->showFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
render_window->hide();
|
||||
render_window->setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
||||
const auto screen_geometry = QApplication::desktop()->screenGeometry(this);
|
||||
render_window->setGeometry(screen_geometry.x(), screen_geometry.y(),
|
||||
screen_geometry.width(), screen_geometry.height() + 1);
|
||||
render_window->raise();
|
||||
render_window->showNormal();
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::HideFullscreen() {
|
||||
if (ui.action_Single_Window_Mode->isChecked()) {
|
||||
if (Settings::values.fullscreen_mode.GetValue() == 1) {
|
||||
showNormal();
|
||||
restoreGeometry(UISettings::values.geometry);
|
||||
} else {
|
||||
hide();
|
||||
setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint);
|
||||
restoreGeometry(UISettings::values.geometry);
|
||||
raise();
|
||||
show();
|
||||
}
|
||||
|
||||
statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked());
|
||||
ui.menubar->show();
|
||||
showNormal();
|
||||
restoreGeometry(UISettings::values.geometry);
|
||||
} else {
|
||||
render_window->showNormal();
|
||||
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
|
||||
if (Settings::values.fullscreen_mode.GetValue() == 1) {
|
||||
render_window->showNormal();
|
||||
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
|
||||
} else {
|
||||
render_window->hide();
|
||||
render_window->setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint);
|
||||
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
|
||||
render_window->raise();
|
||||
render_window->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-7
@@ -37,9 +37,13 @@ enum class GameListRemoveTarget;
|
||||
enum class InstalledEntryType;
|
||||
class GameListPlaceholder;
|
||||
|
||||
class QtSoftwareKeyboardDialog;
|
||||
|
||||
namespace Core::Frontend {
|
||||
struct ControllerParameters;
|
||||
struct SoftwareKeyboardParameters;
|
||||
struct InlineAppearParameters;
|
||||
struct InlineTextParameters;
|
||||
struct KeyboardInitializeParameters;
|
||||
} // namespace Core::Frontend
|
||||
|
||||
namespace DiscordRPC {
|
||||
@@ -57,8 +61,11 @@ class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace Service::AM::Applets {
|
||||
enum class SwkbdResult : u32;
|
||||
enum class SwkbdTextCheckResult : u32;
|
||||
enum class SwkbdReplyType : u32;
|
||||
enum class WebExitReason : u32;
|
||||
}
|
||||
} // namespace Service::AM::Applets
|
||||
|
||||
enum class EmulatedDirectoryTarget {
|
||||
NAND,
|
||||
@@ -128,8 +135,10 @@ signals:
|
||||
|
||||
void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid);
|
||||
|
||||
void SoftwareKeyboardFinishedText(std::optional<std::u16string> text);
|
||||
void SoftwareKeyboardFinishedCheckDialog();
|
||||
void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result,
|
||||
std::u16string submitted_text);
|
||||
void SoftwareKeyboardSubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type,
|
||||
std::u16string submitted_text, s32 cursor_position);
|
||||
|
||||
void WebBrowserExtractOfflineRomFS();
|
||||
void WebBrowserClosed(Service::AM::Applets::WebExitReason exit_reason, std::string last_url);
|
||||
@@ -139,15 +148,24 @@ public slots:
|
||||
void OnExecuteProgram(std::size_t program_index);
|
||||
void ControllerSelectorReconfigureControllers(
|
||||
const Core::Frontend::ControllerParameters& parameters);
|
||||
void ErrorDisplayDisplayError(QString body);
|
||||
void SoftwareKeyboardInitialize(
|
||||
bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters);
|
||||
void SoftwareKeyboardShowNormal();
|
||||
void SoftwareKeyboardShowTextCheck(Service::AM::Applets::SwkbdTextCheckResult text_check_result,
|
||||
std::u16string text_check_message);
|
||||
void SoftwareKeyboardShowInline(Core::Frontend::InlineAppearParameters appear_parameters);
|
||||
void SoftwareKeyboardHideInline();
|
||||
void SoftwareKeyboardInlineTextChanged(Core::Frontend::InlineTextParameters text_parameters);
|
||||
void SoftwareKeyboardExit();
|
||||
void ErrorDisplayDisplayError(QString error_code, QString error_text);
|
||||
void ProfileSelectorSelectProfile();
|
||||
void SoftwareKeyboardGetText(const Core::Frontend::SoftwareKeyboardParameters& parameters);
|
||||
void SoftwareKeyboardInvokeCheckDialog(std::u16string error_message);
|
||||
void WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args,
|
||||
bool is_local);
|
||||
void OnAppFocusStateChanged(Qt::ApplicationState state);
|
||||
|
||||
private:
|
||||
void RegisterMetaTypes();
|
||||
|
||||
void InitializeWidgets();
|
||||
void InitializeDebugWidgets();
|
||||
void InitializeRecentFileMenuActions();
|
||||
@@ -334,6 +352,9 @@ private:
|
||||
// Disables the web applet for the rest of the emulated session
|
||||
bool disable_web_applet{};
|
||||
|
||||
// Applets
|
||||
QtSoftwareKeyboardDialog* software_keyboard = nullptr;
|
||||
|
||||
protected:
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||
|
||||
Executable
+249
@@ -0,0 +1,249 @@
|
||||
// Copyright 2021 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QScreen>
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/input_interpreter.h"
|
||||
#include "ui_overlay_dialog.h"
|
||||
#include "yuzu/util/overlay_dialog.h"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr float BASE_TITLE_FONT_SIZE = 14.0f;
|
||||
constexpr float BASE_FONT_SIZE = 18.0f;
|
||||
constexpr float BASE_WIDTH = 1280.0f;
|
||||
constexpr float BASE_HEIGHT = 720.0f;
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
OverlayDialog::OverlayDialog(QWidget* parent, Core::System& system, const QString& title_text,
|
||||
const QString& body_text, const QString& left_button_text,
|
||||
const QString& right_button_text, Qt::Alignment alignment,
|
||||
bool use_rich_text_)
|
||||
: QDialog(parent), ui{std::make_unique<Ui::OverlayDialog>()}, use_rich_text{use_rich_text_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint |
|
||||
Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint);
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
if (use_rich_text) {
|
||||
InitializeRichTextDialog(title_text, body_text, left_button_text, right_button_text,
|
||||
alignment);
|
||||
} else {
|
||||
InitializeRegularTextDialog(title_text, body_text, left_button_text, right_button_text,
|
||||
alignment);
|
||||
}
|
||||
|
||||
MoveAndResizeWindow();
|
||||
|
||||
// TODO (Morph): Remove this when InputInterpreter no longer relies on the HID backend
|
||||
if (system.IsPoweredOn()) {
|
||||
input_interpreter = std::make_unique<InputInterpreter>(system);
|
||||
|
||||
StartInputThread();
|
||||
}
|
||||
}
|
||||
|
||||
OverlayDialog::~OverlayDialog() {
|
||||
StopInputThread();
|
||||
}
|
||||
|
||||
void OverlayDialog::InitializeRegularTextDialog(const QString& title_text, const QString& body_text,
|
||||
const QString& left_button_text,
|
||||
const QString& right_button_text,
|
||||
Qt::Alignment alignment) {
|
||||
ui->stackedDialog->setCurrentIndex(0);
|
||||
|
||||
ui->label_title->setText(title_text);
|
||||
ui->label_dialog->setText(body_text);
|
||||
ui->button_cancel->setText(left_button_text);
|
||||
ui->button_ok->setText(right_button_text);
|
||||
|
||||
ui->label_dialog->setAlignment(alignment);
|
||||
|
||||
if (title_text.isEmpty()) {
|
||||
ui->label_title->hide();
|
||||
ui->verticalLayout_2->setStretch(0, 0);
|
||||
ui->verticalLayout_2->setStretch(1, 219);
|
||||
ui->verticalLayout_2->setStretch(2, 82);
|
||||
}
|
||||
|
||||
if (left_button_text.isEmpty()) {
|
||||
ui->button_cancel->hide();
|
||||
ui->button_cancel->setEnabled(false);
|
||||
}
|
||||
|
||||
if (right_button_text.isEmpty()) {
|
||||
ui->button_ok->hide();
|
||||
ui->button_ok->setEnabled(false);
|
||||
}
|
||||
|
||||
connect(
|
||||
ui->button_cancel, &QPushButton::clicked, this,
|
||||
[this](bool) {
|
||||
StopInputThread();
|
||||
QDialog::reject();
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
ui->button_ok, &QPushButton::clicked, this,
|
||||
[this](bool) {
|
||||
StopInputThread();
|
||||
QDialog::accept();
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void OverlayDialog::InitializeRichTextDialog(const QString& title_text, const QString& body_text,
|
||||
const QString& left_button_text,
|
||||
const QString& right_button_text,
|
||||
Qt::Alignment alignment) {
|
||||
ui->stackedDialog->setCurrentIndex(1);
|
||||
|
||||
ui->label_title_rich->setText(title_text);
|
||||
ui->text_browser_dialog->setText(body_text);
|
||||
ui->button_cancel_rich->setText(left_button_text);
|
||||
ui->button_ok_rich->setText(right_button_text);
|
||||
|
||||
// TODO (Morph/Rei): Replace this with something that works better
|
||||
ui->text_browser_dialog->setAlignment(alignment);
|
||||
|
||||
if (title_text.isEmpty()) {
|
||||
ui->label_title_rich->hide();
|
||||
ui->verticalLayout_3->setStretch(0, 0);
|
||||
ui->verticalLayout_3->setStretch(1, 438);
|
||||
ui->verticalLayout_3->setStretch(2, 82);
|
||||
}
|
||||
|
||||
if (left_button_text.isEmpty()) {
|
||||
ui->button_cancel_rich->hide();
|
||||
ui->button_cancel_rich->setEnabled(false);
|
||||
}
|
||||
|
||||
if (right_button_text.isEmpty()) {
|
||||
ui->button_ok_rich->hide();
|
||||
ui->button_ok_rich->setEnabled(false);
|
||||
}
|
||||
|
||||
connect(
|
||||
ui->button_cancel_rich, &QPushButton::clicked, this,
|
||||
[this](bool) {
|
||||
StopInputThread();
|
||||
QDialog::reject();
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
ui->button_ok_rich, &QPushButton::clicked, this,
|
||||
[this](bool) {
|
||||
StopInputThread();
|
||||
QDialog::accept();
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void OverlayDialog::MoveAndResizeWindow() {
|
||||
const auto pos = parentWidget()->mapToGlobal(parentWidget()->rect().topLeft());
|
||||
const auto width = static_cast<float>(parentWidget()->width());
|
||||
const auto height = static_cast<float>(parentWidget()->height());
|
||||
|
||||
// High DPI
|
||||
const float dpi_scale = qApp->screenAt(pos)->logicalDotsPerInch() / 96.0f;
|
||||
|
||||
const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale;
|
||||
const auto body_text_font_size =
|
||||
BASE_FONT_SIZE * (((width / BASE_WIDTH) + (height / BASE_HEIGHT)) / 2.0f) / dpi_scale;
|
||||
const auto button_text_font_size = BASE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale;
|
||||
|
||||
QFont title_text_font(QStringLiteral("MS Shell Dlg 2"), title_text_font_size, QFont::Normal);
|
||||
QFont body_text_font(QStringLiteral("MS Shell Dlg 2"), body_text_font_size, QFont::Normal);
|
||||
QFont button_text_font(QStringLiteral("MS Shell Dlg 2"), button_text_font_size, QFont::Normal);
|
||||
|
||||
if (use_rich_text) {
|
||||
ui->label_title_rich->setFont(title_text_font);
|
||||
ui->text_browser_dialog->setFont(body_text_font);
|
||||
ui->button_cancel_rich->setFont(button_text_font);
|
||||
ui->button_ok_rich->setFont(button_text_font);
|
||||
} else {
|
||||
ui->label_title->setFont(title_text_font);
|
||||
ui->label_dialog->setFont(body_text_font);
|
||||
ui->button_cancel->setFont(button_text_font);
|
||||
ui->button_ok->setFont(button_text_font);
|
||||
}
|
||||
|
||||
QDialog::move(pos);
|
||||
QDialog::resize(width, height);
|
||||
}
|
||||
|
||||
template <HIDButton... T>
|
||||
void OverlayDialog::HandleButtonPressedOnce() {
|
||||
const auto f = [this](HIDButton button) {
|
||||
if (input_interpreter->IsButtonPressedOnce(button)) {
|
||||
TranslateButtonPress(button);
|
||||
}
|
||||
};
|
||||
|
||||
(f(T), ...);
|
||||
}
|
||||
|
||||
void OverlayDialog::TranslateButtonPress(HIDButton button) {
|
||||
QPushButton* left_button = use_rich_text ? ui->button_cancel_rich : ui->button_cancel;
|
||||
QPushButton* right_button = use_rich_text ? ui->button_ok_rich : ui->button_ok;
|
||||
|
||||
// TODO (Morph): Handle QTextBrowser text scrolling
|
||||
// TODO (Morph): focusPrevious/NextChild() doesn't work well with the rich text dialog, fix it
|
||||
|
||||
switch (button) {
|
||||
case HIDButton::A:
|
||||
case HIDButton::B:
|
||||
if (left_button->hasFocus()) {
|
||||
left_button->click();
|
||||
} else if (right_button->hasFocus()) {
|
||||
right_button->click();
|
||||
}
|
||||
break;
|
||||
case HIDButton::DLeft:
|
||||
case HIDButton::LStickLeft:
|
||||
focusPreviousChild();
|
||||
break;
|
||||
case HIDButton::DRight:
|
||||
case HIDButton::LStickRight:
|
||||
focusNextChild();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayDialog::StartInputThread() {
|
||||
if (input_thread_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
input_thread_running = true;
|
||||
|
||||
input_thread = std::thread(&OverlayDialog::InputThread, this);
|
||||
}
|
||||
|
||||
void OverlayDialog::StopInputThread() {
|
||||
input_thread_running = false;
|
||||
|
||||
if (input_thread.joinable()) {
|
||||
input_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayDialog::InputThread() {
|
||||
while (input_thread_running) {
|
||||
input_interpreter->PollInput();
|
||||
|
||||
HandleButtonPressedOnce<HIDButton::A, HIDButton::B, HIDButton::DLeft, HIDButton::DRight,
|
||||
HIDButton::LStickLeft, HIDButton::LStickRight>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
}
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
// Copyright 2021 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
enum class HIDButton : u8;
|
||||
|
||||
class InputInterpreter;
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class OverlayDialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* An OverlayDialog is an interactive dialog that accepts controller input (while a game is running)
|
||||
* This dialog attempts to replicate the look and feel of the Nintendo Switch's overlay dialogs and
|
||||
* provide some extra features such as embedding HTML/Rich Text content in a QTextBrowser.
|
||||
* The OverlayDialog provides 2 modes: one to embed regular text into a QLabel and another to embed
|
||||
* HTML/Rich Text content into a QTextBrowser.
|
||||
*/
|
||||
class OverlayDialog final : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OverlayDialog(QWidget* parent, Core::System& system, const QString& title_text,
|
||||
const QString& body_text, const QString& left_button_text,
|
||||
const QString& right_button_text,
|
||||
Qt::Alignment alignment = Qt::AlignCenter, bool use_rich_text_ = false);
|
||||
~OverlayDialog() override;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Initializes a text dialog with a QLabel storing text.
|
||||
* Only use this for short text as the dialog buttons would be squashed with longer text.
|
||||
*
|
||||
* @param title_text Title text to be displayed
|
||||
* @param body_text Main text to be displayed
|
||||
* @param left_button_text Left button text. If empty, the button is hidden and disabled
|
||||
* @param right_button_text Right button text. If empty, the button is hidden and disabled
|
||||
* @param alignment Main text alignment
|
||||
*/
|
||||
void InitializeRegularTextDialog(const QString& title_text, const QString& body_text,
|
||||
const QString& left_button_text,
|
||||
const QString& right_button_text, Qt::Alignment alignment);
|
||||
|
||||
/**
|
||||
* Initializes a text dialog with a QTextBrowser storing text.
|
||||
* This is ideal for longer text or rich text content. A scrollbar is shown for longer text.
|
||||
*
|
||||
* @param title_text Title text to be displayed
|
||||
* @param body_text Main text to be displayed
|
||||
* @param left_button_text Left button text. If empty, the button is hidden and disabled
|
||||
* @param right_button_text Right button text. If empty, the button is hidden and disabled
|
||||
* @param alignment Main text alignment
|
||||
*/
|
||||
void InitializeRichTextDialog(const QString& title_text, const QString& body_text,
|
||||
const QString& left_button_text, const QString& right_button_text,
|
||||
Qt::Alignment alignment);
|
||||
|
||||
/// Moves and resizes the dialog to be fully overlayed on top of the parent window.
|
||||
void MoveAndResizeWindow();
|
||||
|
||||
/**
|
||||
* Handles button presses and converts them into keyboard input.
|
||||
*
|
||||
* @tparam HIDButton The list of buttons that can be converted into keyboard input.
|
||||
*/
|
||||
template <HIDButton... T>
|
||||
void HandleButtonPressedOnce();
|
||||
|
||||
/**
|
||||
* Translates a button press to focus or click either the left or right buttons.
|
||||
*
|
||||
* @param button The button press to process.
|
||||
*/
|
||||
void TranslateButtonPress(HIDButton button);
|
||||
|
||||
void StartInputThread();
|
||||
void StopInputThread();
|
||||
|
||||
/// The thread where input is being polled and processed.
|
||||
void InputThread();
|
||||
|
||||
std::unique_ptr<Ui::OverlayDialog> ui;
|
||||
|
||||
bool use_rich_text;
|
||||
|
||||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
|
||||
std::thread input_thread;
|
||||
|
||||
std::atomic<bool> input_thread_running{};
|
||||
};
|
||||
Executable
+404
@@ -0,0 +1,404 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OverlayDialog</class>
|
||||
<widget class="QDialog" name="OverlayDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedDialog">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="lineDialog">
|
||||
<layout class="QGridLayout" name="lineDialogGridLayout" rowstretch="210,300,210" columnstretch="250,780,250">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="contentDialog" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="70,149,82">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_dialog">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="buttonsDialog" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_cancel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_ok">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="richDialog">
|
||||
<layout class="QGridLayout" name="richDialogGridLayout" rowstretch="100,520,100" columnstretch="165,950,165">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="contentRichDialog" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="70,368,82">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_title_rich">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="text_browser_dialog">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:18pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="buttonsRichDialog" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_cancel_rich">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_ok_rich">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../dist/icons/overlay/overlay.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user