Window Dimesnsions

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…

  1. Have a method on window that computes the title bars coords, and another that computes the window’s coords
  2. Include the above in ext attr

It’s really not trivial. I’ve added lv_win_set_content_size to dev-6.1.

Thank you for the quick response, also in the future I may put these feature requests in. If you think they are a good idea I will do them myself and kick a pr

In the end, we accept nearly every PR that gets opened, so feel free to add whatever you like!

You said its not trivial? Seemed to only have a few lines.

When @kisvegabor says “trivial”, he usually means a single function call, or at most two. :wink:

1 Like

I said it’s not trivial mainly because it can’t be done with the current public API. (lv_win_ext_t needed to be involved)