GNOME Bugzilla – Bug 609453
Fix up notification layout for subclassing
Last modified: 2010-02-10 21:06:52 UTC
This allows for subclassing Notification and providing different sorts of layouts (eg, for chat)
Created attachment 153355 [details] [review] [MessageTray] rename some fields "fooText" suggests it might be a string, but it's actually an St.Label
Created attachment 153356 [details] [review] [MessageTray] Provide more control over Notification layout This will be used by, eg, the chat notifications
Review of attachment 153355 [details] [review]: Looks good. Maybe a better reason message is: "fooText" suggests it might be a string, but it's actually an St.Label, so it should be named accordingly.
Created attachment 153463 [details] [review] fix to previous patch
Review of attachment 153356 [details] [review]: Looks great! Good to commit with small fixes mentioned below and the patch that fixes notifications in which no summary is initially shown. ::: js/ui/messageTray.js @@ +147,3 @@ + let meta = this.actor.get_child_meta(children[i]); + if (meta.row == props.row && meta.col == props.col) { + for (let i = 0; i < children.length; i++) { Maybe this would be cleaner as two separate loops, with one determining that there is a conflicting child and another one moving the rows over if necessary. This way you'll also avoid reuse of 'i' and 'meta' variables which makes the code somewhat confusing. @@ +160,3 @@ + this.actor.get_child_meta(this._actionBox).row++; + } else + props.row = this.actor.row_count; I think it's cleaner to use {} in both parts of the if-else statement, if you have to use it in one of the parts.
Review of attachment 153463 [details] [review]: This works! Good to commit squashed with the previous patch.
updated and pushed Attachment 153355 [details] pushed as 7642040 - [MessageTray] rename some fields Attachment 153356 [details] pushed as d27f19a - [MessageTray] Provide more control over Notification layout