applets/notifications: fix body label implicit height and alignment
Reason for the change
Right now the body label's parent item always consumes space even when the label is hidden, causing the popup to be taller than it needs to be. In addition, the label doesn't actually end up top-aligned as intended when the popup's minimum height is taller than the height of the summary and body labels, causing unintentionally high visual spacing between them.
Fix these issues by making the body label's parent item fill the available height but become hidden when there's no body text.
Because that would leave a body-less notification with no mouse event listener for handling default actions, conditionally add one to the summary label when it's all alone. Positioning it on top of the summary label is fine because that text isn't mouse-selectable.
Test plan
notify-send foo;
notify-send foo bar;
notify-send foo "bar is my second favorite variable name and this needs text long enough to become multi-line, but not scrollable";
notify-send foo --icon edit-bomb;
notify-send foo bar --icon edit-bomb;
notify-send foo "bar is my second favorite variable name and this needs text long enough to become multi-line, but not scrollable" --icon edit-bomb;
notify-send --app-name "Pompous Windbag" --icon face-yawn "Well actually" "It is very important that you listen to what I have to say because I am very smart and I know what I am talking about. When I say something, it is guaranteed to be illuminating and insightful, no matter the topic. That is why I talk so often: to help you gain the benefits of my great wisdom, so that you too may begin the process of achieving some fraction of my great knowledge. I know that this is useful to you, and that is the reason why I continue to speak at length on a variety of topics.";
Screenshots or screen recordings
Popups | History view |
---|---|
![]() |
![]() |