buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
816 stars 122 forks source link

ComboEdit's EditLine not filling parent #568

Closed davidbruce closed 6 years ago

davidbruce commented 6 years ago

I was playing around with DmlEdit and noticed that editline inside of the combo box is not filling the parent:

image

This is happening on Solus Linux as well as Windows 10. From what I can tell it is using FILL_PARENT, so shouldn't it always fill?

https://github.com/buggins/dlangui/blob/master/src/dlangui/widgets/combobox.d

override protected Widget createSelectedItemWidget() {
        EditLine res = new EditLine("COMBOBOX_BODY");
        res.layoutWidth = FILL_PARENT;
        res.layoutHeight = WRAP_CONTENT;
        res.readOnly = false;
        _edit = res;
        postInit();
        //_edit.focusable = true;
        return res;
}
triplejam commented 6 years ago

It's because in order for the EditLine to fill it's parent, the ComboEdit must also fill it's parent (which it does not by default).

Either add 'layoutWidth: fill' to the ComboEdit or set it through your program ex: 'w.childById!ComboEdit("test").layoutWidth(FILL_PARENT)'

You can then play with the other properties in dml or in your program to get closer to what you want.

davidbruce commented 6 years ago

That worked, thank you!