@Helga, I realize this post is over 2 years old, but i just came across it and it turned out to be the key to solving a related issue. My situation was that my popup was too wide on phones and it truncated the right edge, including part of the close button. Your code made the button fully visible but the right edge was still cut off. The obvious solution of course would be to make the widget narrower, but doing so caused line wrap, which spoiled the layout. After some experimentation, I ended up with the code below: