DolphinQt: Add tooltip support to Software Renderer Graphics tab

This commit is contained in:
iwubcode 2020-10-20 20:03:15 -05:00
parent 2bfb8ebf96
commit 9c204428fe
2 changed files with 37 additions and 37 deletions

View file

@ -18,6 +18,7 @@
#include "DolphinQt/Config/Graphics/GraphicsBool.h" #include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h" #include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "DolphinQt/Settings.h" #include "DolphinQt/Settings.h"
#include "UICommon/VideoUtils.h" #include "UICommon/VideoUtils.h"
@ -25,7 +26,7 @@
#include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoConfig.h"
SoftwareRendererWidget::SoftwareRendererWidget(GraphicsWindow* parent) : GraphicsWidget(parent) SoftwareRendererWidget::SoftwareRendererWidget(GraphicsWindow* parent)
{ {
CreateWidgets(); CreateWidgets();
LoadSettings(); LoadSettings();
@ -45,7 +46,7 @@ void SoftwareRendererWidget::CreateWidgets()
auto* rendering_box = new QGroupBox(tr("Rendering")); auto* rendering_box = new QGroupBox(tr("Rendering"));
auto* rendering_layout = new QGridLayout(); auto* rendering_layout = new QGridLayout();
m_backend_combo = new QComboBox(); m_backend_combo = new ToolTipComboBox();
rendering_box->setLayout(rendering_layout); rendering_box->setLayout(rendering_layout);
rendering_layout->addWidget(new QLabel(tr("Backend:")), 1, 1); rendering_layout->addWidget(new QLabel(tr("Backend:")), 1, 1);
@ -154,38 +155,37 @@ void SoftwareRendererWidget::SaveSettings()
void SoftwareRendererWidget::AddDescriptions() void SoftwareRendererWidget::AddDescriptions()
{ {
static const char TR_BACKEND_DESCRIPTION[] = static const char TR_BACKEND_DESCRIPTION[] = QT_TR_NOOP(
QT_TR_NOOP("Selects what graphics API to use internally.\nThe software renderer is extremely " "Selects what graphics API to use internally.<br>The software renderer is extremely "
"slow and only useful for debugging, so you'll want to use either Direct3D or " "slow and only useful for debugging, so you'll want to use either Direct3D or "
"OpenGL. Different games and different GPUs will behave differently on each " "OpenGL. Different games and different GPUs will behave differently on each "
"backend, so for the best emulation experience it's recommended to try both and " "backend, so for the best emulation experience it's recommended to try both and "
"choose the one that's less problematic.\n\nIf unsure, select OpenGL."); "choose the one that's less problematic.<br><br><dolphin_emphasis>If unsure, select "
"OpenGL.</dolphin_emphasis>");
static const char TR_SHOW_STATISTICS_DESCRIPTION[] = static const char TR_SHOW_STATISTICS_DESCRIPTION[] =
QT_TR_NOOP("Show various rendering statistics.\n\nIf unsure, leave this unchecked."); QT_TR_NOOP("Show various rendering statistics.<br><br><dolphin_emphasis>If unsure, leave "
"this unchecked.</dolphin_emphasis>");
static const char TR_DUMP_TEXTURES_DESCRIPTION[] = static const char TR_DUMP_TEXTURES_DESCRIPTION[] =
QT_TR_NOOP("Dump decoded game textures to User/Dump/Textures/<game_id>/.\n\nIf unsure, leave " QT_TR_NOOP("Dump decoded game textures to User/Dump/Textures/<game_id>/.<br><br "
"this unchecked."); "/><dolphin_emphasis>If unsure, leave "
"this unchecked.</dolphin_emphasis>");
static const char TR_DUMP_OBJECTS_DESCRIPTION[] = static const char TR_DUMP_OBJECTS_DESCRIPTION[] =
QT_TR_NOOP("Dump objects to User/Dump/Objects/.\n\nIf unsure, leave " QT_TR_NOOP("Dump objects to User/Dump/Objects/.<br><br><dolphin_emphasis>If unsure, leave "
"this unchecked."); "this unchecked.</dolphin_emphasis>");
static const char TR_DUMP_TEV_STAGES_DESCRIPTION[] = static const char TR_DUMP_TEV_STAGES_DESCRIPTION[] =
QT_TR_NOOP("Dump TEV Stages to User/Dump/Objects/.\n\nIf unsure, leave " QT_TR_NOOP("Dump TEV Stages to User/Dump/Objects/.<br><br><dolphin_emphasis>If unsure, leave "
"this unchecked."); "this unchecked.</dolphin_emphasis>");
static const char TR_DUMP_TEV_FETCHES_DESCRIPTION[] = QT_TR_NOOP(
"Dump Texture Fetches to User/Dump/Objects/.<br><br><dolphin_emphasis>If unsure, leave "
"this unchecked.</dolphin_emphasis>");
static const char TR_DUMP_TEV_FETCHES_DESCRIPTION[] = m_backend_combo->SetTitle(tr("Backend"));
QT_TR_NOOP("Dump Texture Fetches to User/Dump/Objects/.\n\nIf unsure, leave " m_backend_combo->SetDescription(QString::fromStdString(TR_BACKEND_DESCRIPTION));
"this unchecked."); m_show_statistics->SetDescription(QString::fromStdString(TR_SHOW_STATISTICS_DESCRIPTION));
m_dump_textures->SetDescription(QString::fromStdString(TR_DUMP_TEXTURES_DESCRIPTION));
AddDescription(m_backend_combo, TR_BACKEND_DESCRIPTION); m_dump_objects->SetDescription(QString::fromStdString(TR_DUMP_OBJECTS_DESCRIPTION));
AddDescription(m_show_statistics, TR_SHOW_STATISTICS_DESCRIPTION); m_dump_tev_stages->SetDescription(QString::fromStdString(TR_DUMP_TEV_STAGES_DESCRIPTION));
AddDescription(m_dump_textures, TR_DUMP_TEXTURES_DESCRIPTION); m_dump_tev_fetches->SetDescription(QString::fromStdString(TR_DUMP_TEV_FETCHES_DESCRIPTION));
AddDescription(m_dump_objects, TR_DUMP_OBJECTS_DESCRIPTION);
AddDescription(m_dump_tev_stages, TR_DUMP_TEV_STAGES_DESCRIPTION);
AddDescription(m_dump_tev_fetches, TR_DUMP_TEV_FETCHES_DESCRIPTION);
} }
void SoftwareRendererWidget::OnEmulationStateChanged(bool running) void SoftwareRendererWidget::OnEmulationStateChanged(bool running)

View file

@ -6,10 +6,10 @@
#include "DolphinQt/Config/Graphics/GraphicsWidget.h" #include "DolphinQt/Config/Graphics/GraphicsWidget.h"
class GraphicsBool;
class GraphicsWindow; class GraphicsWindow;
class QCheckBox;
class QComboBox;
class QSpinBox; class QSpinBox;
class ToolTipComboBox;
class SoftwareRendererWidget final : public GraphicsWidget class SoftwareRendererWidget final : public GraphicsWidget
{ {
@ -30,12 +30,12 @@ private:
void OnEmulationStateChanged(bool running); void OnEmulationStateChanged(bool running);
QComboBox* m_backend_combo; ToolTipComboBox* m_backend_combo;
QCheckBox* m_show_statistics; GraphicsBool* m_show_statistics;
QCheckBox* m_dump_textures; GraphicsBool* m_dump_textures;
QCheckBox* m_dump_objects; GraphicsBool* m_dump_objects;
QCheckBox* m_dump_tev_stages; GraphicsBool* m_dump_tev_stages;
QCheckBox* m_dump_tev_fetches; GraphicsBool* m_dump_tev_fetches;
QSpinBox* m_object_range_min; QSpinBox* m_object_range_min;
QSpinBox* m_object_range_max; QSpinBox* m_object_range_max;