Skip to content

Fix Find/Replace dialog size and auto-shrink to fit screen - #1101

Open
tanish0499 wants to merge 2 commits into
dail8859:masterfrom
tanish0499:fix/search-box-resizing
Open

Fix Find/Replace dialog size and auto-shrink to fit screen#1101
tanish0499 wants to merge 2 commits into
dail8859:masterfrom
tanish0499:fix/search-box-resizing

Conversation

@tanish0499

Copy link
Copy Markdown

Summary

Fixes the Find/Replace dialog growing to an excessive width. Entering a long string in the Find or Replace combo box expanded the editable combos to fit their content, forcing the whole dialog wider — and that oversized size was persisted, so it reopened huge every time.

Root cause

comboFind and comboReplace are editable with a MinimumExpanding policy and no sizeAdjustPolicy, so their size hint grew to fit the longest content. That width got saved via saveGeometry() and restored on the next open.

Changes

  • FindReplaceDialog.ui — set sizeAdjustPolicy = AdjustToMinimumContentsLengthWithIcon on both combos so their size hint no longer depends on content length. Prevents the problem going forward.
  • FindReplaceDialog.cpp — in loadSettings(), clamp the restored geometry to the available screen size, so users who already have an oversized dialog saved in notepadnext.ini recover automatically.

Testing

  • Long strings in Find/Replace no longer widen the dialog.
  • A pre-existing oversized geometry now opens clamped to the screen.
  • Recent-item history and geometry persistence still work.

…d saved geometry

Existing users may have a persisted geometry larger than their screen (from an older version that let the dialog grow to fit long recent search strings). Clamp the restored size to the available screen area in loadSettings() so it recovers automatically without editing notepadnext.ini.
@dail8859

Copy link
Copy Markdown
Owner

Hi @tanish0499

I do not see this behavior in the current master branch:

Fixes the Find/Replace dialog growing to an excessive width. Entering a long string in the Find or Replace combo box expanded the editable combos to fit their content, forcing the whole dialog wider

FindWindow

@tanish0499

Copy link
Copy Markdown
Author

Hi @dail8859 ,
Sorry for creating confusion, please try "find option" with a long string, and then close the NotepadNext and reopen it. Afterthat open search dialog, it gets stretched to fill the string in one line.
I'm attaching the videos also of both mac and windows behaviour. I will also update the PR description to pinpoint exact behaviour.

Screen.Recording.2026-08-01.at.12.54.59.PM.mp4
Screen.Recording.2026-08-01.at.12.48.58.PM.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants