add tooltip

This commit is contained in:
faith 2024-12-06 11:36:11 +08:00
parent 83409389a9
commit f9731fcccc
3 changed files with 10 additions and 2 deletions

View File

@ -4,9 +4,9 @@
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/path_util.h" #include "common/path_util.h"
#include "common/string_util.h" #include "common/string_util.h"
#include "compatibility_info.h"
#include "game_list_frame.h" #include "game_list_frame.h"
#include "game_list_utils.h" #include "game_list_utils.h"
#include <QToolTip>
GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get, GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
std::shared_ptr<CompatibilityInfoClass> compat_info_get, std::shared_ptr<CompatibilityInfoClass> compat_info_get,
@ -219,25 +219,32 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityStatu
QGridLayout* layout = new QGridLayout(widget); QGridLayout* layout = new QGridLayout(widget);
QColor color; QColor color;
QString tooltip_string;
switch (status) { switch (status) {
case Unknown: case Unknown:
color = QStringLiteral("#000000"); color = QStringLiteral("#000000");
tooltip_string = tr("Compatibility is untested");
break; break;
case Nothing: case Nothing:
color = QStringLiteral("#212121"); color = QStringLiteral("#212121");
tooltip_string = tr("Games that do not initialize properly / crash the emulator");
break; break;
case Boots: case Boots:
color = QStringLiteral("#828282"); color = QStringLiteral("#828282");
tooltip_string = tr("Games that are able to boot, but only display a blank screen");
break; break;
case Menus: case Menus:
color = QStringLiteral("#FF0000"); color = QStringLiteral("#FF0000");
tooltip_string = tr("Games that displays an image but do not go past the menus");
break; break;
case Ingame: case Ingame:
color = QStringLiteral("#F2D624"); color = QStringLiteral("#F2D624");
tooltip_string = tr("Games that have game-breaking glitches or unplayable performance");
break; break;
case Playable: case Playable:
color = QStringLiteral("#47D35C"); color = QStringLiteral("#47D35C");
tooltip_string = tr("Game can be completed with playable performance and no major glitches");
break; break;
} }
@ -268,6 +275,7 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityStatu
layout->addWidget(label, 0, 4, -1, 4); layout->addWidget(label, 0, 4, -1, 4);
layout->setAlignment(Qt::AlignLeft); layout->setAlignment(Qt::AlignLeft);
widget->setLayout(layout); widget->setLayout(layout);
widget->setToolTip(tooltip_string);
this->setItem(row, column, item); this->setItem(row, column, item);
this->setCellWidget(row, column, widget); this->setCellWidget(row, column, widget);

View File

@ -10,6 +10,7 @@
#include <QScrollBar> #include <QScrollBar>
#include "background_music_player.h" #include "background_music_player.h"
#include "compatibility_info.h"
#include "game_info.h" #include "game_info.h"
#include "game_list_utils.h" #include "game_list_utils.h"
#include "gui_context_menus.h" #include "gui_context_menus.h"

View File

@ -15,7 +15,6 @@
#include "common/scm_rev.h" #include "common/scm_rev.h"
#include "common/string_util.h" #include "common/string_util.h"
#include "common/version.h" #include "common/version.h"
#include "compatibility_info.h"
#include "core/file_format/pkg.h" #include "core/file_format/pkg.h"
#include "core/loader.h" #include "core/loader.h"
#include "game_install_dialog.h" #include "game_install_dialog.h"