From 613d8b1cba514b8e4063dc58e609cec2609d0ee6 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Tue, 20 Oct 2020 22:14:06 -0500 Subject: [PATCH] DolphinQt: Remove description box handling from graphics widget and window --- Source/Core/DolphinQt/CMakeLists.txt | 1 - .../Config/Graphics/GraphicsWidget.cpp | 20 ------- .../Config/Graphics/GraphicsWidget.h | 11 ---- .../Config/Graphics/GraphicsWindow.cpp | 55 ++----------------- .../Config/Graphics/GraphicsWindow.h | 7 --- Source/Core/DolphinQt/DolphinQt.vcxproj | 1 - 6 files changed, 5 insertions(+), 90 deletions(-) delete mode 100644 Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.cpp diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index d059eb83fc..73811e4839 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -97,7 +97,6 @@ add_executable(dolphin-emu Config/Graphics/GraphicsRadio.h Config/Graphics/GraphicsSlider.cpp Config/Graphics/GraphicsSlider.h - Config/Graphics/GraphicsWidget.cpp Config/Graphics/GraphicsWidget.h Config/Graphics/GraphicsWindow.cpp Config/Graphics/GraphicsWindow.h diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.cpp deleted file mode 100644 index 8c8bae4bc4..0000000000 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include "DolphinQt/Config/Graphics/GraphicsWidget.h" - -#include -#include - -#include "DolphinQt/Config/Graphics/GraphicsWindow.h" - -GraphicsWidget::GraphicsWidget(GraphicsWindow* parent) -{ - parent->RegisterWidget(this); -} - -void GraphicsWidget::AddDescription(QWidget* widget, const char* description) -{ - emit DescriptionAdded(widget, description); -} diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.h index 46cdc8b971..fbe9bb8c1e 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsWidget.h @@ -6,23 +6,12 @@ #include -class GraphicsWindow; class QFormLayout; -class QGroupBox; -class QLabel; class GraphicsWidget : public QWidget { Q_OBJECT -public: - explicit GraphicsWidget(GraphicsWindow* parent); - -signals: - void DescriptionAdded(QWidget* widget, const char* description); - protected: - void AddDescription(QWidget* widget, const char* description); - virtual void LoadSettings() = 0; virtual void SaveSettings() = 0; diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.cpp index b9ca205b08..c5c35ed783 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.cpp @@ -40,26 +40,12 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo void GraphicsWindow::CreateMainLayout() { auto* main_layout = new QVBoxLayout(); - auto* description_box = new QGroupBox(tr("Description")); - auto* description_layout = new QVBoxLayout(); - m_description = - new QLabel(tr("Move the mouse pointer over an option to display a detailed description.")); m_tab_widget = new QTabWidget(); m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); - description_box->setLayout(description_layout); - description_box->setFixedHeight(200); - - m_description->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - m_description->setWordWrap(true); - m_description->setAlignment(Qt::AlignTop | Qt::AlignLeft); - - description_layout->addWidget(m_description); - main_layout->addWidget(m_tab_widget); - main_layout->addWidget(description_box); main_layout->addWidget(m_button_box); m_general_widget = new GeneralWidget(m_xrr_config, this); @@ -73,11 +59,11 @@ void GraphicsWindow::CreateMainLayout() connect(m_software_renderer, &SoftwareRendererWidget::BackendChanged, this, &GraphicsWindow::OnBackendChanged); - m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 305); - m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 305); - m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 305); - m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 305); - m_wrapped_software = GetWrappedWidget(m_software_renderer, this, 50, 305); + m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 100); + m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 100); + m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 100); + m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 100); + m_wrapped_software = GetWrappedWidget(m_software_renderer, this, 50, 100); if (Config::Get(Config::MAIN_GFX_BACKEND) != "Software Renderer") { @@ -118,34 +104,3 @@ void GraphicsWindow::OnBackendChanged(const QString& backend_name) emit BackendChanged(backend_name); } - -void GraphicsWindow::RegisterWidget(GraphicsWidget* widget) -{ - connect(widget, &GraphicsWidget::DescriptionAdded, this, &GraphicsWindow::OnDescriptionAdded); -} - -void GraphicsWindow::OnDescriptionAdded(QWidget* widget, const char* description) -{ - m_widget_descriptions[widget] = description; - widget->installEventFilter(this); -} - -bool GraphicsWindow::eventFilter(QObject* object, QEvent* event) -{ - if (!m_widget_descriptions.contains(object)) - return false; - - if (event->type() == QEvent::Enter) - { - m_description->setText(tr(m_widget_descriptions[object])); - return false; - } - - if (event->type() == QEvent::Leave) - { - m_description->setText( - tr("Move the mouse pointer over an option to display a detailed description.")); - } - - return false; -} diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h index 1850180dcd..6d4d2664e2 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h +++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsWindow.h @@ -11,7 +11,6 @@ class AdvancedWidget; class EnhancementsWidget; class HacksWidget; class GeneralWidget; -class GraphicsWidget; class MainWindow; class QLabel; class QTabWidget; @@ -29,18 +28,14 @@ class GraphicsWindow final : public QDialog public: explicit GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent); - void RegisterWidget(GraphicsWidget* widget); - bool eventFilter(QObject* object, QEvent* event) override; signals: void BackendChanged(const QString& backend); private: void CreateMainLayout(); void OnBackendChanged(const QString& backend); - void OnDescriptionAdded(QWidget* widget, const char* description); QTabWidget* m_tab_widget; - QLabel* m_description; QDialogButtonBox* m_button_box; AdvancedWidget* m_advanced_widget; @@ -56,6 +51,4 @@ private: QWidget* m_wrapped_software; X11Utils::XRRConfiguration* m_xrr_config; - - QHash m_widget_descriptions; }; diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 56edeccf7a..45d95b552e 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -68,7 +68,6 @@ -