py_cui icon indicating copy to clipboard operation
py_cui copied to clipboard

Widget height inconsistency

Open PabloLec opened this issue 3 years ago • 1 comments

I just noticed something some "style inconsistency" regarding widget heights. Let's say I want to create a form, and add these widgets:

self.master.add_text_box(
    title="Save Path",
    row=0,
    column=1,
    row_span=1,
    column_span=8,
    padx=0,
    pady=0,
)
self.master.add_button(
    "Save",
    row=1,
    column=8,
    row_span=1,
    column_span=1,
    padx=0,
    pady=0,
    command=None,
)

Result looks like:

recoverpy_example

Which obviously does not look right. Tinkering with size and padding can't solve it.

I opened an issue because I'm not quite sure about how to solve this. I've not experienced this with other widgets, but here clearly this has to do with button height, which takes the the whole row height and other widgets, like Button, does not. Maybe we could find a way to take float height params, or just make another narrower button widget. Any thoughts?

PabloLec avatar Oct 09 '21 10:10 PabloLec

This issue is actually related to https://github.com/jwlodek/py_cui/issues/91 . Basically, the way the textbox is currently drawn is that it starts with the textbox title in the center and draws down. This causes the whole widget to appear to be a line lower than it should. The slider has been adjusted to allow for alignment to top/middle/bottom, we just need to do the same for the textbox widget

jwlodek avatar Oct 10 '21 01:10 jwlodek