Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to align widget #637

Open
FabArd opened this issue Nov 14, 2022 · 3 comments
Open

How to align widget #637

FabArd opened this issue Nov 14, 2022 · 3 comments

Comments

@FabArd
Copy link

FabArd commented Nov 14, 2022

Hi,

How to align the "send" button on the right side of the "MDI" groupbox ?
All my attempts have been unsuccessful !
Thanks.

DmlEdit

GroupBox {
    text: "MDI"
    TextWidget {text: "Manual Command"}  
    EditLine {layoutWidth: 350}
    HorizontalLayout {
        Button {text: "Send"}
    }
}
@GrimMaple
Copy link
Collaborator

Hi! I would suggest creating an empty widget that takes all the extra space, eg:

GroupBox {
    maxWidth: 500px
    text: "MDI"
    TextWidget {text: "Manual Command"}
    EditLine {layoutWidth: 350}
    HorizontalLayout {
        VerticalLayout { layoutWidth: fill; minWidth: 10% }
        Button {text: "Send"}
    }
}

Note the extra "maxWidth" in the GroupBox. Without it, the widget becomes very long for some reason

@FabArd FabArd closed this as completed Nov 15, 2022
@FabArd FabArd reopened this Nov 15, 2022
@FabArd
Copy link
Author

FabArd commented Nov 15, 2022

You have enabled me to find another solution :

GroupBox {
    text: "MDI"
    TextWidget {text: "Manual Command"}  
    EditLine {layoutWidth: 350}
    HorizontalLayout {
        HSpacer {layoutWidth: fill; minWidth: 350 }
        Button {text: "Send"}
    }
}

@FabArd
Copy link
Author

FabArd commented Nov 15, 2022

I think the best solution is :

GroupBox {
    text: "MDI"
    TextWidget {text: "Manual Command"}  
    EditLine {layoutWidth: 350}
    HorizontalLayout {
        layoutWidth: fill
        HSpacer {layoutWidth: fill }
        Button {text: "Send"}
    }
}

This solution do not modify the "EditLine" dimension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants