mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
Qt: fix invisible first game list icon on tiny icon sizes
This commit is contained in:
parent
9989fb4bbc
commit
ea3a73b598
@ -2,6 +2,8 @@
|
||||
#include "movie_item.h"
|
||||
#include "gui_settings.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
|
||||
game_list_delegate::game_list_delegate(QObject* parent)
|
||||
: 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()))
|
||||
{
|
||||
// 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());
|
||||
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)))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user