So, I am working on a drag/drop editor.
My drawing surface is within a window, and is a transparent container. The issue I am having is the window size includes the chrome.
It would be nice if there was an easy way to get the size of the title bar (As it could be variable, depending on if a button is present, the font, etc).
For my situation, it ended up being:
// Width/Height is the size of my drawing surface that should completely
// encompass the window (The usable part, not the header)
lv_win_ext_t * ext = (lv_win_ext_t*)lv_obj_get_ext_attr(window);
int headerSize = ext->btn_size;
lv_obj_set_size(window, width + 4, height + headerSize);
So a couple of options…
- Have a method on window that computes the title bars coords, and another that computes the window’s coords
- Include the above in ext attr