Opened 9 months ago

Last modified 9 months ago

#18869 new bug

ShowImage zoom button should not go into slideshow mode

Reported by: bitigchi Owned by: leavengood
Priority: normal Milestone: Unscheduled
Component: Applications/ShowImage Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Zoom button should resize the window to the image diameters. There is already a slideshow button in the toolbar.

Change History (9)

comment:1 by humdinger, 9 months ago

On hrev57649, 64bit, clicking the zoom button shows the image in fullscreen. No slideshow. Expected behaviour IMO.

comment:2 by bruno, 9 months ago

Which Zoom button do you mean? 64bit hrev57669 nightly cannot reproduce!

in reply to:  1 ; comment:3 by bitigchi, 9 months ago

Bruno, the zoom button on the window tab.

Replying to humdinger:

On hrev57649, 64bit, clicking the zoom button shows the image in fullscreen. No slideshow. Expected behaviour IMO.

Is full screen equivalent to zoom?

in reply to:  3 comment:4 by humdinger, 9 months ago

Replying to bitigchi:

Is full screen equivalent to zoom?

Not sure I understand the question. That's how Showimage is behaving, and it's one logical behaviour. To change it after decades of usage, it has to bring objective advantages.

comment:5 by humdinger, 9 months ago

Hmm... I change my opinion on this. :)

Fullscreen is already quickly achieved with a double-click or ALT+ENTER.

The zoom button could zoom the image to 100% and fit the window size to that. A feat not easily done at all ATM...

in reply to:  5 ; comment:6 by madmax, 9 months ago

Replying to humdinger:

The zoom button could zoom the image to 100% and fit the window size to that. A feat not easily done at all ATM...

Or is it?

diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp
index 5d73da6f7d..1797e4a134 100644
--- a/src/apps/showimage/ShowImageWindow.cpp
+++ b/src/apps/showimage/ShowImageWindow.cpp
@@ -631,7 +631,9 @@ ShowImageWindow::_MarkSlideShowDelay(bigtime_t delay)
 void
 ShowImageWindow::Zoom(BPoint origin, float width, float height)
 {
-       _ToggleFullScreen();
+       BRect rect = fImageView->Bitmap()->Bounds();
+       float zoom = fImageView->Zoom();
+       ResizeTo(rect.Width() * zoom, rect.Height() * zoom);
 }
 

That's a quick and dirty "resize the window to current image size". It doesn't take into account the space taken by scrollbars, menu, icon bar, pixel fitting or whatever else. In fact, there's _ResizeWindowToImage already, not used anywhere, that seems to do all that except it resizes to the 100% image size (capped by screen dimensions and window size limits) without zooming the image, so it still needs a tiny bit of work.

in reply to:  6 comment:7 by humdinger, 9 months ago

Replying to madmax:

Replying to humdinger:

A feat not easily done at all ATM...

Or is it?

I meant for the person using ShowImage. :)

comment:8 by pulkomandy, 9 months ago

Old versions of ShowImage had the zoom button do this. It was changed to go to fullscreen mode despite some disagreement over it. I would prefer the old behavior of showing the image in 1:1 size with the window just large enough, if possible, and maybe going to fullscreen if the image is too large to fit on screen?

comment:9 by bitigchi, 9 months ago

Going fullscreen if the diameters are too large to fit on screen sounds nice, but it should not be triggered involuntarily IMHO. Maybe adding a modifier to the zoom button would be nice like Apple does.

Note: See TracTickets for help on using tickets.