Skip to content

PopupWindow does not resize to the content size / respond to binding on x,y #6000

@ghost

Description

I have started with the implementation of this #5917. If you start the time picker in the edit mode, what needs less space and then you toggle selection mode with the clock what needs more space, you see that the content of the popup is resized correctly but not the PopupWindow itself. That prevents e.g. from interaction of buttons that are now outside of the origin size of the popup.

Tested with winit backend on Linux

Minimal example:

import { Button, VerticalBox, HorizontalBox } from "std-widgets.slint";
export component Demo {
    in-out property <bool> show-buttons;

    width: 600px;
    height: 400px;

    Button {
        text: "Show popup";

        clicked => {
            popup.show();
        }
    }

    popup := PopupWindow {
      
        close-on-click: false;
         
        content := Rectangle {
            border-width: 1px;
            border-color: black;
            background: green;
        

          VerticalBox {
                if root.show-buttons : HorizontalBox {
                    Button {
                        text: "Button top"; 
                    }

                    Button {
                        text: "Button top"; 
                    }

                    Button {
                        text: "Button bottom"; 
                    }
                }

                Button {
                    text: "Show buttons";

                    clicked => {
                        root.show-buttons = true;
                    }
                }

                if root.show-buttons : HorizontalBox {
                    Button {
                        text: "Button bottom"; 
                    }

                    Button {
                        text: "Button bottom"; 
                    }

                    Button {
                        text: "Button bottom"; 
                    }
                }
            }
          
        }
    }
}

Metadata

Metadata

Assignees

Labels

a:builtin elementsThe runtime data structures related to the items (mO,bT)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions