How can I make the ImageEditor's zoomToFit work so that I use the available screen space? - sapui5

I want to use a sap.suite.ui.commons.imageeditor.ImageEditor control inside a sap.m.WizardStep.
After loading the image I want to use the zoomToFit method of the control to resize the image and use a maximum of the available screen space: 100% width and the height maximized to what's left available in the WizardStep without adding scroll bars.
I created a sample to show the challenge: https://plnkr.co/edit/9GhXbOzuIqP6VxqS?preview

Related

Make `NSScrollView` large enough to fit document view but not so large it will make the window overflow the screen

Problem
This is an issue I'm having with an open source Cocoa framework I'm developing, EasyDialogs.
The goal is to programmatically display a form (a bunch of controls) inside a window, and automatically resize the window to a "sensible" size that is never larger than the screen.
However when opening a form window (FormWindow), the window has a size that does not match the size of the controls in the form and needs to be manually resized by the user.
Expected behaviour
The desired behaviour of the window (FormWindow) is that the window expands to a size that is large enough to include the form controls (minimum size necessary to display all controls), unless that would make the window larger than the screen. In this case, the window should be limited by the screen size, and the form controls will be clipped (inside a scroll view).
How to reproduce
check out the fix/form-window-resizing branch
run carthage bootstrap --platform osx
open XCode and run the EasyDialogExample schema
The app will open an show a window with a button for "Large" or "Small" form. Try both.
Details
The window in FormWindow is composed of three sections:
header, it's just a label
stack of controls, the actual form controls
footer, it's the "OK"/"Cancel" buttons
The three sections are constrained to be on top of each other, in that order, filling the entire window. The relevant part for the purpose of this issue is the stack.
The stack is a NSStackView inside a NSScrollView. The NSStackView holds the form controls. The desired behavior is that the scroll view will grow to adjust to the minimum size necessary to accommodate the stack with no clipping, unless this will make the whole window larger than the screen, i.e. the top (or bottom) of the window is far off the screen and it can not be reached with the mouse.
If this were to happen, the NSScrollView should instead clip the stack view, so that the window is as large as the screen but it does not grow beyond it, and the user can scroll to visit the entire stack.
Attempted solution
Set the scroll size min and max
scroll.height <= stack.height
scroll.height >= 300
Why it doesn't work: the scroll size is always the minimum one. I need to manually resize the window after it's displayed.
Set the scroll size to be the stack size
scroll.height == stack.height
Why it doesn't work: the window is always as large as needed to display the form. This works as long as the stack plus the rest of the window is smaller than the screen. However it will make the window larger than the screen.
Modify the scroll view intrinsicContentSize
I subclassed NSStackView to return an intrinsic content size which is equal to the size of the documentView. However, the intrinsic size property is accessed before performing the layout, so the intrinsic content size of the subview at that moment is (-1,-1).

How to customize image size when using blueimp-gallery lightbox?

I'm using http://blueimp.github.io/Gallery/ in a bootstrap environment.
It works with my images but the modal window which shows the full size image is not large enough for me. It takes only one-third of my screen width.
You can see a live-example here:
http://www.randspringer.de/mannschaftsaufstellungen/1.html
How can I customize the size of the displayed full image?
You could either add
data-use-bootstrap-modal="false"
to the lightbox container, which displays the images borderless and fullscreen
or adjust the size of the modal according to the bootstrap documentation:
http://getbootstrap.com/javascript/#modals-sizes

Dynamic Width Slides?

I'm using a JSSOR slider that scrolls content horizontally. My issue is that the slide content is dynamic. An admin has the ability to add and remove images & text from the slider, however not all the divs are the same width. This creates gaps and/or overlapping.
I can create a code to get the width of each slide prior to the initialization of jssor, however I'm wondering if there's a way to apply $SlideWidth to individual slides by index?
Thanks.

Fix height to smallest possible GTK

I have placed buttons inside a horizontal box inside a window. Now I want this box to be on the top of the window with the smallest possible height. The rest of the window is drawing area for an image display that changes height with the window. How?
I solved it using a table with the following for the first and second row
gtk_table_attach(GTK_TABLE(table),toolbar,0,1,0,1
,GtkAttachOptions((guint)GTK_FILL|(guint)GTK_EXPAND)
,GTK_SHRINK,0,0);
gtk_table_attach(GTK_TABLE(table),test,0,1,1,2
,GtkAttachOptions((guint)GTK_FILL|(guint)GTK_EXPAND)
,GtkAttachOptions((guint)GTK_FILL|(guint)GTK_EXPAND),0,0);

PictureScrollField in BlackBerry

I want to create a PictureScrollField using some images in Blackberry.By default it is displayed on the top of the screen with the given width and height.
But if we want to display the entire one at certain coordinates say(x,y),then how to align them.
add the picture scroll field in a horizontal field manager and align the manager