After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609453 - Fix up notification layout for subclassing
Fix up notification layout for subclassing
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-09 19:11 UTC by Dan Winship
Modified: 2010-02-10 21:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[MessageTray] rename some fields (7.00 KB, patch)
2010-02-09 19:11 UTC, Dan Winship
committed Details | Review
[MessageTray] Provide more control over Notification layout (9.70 KB, patch)
2010-02-09 19:11 UTC, Dan Winship
committed Details | Review
fix to previous patch (1.48 KB, patch)
2010-02-10 20:15 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2010-02-09 19:11:25 UTC
This allows for subclassing Notification and providing different sorts
of layouts (eg, for chat)
Comment 1 Dan Winship 2010-02-09 19:11:27 UTC
Created attachment 153355 [details] [review]
[MessageTray] rename some fields

"fooText" suggests it might be a string, but it's actually an St.Label
Comment 2 Dan Winship 2010-02-09 19:11:31 UTC
Created attachment 153356 [details] [review]
[MessageTray] Provide more control over Notification layout

This will be used by, eg, the chat notifications
Comment 3 Marina Zhurakhinskaya 2010-02-09 23:16:50 UTC
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.
Comment 4 Dan Winship 2010-02-10 20:15:14 UTC
Created attachment 153463 [details] [review]
fix to previous patch
Comment 5 Marina Zhurakhinskaya 2010-02-10 20:40:09 UTC
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.
Comment 6 Marina Zhurakhinskaya 2010-02-10 20:41:15 UTC
Review of attachment 153463 [details] [review]:

This works! Good to commit squashed with the previous patch.
Comment 7 Dan Winship 2010-02-10 21:06:43 UTC
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