Skip to content

Stop scrollview from consuming the interface #715

Description

@rnd-ash

My application has a main UI page which is broken down into 2 parts:

  1. main interface which can change
  2. Bottom status bar which is permanently on screen

With the UI with explain enabled, you can see this:
image

Under log view in this image is a scrollview. Below that is a space followed by the status bar. It is drawn like so:

let mut c: Element<_> = Column::new()
                .push(view_contents) // Draw the custom view on screen
                .push(Space::with_height(Length::Fill)) // Pad the gap
                .push(Rule::horizontal(1)) // Draw a line
                .push(s_bar) // Draw the status bar
                .into();
if themes::is_debug() {
    c = c.explain(iced::Color::BLACK);
}
container(c)
    .height(Length::Fill)
    .width(Length::Fill)
    .into()

however, when I keep adding elements to the scrollview, this eventually happens:
image

Here, the scrollview has completely consumed the interface.

How would it be possible to stop this behavior?. I don't want to use the max_height function on the scrollview as i still want the entire UI to be adaptive according to the window size rather than creating a hard limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayoutquestionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions