Skip to content

Add image-sized window restoration feature - #220

Open
SKProCH wants to merge 7 commits into
riyasy:mainfrom
SKProCH:sizeWindowToImageOnRestore
Open

Add image-sized window restoration feature#220
SKProCH wants to merge 7 commits into
riyasy:mainfrom
SKProCH:sizeWindowToImageOnRestore

Conversation

@SKProCH

@SKProCH SKProCH commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Make behavior identical with Picasa - when the user clicks outside the image:

  • Resize the window to photo's size
  • Move the window to the same position as photo was (in absolute screen coordinates), so photo visually stay in place

Motivation described in #218

Type of change

  • Bug fix
  • New feature
  • Localization (new language or translation fix)
  • Documentation
  • Other

Related issue

#128

How was this tested?

  • Built and ran locally
  • Tested with real image files

Localization (if applicable)

  • name attributes are unchanged and match en-US
  • Files saved as UTF-8

Checklist

  • I have reviewed and understand every line of this change.
  • This change is focused and avoids unrelated or low-value edits.

Animation.mp4

AI was used to write Win32 related stuff.

@SKProCH

SKProCH commented Jul 17, 2026

Copy link
Copy Markdown
Author

Probably there should be also 2 more features:

  • Double click on the image will open fullscreen back
  • Allow to size window in the way, when the controls and previews of other files will be below the image

But keeping this PR focused

@2590812378

Copy link
Copy Markdown

这是非常好的功能,期待已久

@riyasy

riyasy commented Aug 14, 2026

Copy link
Copy Markdown
Owner

@SKProCH , the PR cannot be merged to latest code as it has conflicts.
If possible, can you please correct this?
Also can you keep the new code as isolated as possible and enable this behaviour based on a setting in AppSettings.cs (like ResizeToImageBounds). (if you add in settings.xaml, add it under Advanced section for the time being)
So that I can first add it as Beta feature and after review and testing promote as a feature?

@SKProCH

SKProCH commented Aug 14, 2026

Copy link
Copy Markdown
Author

Ok, will do it a bit later today (hopefully)

@riyasy

riyasy commented Aug 14, 2026

Copy link
Copy Markdown
Owner

No hurry... thanks.
I am working only intermittently as I am on a break for few weeks.

…store

# Conflicts:
#	Src/FlyPhotos/Strings/en-US/Resources.resw
#	Src/FlyPhotos/UI/Views/PhotoDisplayWindow.xaml.cs
@SKProCH

SKProCH commented Aug 14, 2026

Copy link
Copy Markdown
Author

Resolved merge conflicts, move the settings into advanced. Anything else?

@riyasy

riyasy commented Aug 14, 2026

Copy link
Copy Markdown
Owner
  1. After resizing, there seems to be a small gap at the bottom of the window.
image
  1. can we have the resizing animation disabled in this mode?

@SKProCH

SKProCH commented Aug 14, 2026

Copy link
Copy Markdown
Author

What do you mean by "can we have the resizing animation disabled in this mode?". Does this have anything with this addition? Seems like they are not interfere with each other

@riyasy

riyasy commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Normaly when we click outside image and the window animates to the new size, it is not an issue as the size of the photo also changes.
But in the new mode, we exactly resize and position the photo such that we don't want any movement to the photo. So the animation during the transition from fullscree/maximized to the resized window is a distraction. (You can see in picasa photo viewer that it is instant and there is no window animation).
It has got nothing with your code, but Windows OS animating the window resize. But we will be able to disable that animation during this mode only.

@SKProCH

SKProCH commented Aug 15, 2026

Copy link
Copy Markdown
Author

I don't have any animation there, its just instant for me. Probably because im on win 10?

@SKProCH

SKProCH commented Aug 15, 2026

Copy link
Copy Markdown
Author

But, seems like by the MS docs is this what you want?

@riyasy

riyasy commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Now the animation seems gone..
I didn't read/review the code, but it seems mostly working.

Few times, I lose the window like..

  1. Go to maximized/full screen. enlarge the image larger than the monitor.
  2. Move the image to top left area such that only part of the image is visible and most of it is outside screen.
  3. Then click outside to trigger restore. Sometimes then the window disappears from current monitor (Means it is located outside the cordinates of the current monitor) and we won't be able to use Fly unless we quit and restart app again.

@SKProCH

SKProCH commented Aug 17, 2026

Copy link
Copy Markdown
Author

Hmmm, interesting case... I need to look how its handled in picasa and think about it

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.

3 participants