Flutter: Scrollable content to go underneath a blurred widget - flutter-layout

I'm trying to build a screen where there is a fixed widget at the top of the screen and another widget which is fixed to the bottom of the screen and in between is a scrollable widget.
I want to have the content inside the scrollable widget scroll underneath the two fixed widgets (both with a transparent blur), to indicate that there is more content underneath.
Here is an image of what I am trying to do.
I am currently using a Stack for this, however I am having to manually adjust the padding in the SingleChildScrollView to offset for the top and bottom widgets, but I would like to have this be much more flexible and have the widgets be any size and not have to update the padding.
I've found other examples where the bottom widget is part of the scrollable content but that isn't quite what I am looking for.
Does anyone know of a way to do this, without having to manually provide the padding?

Related

Layout management inside Cairo DrawingArea/Context?

I have a window in mono gtk#, which has lot of VBoxes & HBoxes. These boxes contain some buttons, labels, and some other widgets also. Now I need to make this window alone to transparent.
I created one drawingArea by referring zetcode page.
But inside this drawing area I'm not able to do the arrangements of my widgets, one Move function is available, but it is not much use for me. So how do I do widget arrangement neatly inside a drawingArea?

Vaadin 8 View: No horizontal scrollbar on window resizing

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");

How to track the bottom of a frame when used on a canvas with a scrollbar?

I implemented the code from this solution:
Adding a scrollbar to a group of widgets in Tkinter
I use it basically as a console displaying messages etc.
I need the same effect as for the text widget using
self.textwidget.see(END)
Meaning the frame would follow the widget on the bottom.
I tried using focus() on the bottom widget, but that didn't work and made it look really wierd.
SIDE NOTE:
In Bryan Oakley's solution when scrolling the widgets they bleed over the canvas. To fix it place the canvas into another frame which has the same size.
In his solution it can't be seen too well, but using let's say sunken relief it is truly disturbing. Also then use the relief on the outer frame not the canvas.
Call the yview_moveto method of the canvas. It takes an argument which represents what percentage of the widget should be at the top of the window. The value 1.0 guarantees that the bottom of the scrollable canvas will be in view.
the_canvas.yview_moveto(1.0)
Note that this only works after the event loop has had a chance to render the items on the screen (ie: you can't call this immediately after adding things to the frame, unless you explicitly call update)

How to organise QWidgets into a mosaic?

I would like to create a Qwidget with a large number of square QPushButtons. I would like those buttons to be organised into a mosaic layout. Whenever the window is resized, the mosaic widget should be resized and the buttons re-ordered accordingly to fill in the width. Buttons that cannot fit within the area, can be viewed by scrolling the widget vertically.
Is there a Qt4 Layout that allows me to do this easily? What is the best / easiest way to achieve this? Thanks.
You could use the flow layout (from Qt examples) inside a resizable QScrollArea.
Use a QGridLayout in a QScrollArea.

QtDesigner - adding splitter layouts to larger layouts

I'm new to Qt Designer, and I am working on a main window where I want to have two list widgets off to the right, laid out in a vertical splitter, and then a larger text browser widget to the left, which is then itself in a splitter with the list widgets. So the relative sizes of the list widgets can be resized vertically, and the horizontal space between the text browser and the other two widgets can also be resized.
I tried first laying out the two widgets on the right in a vertical splitter, and then selecting the layout, like so:
The problem is, now that the two list widgets are in the splitter layout, I can't then add that layout to any other larger layouts. All the options appear grayed out. If I just do a standard horizontal or vertical layout, it is possible to then make larger layouts out of smaller ones. So how is this to be done when using splitter layouts? Thanks!
Look's like you are selecting two ListWidgets instead splitter. To combine layouts you need to select one splitter which contains ListWidgets and then TextBrowser. In this case Lay Out Horizontaly in splitter will be available.
Here video demonstration (1.25 MB)

Resources