GNOME Bugzilla – Bug 682738
Don't auto-expand notifications
Last modified: 2015-02-26 22:51:52 UTC
If a notification has widgets (such as actions, images or entries), it's always shown expanded. What's more awkward, there is still the truncated body next to the title, and it disappears when you mouse over. git bisect tells me it's a regression from 6f8e7f07f3c0ae38acda81eb05d8f28aab3c35d5, which incorrectly assumed that before calling .expand(), the height of a notification would include only the banner.
(In reply to comment #0) > If a notification has widgets (such as actions, images or entries), it's always > shown expanded. What's more awkward, there is still the truncated body next to > the title, and it disappears when you mouse over. > > git bisect tells me it's a regression from > 6f8e7f07f3c0ae38acda81eb05d8f28aab3c35d5, which incorrectly assumed that before > calling .expand(), the height of a notification would include only the banner. I would like for that to be a correct assumption. Can we make it so?
Created attachment 222489 [details] [review] MessageTray: clamp unexpanded notification height The height of an unexpanded notification could include expanded content if the notification has extra widgets (like actions and images), so tweening to that cause it to expand visually. Instead, use the height of the message tray before the restyle as an upper bound.
(In reply to comment #1) > (In reply to comment #0) > > If a notification has widgets (such as actions, images or entries), it's always > > shown expanded. What's more awkward, there is still the truncated body next to > > the title, and it disappears when you mouse over. > > > > git bisect tells me it's a regression from > > 6f8e7f07f3c0ae38acda81eb05d8f28aab3c35d5, which incorrectly assumed that before > > calling .expand(), the height of a notification would include only the banner. > > I would like for that to be a correct assumption. Can we make it so? It's not this simple: it means that either you override get_preferred_height() (evil and hackish), or that you delay adding the actors until the notification is shown (hard for libnotify, not really possible for telepathy)
Couldn't you just hide the buttons/widgets until the notification is expanded?
(In reply to comment #4) > Couldn't you just hide the buttons/widgets until the notification is expanded? I'm an idiot... I'll prepare a patch.
(In reply to comment #5) > (In reply to comment #4) > > Couldn't you just hide the buttons/widgets until the notification is expanded? > > I'm an idiot... > I'll prepare a patch. No, turns out that you can't: even if the actors inside the table are hidden, you still get the row spacing and extra padding at the bottom.
Created attachment 222493 [details] [review] MessageTray: hide notification contents when not expanded Hide the contentArea, actionArea and imageBin when the notification is not expanded. This way the height of the notification actor corresponds exactly to the banner. For future record, not for review. This is the best I got so far.
Created attachment 222497 [details] [review] MessageTray: clamp unexpanded notification height The height of an unexpanded notification could include expanded content if the notification has extra widgets (like actions and images), so tweening to that cause it to expand visually. Instead, use the height of the message tray before the restyle as an upper bound. This time using CSS, and forcing notificationStackWidget.height to do the right thing.
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > Couldn't you just hide the buttons/widgets until the notification is expanded? > > > > I'm an idiot... > > I'll prepare a patch. > > No, turns out that you can't: even if the actors inside the table are hidden, > you still get the row spacing and extra padding at the bottom. That seems like an StTable bug.
Created attachment 222498 [details] [review] st-table: Don't add spacing for zero-height rows/columns If we hide an entire row/column, we shouldn't see a blank bit of spacing surrounding the row/column. Try this out for size.
No way, rhythmbox notifications are still half expanded.
Review of attachment 222497 [details] [review]: This is fine for now if we can't get the other thing done in time.
Comment on attachment 222497 [details] [review] MessageTray: clamp unexpanded notification height Attachment 222497 [details] pushed as f96dcac - MessageTray: clamp unexpanded notification height Have fun getting it right.
I'm pretty sure that we dropped actions and images with the new notifications design, and banners with entries aren't auto-expanding for me - closing as obsolete. Feel free to reopen if I got it wrong.