I am currently designing an extension. In my extension, I try to expand the notifications in the notification list. My goal is to fully expand the notification. Hence, I need a way to calculate the number of lines of the given text in the notification. I would like to use Pango for this. Here is what I have tried:
let pangoLayout = this._expandedLabel.clutter_text.create_pango_layout(this._bodyText); pangoLayout.set_height(this._bodyStack.get_height()); pangoLayout.set_width(this._bodyStack.get_width()); log("Line Count: " + pangoLayout.get_line_count());
These lines are called inthe expand() function of the class Message. However, this returns the amount of words in the given text, instead of the number of lines. I have tried several functions given in the docs, but did not find a way to get the correct number of lines. Is anyone familiar with Pango and can help me? Or knows of a different solution?
Thanks in advance!