Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pkg batch install dlg on linux #12692

Merged
merged 2 commits into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion rpcs3/rpcs3qt/richtext_item_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ class richtext_item_delegate : public QStyledItemDelegate

// Adjust our painter parameters with some magic that looks good.
// This is necessary so that we don't draw on top of the optional widget.
const int margin = (option.rect.height() - opt.fontMetrics.height() - 4);
// If you're not happy with this code don't hesitate to contact Megamouse
#ifdef __linux__
static constexpr int margin_adjustement = 12;
#else
static constexpr int margin_adjustement = 4;
#endif

const int margin = (option.rect.height() - opt.fontMetrics.height() - margin_adjustement);
QRect text_rect = style->subElementRect(QStyle::SE_ItemViewItemText, &opt, nullptr);

if (index.column() != 0)
Expand All @@ -48,7 +55,10 @@ class richtext_item_delegate : public QStyledItemDelegate
text_rect.setTop(text_rect.top() + margin);

painter->translate(text_rect.topLeft());

#ifndef __linux__
painter->setClipRect(text_rect.translated(-text_rect.topLeft()));
#endif

// Create a context for our painter
QAbstractTextDocumentLayout::PaintContext context;
Expand Down