mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Qt: fix invisible first game list icon on tiny icon sizes
This commit is contained in:
parent
9989fb4bbc
commit
ea3a73b598
1 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
||||||
#include "movie_item.h"
|
#include "movie_item.h"
|
||||||
#include "gui_settings.h"
|
#include "gui_settings.h"
|
||||||
|
|
||||||
|
#include <QHeaderView>
|
||||||
|
|
||||||
game_list_delegate::game_list_delegate(QObject* parent)
|
game_list_delegate::game_list_delegate(QObject* parent)
|
||||||
: table_item_delegate(parent, true)
|
: table_item_delegate(parent, true)
|
||||||
{}
|
{}
|
||||||
|
@ -15,8 +17,12 @@ void game_list_delegate::paint(QPainter* painter, const QStyleOptionViewItem& op
|
||||||
{
|
{
|
||||||
if (const QTableWidget* table = static_cast<const QTableWidget*>(parent()))
|
if (const QTableWidget* table = static_cast<const QTableWidget*>(parent()))
|
||||||
{
|
{
|
||||||
|
// We need to remove the headers from our calculation. The visualItemRect starts at 0,0 while the visibleRegion doesn't.
|
||||||
|
QRegion visible_region = table->visibleRegion();
|
||||||
|
visible_region.translate(-table->verticalHeader()->width(), -table->horizontalHeader()->height());
|
||||||
|
|
||||||
if (const QTableWidgetItem* current_item = table->item(index.row(), index.column());
|
if (const QTableWidgetItem* current_item = table->item(index.row(), index.column());
|
||||||
current_item && table->visibleRegion().intersects(table->visualItemRect(current_item)))
|
current_item && visible_region.intersects(table->visualItemRect(current_item)))
|
||||||
{
|
{
|
||||||
if (movie_item* item = static_cast<movie_item*>(table->item(index.row(), gui::game_list_columns::column_icon)))
|
if (movie_item* item = static_cast<movie_item*>(table->item(index.row(), gui::game_list_columns::column_icon)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue