vaadin floating(dynamic ?) layout - user-interface

I use vaadin 7. I am not sure whether the "floating layout" is the proper term so let me describe what I want.
I have more panels inside a layout. The size of those panels are fixed. If the browser window is large enough they are arranged next to each other horizontally. If the window does not have enough space for all of them horizontally, then the panels should be arranged vertically.
1, What is this kind of layout called? Floating? Dynamic?
2, How to achieve this with vaadin 7?
Neither horizontalLayout.setSizeUndefined() nor horizontalLayout.setSizeFull() work.
I am not even sure whether I need HorizontalLayout or something else.

You could either use the CSSLayout with width:100% and put your components inside this,
or you can look at the responsive addon.
https://vaadin.com/directory#addon/vaadin-responsive:vaadin
And some more about the add on
https://vaadin.com/wiki/-/wiki/Main/Responsive+layouts+using+the+Responsive+extension

Related

how to do a horizontal carousel layout in nativescript?

As the picture above demonstrates, I want a layout that could contain A,B,C 3 sections. But only section B would be visible, A & C should be hidden, but when user swipe on section B, they could see the content of section A or C. I know ScrollView could do this, but I don't want it to be scrollable to the user. I want to programmatically control the behaviour when user swipes on it. Similar to the carousel. I have tried normal layout like GridLayout, FlexboxLayout...they all will contain the elements in the page, they just didnt let them overflow. So anyone has any idea on how to work around on it, please let me know, thanks.
I would recommend using nativescript-carousel (https://market.nativescript.org/plugins/nativescript-carousel) to achieve this. I think that is pretty much what you are after - just hide the indicator (dots). There are demos on that page for how to use with vanilla javascript, angular, or vue.
It makes use of DKCarouselView for iOS and ViewPager for Android.
You can also hook onto the slide tap and change events easily enough, which is all in the demo usage instructions.

How to perfectly mimic toolbar buttons as in Finder, Safari, or other default apps?

I'm trying to create an application that would be as standard as possible in terms of style.
An image is worth a thousand words: I can't figure out how to make my buttons the same size as in Apple's programs such as Safari or Finder.
As you can see, the sizing I've set in interface builder don't seem to match the size the buttons get when I run the app, but maybe that part doesn't speak in pixels but in points or something? Also, textured rounded button has only width editable, but not height.
In this case, these are NSButtons, but I guess I'll have a similar problem with other control types...
I found it out! The problem was with neither of these two parts outlined in the screenshot, but in the "Toolbar" item, higher in the hierarchy.
There is a Size attribute in the Attributes inspector which defaults to Small, but you can set it to Regular instead, and then the buttons get the same sizing as in Finder and all.

Subview that expands with window using NSAutolayout

I'm trying to learn auto layout so I can set up a moderately complicated display the way I want. I'm starting with a simple version. At least I thought it was simple.
I have a content view containing a NSScrollView, and a zoom slider. The scroll view is, of course, just a window into a larger 'canvas' on which the user can do things.
I'd like the scroll view to be as big as the window allows, with the slider underneath.
I've tried many things none of which work, in some cases when I resize the window smaller, the scroll view goes on up over the window's top bar, obscuring the title and the red yellow, green, dots.. this is just a grumble, I won't attempt to describe how I got it.
I'm working with Visual Format Language.
The immediate problem: I can only get the thing to work at all if I put in a hard size constraint on the scroll view.
I've got constraints like #"V:|[ScrollView]-[ZoomSlider(==35)]-| and
#"|-20#1000-[ScrollView]-|"
With these, nothing shows at all, until I put a hard size on the scroll view:
For example, #"V:[ScrollView(>=70#20)]" and #"[ScrollView(>=140#20)]" results in a little tiny scroll view (as expected) just above the slider.
Window is resizable, all right.
Is there a simple way to make the scroll view resize to occupy the most space possible when I resize the window? The only way I can think of off hand is to produce metrics for the scroll view based on window size, and use a notification to change the constraints when the window size changes. There should be something simpler!
THanks.ee
OOps. Thought I knew the answer until I started to write it.
AT least here is a partial explanation of things that were causing me problems.
You can't add constraints that position or size the Window's content view. But apparently you can mess them up by deleting them programatically. Some of my problems were solved by getting rid of
[self.myContentView setTranslatesAutoresizingMaskIntoConstraints:NO];
and
[self.myContentView removeConstraints:self.myContentView.constraints];
This left me with a lot of conflicting constraints. I fixed this be eliminating all content window constraints that I could in IB, then by marking the rest as placeholders.
I've got a ways to go before I understand how to use auto layout, but doing it in code is easier (for me) than doing it with IB

ckEditor autogrow usability

I am using CKeditor with autogrow plugin. But there is a problem when I am working with large text. I want to apply some style. So I need to scroll to the top of the page, click on the button and then scroll back to the bottom. This is very inconvenient.
Is there some plugin which can help to improve usability is such situations? Or I need to write it by myself?
I would limit the growth size to a maximum value with something like autoGrow_maxHeight : 800 - or whatever size works for you. I very much prefer the ckeditor content scrolling instead of the page scrolling.
Another option would be to separate the toolbar in a fixed element to make sure it always stays in sight. See http://nightly.ckeditor.com/7595/_samples/sharedspaces.html for an example; there is an editor there where the toolbar is statically visible and the editable area is apart from the toolbar.

GTK# - Problem with components overlapping upon resize

I have a panel containing a form (elements such as labels and textboxes within a table) and 3 buttons (in an hbuttonbox) at the bottom-right. If I shorten the panel by dragging the bottom border upwards, the 3 buttons come with it, and lay on top of the other form components, causing messy graphics. I would like the panel to not resize smaller than the bottom edge of the last component within it. Due to employer restrictions, I am not able to show a screenshot of the GUI. I will try to make any clarifications that are asked.
This probably has something to do with some resizing or general size settings on the components, but there are so many options that I'm not sure where to start.
Any ideas for an easy fix to this without getting down into the complicated nest of components? If not, any ideas on where I should start messing with settings?
Thanks!
UPDATE:
Everything is contained in a VBox with 3 cells. Elements in cells (top to bottom): Table, ScrolledWindow, HButtonBox. The ScrolledWindow bottom edge also moves (resizes) with the bottom edge of the panel when resizing, until the panel bottom goes above the whole ScrolledWindow. Then the buttons keep moving up, staying in relation to the panel's bottom edge.
By "form" do you mean you are using a Gtk.Fixed to contain your table and buttonbox? Then that's probably what's going wrong - you should use vboxes and hboxes for your layout. These will resize properly. Fixed layouts are only for exceptional cases.
EDIT:
Other suggestions:
Perhaps the HButtonBox has pack type 'end' instead of 'start'?
You could try playing with the 'fill' and 'expand' packing properties of the VBox's children.
I ended up adding a Height Request to the container, just slightly longer than the part of the scrolled window. This now stops resizing to where the bottom buttons would overlap the components above it. The problem (before the fix) is shown below:

Resources