From f9731fccccccd950652f1d162a3d5da61164a639 Mon Sep 17 00:00:00 2001 From: faith Date: Fri, 6 Dec 2024 11:36:11 +0800 Subject: [PATCH] add tooltip --- src/qt_gui/game_list_frame.cpp | 10 +++++++++- src/qt_gui/game_list_frame.h | 1 + src/qt_gui/main_window.cpp | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/game_list_frame.cpp b/src/qt_gui/game_list_frame.cpp index 6709be1b3..7307caad9 100644 --- a/src/qt_gui/game_list_frame.cpp +++ b/src/qt_gui/game_list_frame.cpp @@ -4,9 +4,9 @@ #include "common/logging/log.h" #include "common/path_util.h" #include "common/string_util.h" -#include "compatibility_info.h" #include "game_list_frame.h" #include "game_list_utils.h" +#include GameListFrame::GameListFrame(std::shared_ptr game_info_get, std::shared_ptr compat_info_get, @@ -219,25 +219,32 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityStatu QGridLayout* layout = new QGridLayout(widget); QColor color; + QString tooltip_string; switch (status) { case Unknown: color = QStringLiteral("#000000"); + tooltip_string = tr("Compatibility is untested"); break; case Nothing: color = QStringLiteral("#212121"); + tooltip_string = tr("Games that do not initialize properly / crash the emulator"); break; case Boots: color = QStringLiteral("#828282"); + tooltip_string = tr("Games that are able to boot, but only display a blank screen"); break; case Menus: color = QStringLiteral("#FF0000"); + tooltip_string = tr("Games that displays an image but do not go past the menus"); break; case Ingame: color = QStringLiteral("#F2D624"); + tooltip_string = tr("Games that have game-breaking glitches or unplayable performance"); break; case Playable: color = QStringLiteral("#47D35C"); + tooltip_string = tr("Game can be completed with playable performance and no major glitches"); break; } @@ -268,6 +275,7 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityStatu layout->addWidget(label, 0, 4, -1, 4); layout->setAlignment(Qt::AlignLeft); widget->setLayout(layout); + widget->setToolTip(tooltip_string); this->setItem(row, column, item); this->setCellWidget(row, column, widget); diff --git a/src/qt_gui/game_list_frame.h b/src/qt_gui/game_list_frame.h index 8d5934234..ddfa85ce7 100644 --- a/src/qt_gui/game_list_frame.h +++ b/src/qt_gui/game_list_frame.h @@ -10,6 +10,7 @@ #include #include "background_music_player.h" +#include "compatibility_info.h" #include "game_info.h" #include "game_list_utils.h" #include "gui_context_menus.h" diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 4c9b52de7..b00e14e8b 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -15,7 +15,6 @@ #include "common/scm_rev.h" #include "common/string_util.h" #include "common/version.h" -#include "compatibility_info.h" #include "core/file_format/pkg.h" #include "core/loader.h" #include "game_install_dialog.h"