!7 cmodule FullscreenImage > DynImageSurface { switchable bool noScroll = true; // workaround for weird unnecessary scrollbars (TODO: find out why that happens) switchable bool zoomToScreen = true; transient ImageSurface fullScreenIS; start { if (!hasImage()) setImage(whiteImage(100, 100)); } visual withCenteredButtons(super, "Show fullscreen", rThread showFullscreen); void showFullscreen enter { if (!hasImage()) ret; if (fullScreenIS != null) activateFrame(fullScreenIS); fullScreenIS = noScroll ? showFullScreenImageSurface_noScroll : showFullScreenImageSurface(getImage()); if (zoomToScreen) fullScreenIS.zoomToDisplay(); onFrameClose(fullScreenIS, r { fullScreenIS = null; }); } void exitFullscreen enter { disposeFrame(fullScreenIS); } }