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: When renaming a file in the icon view, if there are no other files below the file, the input displayed during file renaming is incomplete #2103

Merged
merged 1 commit into from
Jul 11, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ void IconItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionV
{
Q_D(const IconItemDelegate);

const QSize &iconSize = parent()->parent()->iconSize();
auto fileview = parent()->parent();
const QSize &iconSize = fileview->iconSize();

editor->move(option.rect.topLeft());
editor->setMinimumHeight(option.rect.height());
Expand All @@ -715,7 +716,11 @@ void IconItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionV
return;

FileViewHelper *viewHelper = qobject_cast<FileViewHelper *>(parent());
const int maxHeight = viewHelper ? (viewHelper->viewContentSize().height() - viewHelper->verticalOffset() - item->pos().y()) : INT_MAX;
int maxHeight = viewHelper ? (viewHelper->viewContentSize().height() - viewHelper->verticalOffset() - item->pos().y()) : INT_MAX;
if (viewHelper && fileview
&& fileview->size().height() > viewHelper->viewContentSize().height())
maxHeight = fileview->size().height() - viewHelper->verticalOffset() - item->pos().y();

item->setMaxHeight(qMax(maxHeight, sizeHint(opt, index).height()));

QLabel *icon = item->getIconLabel();
Expand Down
Loading