Remove line under window header

EDIT: I´m sorry but it was totally just a dumb mistake on my behalf, a weird line of code had snuck in under another style initialization, but it edited the wrong style - my win header style. My bad!

As i understand the code it takes a set flag that may or may not describe the text alignment and translates that into how the text should be aligned right? How would I then set these flags? I tried to look in the docs, but couldn’t really find anything, and does it align the text in the parent? In this case the window header.

That’s correct.

These parts of LVGL are mostly undocumented. I’d like to change that but haven’t had time to actually write anything up yet.

I believe it aligns the text based on whatever bounding box you give it. Take a look at the way the label object calls the function; I think that would be a good example of how to use the flags.

Thank you very much, I took a look around in lv_win.c and lv_draw_label.c and got it figured by changing up the code in lv_win_header_design in lv_win.c but since its not a very good practice as it will be overwritten as soon as i update, I would like to know if could somehow set the bounds and flags used outside lv-win.c. Is that possible?

Hmm… I can think of three different solutions:

  • Override the changes outside of lv_win.c using a custom design callback.
  • Set up a local Git repository so that you can maintain your patches locally and merge in LVGL changes when they happen.
  • Send a pull request with the changes so they’ll be included in future LVGL releases.

I would gladly send a pull request but the thing is that i don’t fully understand the flags. Where do they get “set”? I tried to look through some of the code but I could only find places where they were being used and in lv_txt.c were they are declared. Is there a way to set these flags, and how does the code do it?

Here’s an example - you can see how the label options translate into flags.

I have now added the necessary extra attribute and code to make simple alignments. I have of course written the alignments as I felt was most suitable, but you guys should be the judges of that:

LV_TXT_FLAG_CENTER makes the text align in the center of the header but ensures it can’t overextend into to header button area;

LV_TXT_FLAG_RIGHT makes the text align at the right side, but takes the right side header buttons into account

LV_TXT_FLAG_FIT & LV_TXT_FLAG_EXPAND I wasn’t too sure about what to do so as of now it just aligns them as normal

LV_TXT_FLAG_NONE Is equal to no flag set by the user and therefore I have just set it to the default coords, like normal. The text then align at the left side.

My question is now how do i format and send this pull request? Shouldn’t I just send both the lv_win.c and lv_win.h since they are the two changed ones? Let me know if you are interested in including my changes

https://docs.lvgl.io/latest/en/html/contributing/index.html#pull-request

IMO it’s much easier to do from the command line, since you can make more changes easily, but up to you.

Done! I couldn’t really figure out how to do it but I think i managed it at last