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: [UI]display issue #1758

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
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
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