Skip to content

Commit

Permalink
fix: [UI]display issue
Browse files Browse the repository at this point in the history
1.set render hint of painter.
2.reset scrollbar height when resize.

Log: fix UI issue
Bug: https://pms.uniontech.com/bug-view-239935.html
  • Loading branch information
Lighto-Ku committed Jan 23, 2024
1 parent 1bc9675 commit 4640484
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void IconItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
{
QStyleOptionViewItem opt = option;
opt.decorationAlignment = Qt::AlignCenter;
painter->setRenderHint(QPainter::SmoothPixmapTransform);
DStyledItemDelegate::paint(painter, opt, index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,8 +1121,12 @@ void FileView::resizeEvent(QResizeEvent *event)
if (itemDelegate() && itemDelegate()->editingIndex().isValid())
doItemsLayout();

if (isIconViewMode())
if (isIconViewMode()) {
updateViewportContentsMargins(itemSizeHint());
verticalScrollBar()->setFixedHeight(rect().height() - d->statusBar->height());
} else {
verticalScrollBar()->setFixedHeight(rect().height() - d->statusBar->height() - d->headerView->height());
}
}

void FileView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void TreeItemPaintProxy::drawExpandArrow(QPainter *painter, const QRectF &rect,
painter->setPen(opt.palette.color(QPalette::Active, QPalette::Text));
}

painter->setRenderHint(QPainter::SmoothPixmapTransform);
if (index.data(kItemTreeViewExpandedRole).toBool()) {
style->drawPrimitive(QStyle::PE_IndicatorArrowDown, &opt, painter, nullptr);
} else {
Expand Down

0 comments on commit 4640484

Please sign in to comment.