I want to show/hide the menu icon (the 3 horizontal bars below) in the AppBar depending on the width of the screen. Is there a directive or a css class that makes this possible?
Fixed this by adding class "mdl-layout--small-screen-only" to the div containing the md-icon in mdl-layout.component.js.
Related
I have a Vaadin 8 application with several views.
public class ViewName extends Panel implements View {
There is a VerticalLayout as main layout in the panel.
public ViewName() {
setSizeFull();
VerticalLayout mainLayout = new VerticalLayout();
setContent(mainLayout);
Then I have many different layouts (HorizontalLayout, GridLayout) or Components such as Label being added as components to the mainLayout. For the HorizontalLayouts I often do the following to use the full width of the screen:
hLayout.setWidth("100%");
I have a lot of icons, grids etc. Everything is OK as long as I don't resize the window.
When I resize the window to a small size I get a mess (icons, text etc. on top of each other) and no horizontal scrollbar. (However, the grids get horizontal scrollbars.) I have tried many things to fix this. If I add
mainLayout.setSizeFull();
or
mainLayout.setWidth("100%");
I have a mess on the big screen already. I also tried the CSS for the mainLayout as described here. I get several scrollbars but none for the window itself!
The only component that resizes correctly is a Label added to the mainLayout, e.g.:
Label title = new Label("Some text",ContentMode.HTML);
title.setWidth(100, Unit.PERCENTAGE);
mainLayout.addComponent(title);
mainLayout.setComponentAlignment(title, Alignment.MIDDLE_CENTER);
I also noticed that anything in a GridLayout seems to stay in place after resizing but is not vissible since I have no scrollbar. However, icons in a HorizontalLayout get on top of each other.
What is wrong? Please, I need a general instruction on which layout I should use as main layout for my view panel, how to size the components and how to get ONE horizontal scrollbar for the main window if necessary.
The problem is that you are setting the width of your mainLayout to the width of your view. This means, that your mainLayouts width will never be bigger than your views width. So no scroll bar will appear.
According to the information you posted, changing your mainLayouts width to undefined should fix the problem.
mainLayout.setWidth("-1px");
Is there any way to make a widget's config and move buttons be placed at the top of the widget itself.
As it is one has to hover over a widget in order to see which one of the items in the widget zone it belongs to. This is impossible though when the content of the widget is not in the same screen space (I had to zoom out in the browser in order to get the below screenshot) unless you zoom out and then zoom back in.
In this image, there are 3 seperate widgets (red, white and green respectively) in a single widget zone.
Also, when the mouse leaves the widget the widget config/move buttons are no longer visible.
One solution is to right-click on the widget and then scroll up to the config wheel but this is not something I want to tell my editors they have to do.
Has anyone else come across this problem and if so, how did they solve it?
This can happen when you have CSS conflicts. You can use Chrome Inspector, Firebug, or IE developer tool to investigate and see if anthing is 'overlapping' those buttons (often a floating div is overlapping the buttons and intercepting the 'click')
Then once you figure out a css class to make it work, just add it to your style sheet with ".EditMode " before it, this is a special class that is on the body when in page editor.
Example:
.EditMode .MyFloatingDivThatsCoveringTheWidgets {
z-index: 0;
}
I have a UITabBar app that I build using xib in IB. In my view on IB, it has the bottom bar. In the following image, the bottom bar is just under the UIToolBar. It is under the toolbar, because I have no option to put it on top of the bar.
When I run the app, the toolbar appears in the middle of the screen as shown here. How can I fix that? I want it to be between the tab bar and the web view.
You need to set some Auto Layout constraints or an autoresizing mask in Interface Builder to tell your toolbar how to position itself.
Update: Assuming I understand what you're trying to do, try these constraints:
Web view: 0 distance from top and sides, (height of tab bar + toolbar) from bottom.
Toolbar: 0 distance from sides, default (or some constant) height, (height of tab bar) from bottom.
Tab bar: 0 distance from sides, default (or some constant) height, zero distance from bottom.
I have a QHBoxLayout, and it has 2 QVBoxLayouts on it one near the other.
Each layout has widgets, and I wonder how to make this layout resizable (the user can change the width) ?
Use a QSplitter. Create a couple of top-level container widgets for your vbox layouts, and then use the splitter's addWidget method to add the widgets to the splitter. The splitter's orientation is horizontal by default, so the vboxes will appear side by side.
There is a panel with anchor layout used for vertical sizing.
Inside the panel there is a horizontal buttongroup.
Is there a way to set fixed width or better make the width depend on buttons?
In my case it is always stretched to the size of the window.
There is the same problem with the grid inside the panel.
Thank you.
Making the width dependent on the buttons is handled by the layout itself. If you have an hbox layout, each of the items inside the container (say, buttons) will automatically occupy the width.