Skip to content

fix: keep the file dialog at the size the user left it - #133

Open
gh-underfoot581 wants to merge 1 commit into
ack00gar:mainfrom
gh-underfoot581:fix/file-dialog-resize
Open

fix: keep the file dialog at the size the user left it#133
gh-underfoot581 wants to merge 1 commit into
ack00gar:mainfrom
gh-underfoot581:fix/file-dialog-resize

Conversation

@gh-underfoot581

Copy link
Copy Markdown

The file dialog can't be resized. set_next_window_size runs on every frame in draw(), so the window snaps back to 750x400 as soon as a drag-resize ends.

  • Apply the size once per open, guarded by a flag, instead of every frame
  • Save it to app settings on close and restore it in show(), so a resize survives the next open and the next session
  • The save sits on the shared close path (the finally in draw()) rather than on each close site individually, so closing by picking a file behaves the same as pressing Cancel

self.open is cleared in five places — _select_file, _confirm_folder_selection, the overwrite-confirm button, and Cancel and the action button in _draw_bottom_bar — and all five pass through that finally before imgui.end(), so one call covers them.

I've been running this on Windows since May and the dialog keeps its size across opens and across restarts. I haven't exercised it on macOS or Linux.

set_next_window_size ran on every frame, so the dialog snapped back to
750x400 the moment a drag-resize ended. Apply the size once per open,
and save it to app settings on close so it survives the next open and
the next session.

The save sits on the shared close path rather than on each individual
one, so closing by picking a file counts the same as pressing Cancel.
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.

1 participant