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 fa8b91a
Show file tree
Hide file tree
Showing 4 changed files with 9 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 @@ -257,7 +257,8 @@ void SortAndDisplayMenuScenePrivate::updateEmptyAreaActionState()
predicateAction[ActionID::kDisplayList]->setChecked(true);
break;
case Global::ViewMode::kTreeMode:
predicateAction[ActionID::kDisplayTree]->setChecked(true);
if (predicateAction.contains(ActionID::kDisplayTree))
predicateAction[ActionID::kDisplayTree]->setChecked(true);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,9 @@ void FileView::onDefaultViewModeChanged(int mode)
{
Global::ViewMode newMode = static_cast<Global::ViewMode>(mode);

if (newMode == Global::ViewMode::kTreeMode && !WorkspaceHelper::instance()->supportTreeView(rootUrl().scheme()))
return;

if (newMode == d->currentViewMode)
return;

Expand Down Expand Up @@ -1123,6 +1126,8 @@ void FileView::resizeEvent(QResizeEvent *event)

if (isIconViewMode())
updateViewportContentsMargins(itemSizeHint());

verticalScrollBar()->setFixedHeight(rect().height() - d->statusBar->height() - (d->headerView ? d->headerView->height() : 0));
}

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 fa8b91a

Please sign in to comment.