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 644788 - Style expanded summary-sources
Style expanded summary-sources
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marina Zhurakhinskaya
gnome-shell-maint
Depends on: 644361
Blocks:
 
 
Reported: 2011-03-15 05:09 UTC by Jonathan Strander
Modified: 2011-03-22 01:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Style expanded summary-sources (3.54 KB, patch)
2011-03-15 05:10 UTC, Jonathan Strander
none Details | Review
Style-expanded-summary-sources (3.56 KB, patch)
2011-03-15 23:10 UTC, Jonathan Strander
none Details | Review
message-tray: Add :expanded pseudo class to summary buttons (1.63 KB, patch)
2011-03-16 19:01 UTC, Florian Müllner
none Details | Review
message-tray: Add :expanded pseudo class to summary buttons (1.17 KB, patch)
2011-03-16 19:55 UTC, Florian Müllner
none Details | Review
MessageTray: style summary sources (5.67 KB, patch)
2011-03-21 03:05 UTC, Marina Zhurakhinskaya
needs-work Details | Review
StThemeNode: support border-image: none (1.12 KB, patch)
2011-03-21 04:06 UTC, Owen Taylor
committed Details | Review
Add source-button-border (3.46 KB, patch)
2011-03-21 06:37 UTC, Jonathan Strander
none Details | Review
Add source-button-border (2.76 KB, patch)
2011-03-21 06:40 UTC, Jonathan Strander
needs-work Details | Review
MessageTray: style summary sources (8.17 KB, patch)
2011-03-22 01:33 UTC, Marina Zhurakhinskaya
none Details | Review
MessageTray: style summary sources (8.17 KB, patch)
2011-03-22 01:37 UTC, Marina Zhurakhinskaya
none Details | Review
MessageTray: style summary sources (8.19 KB, patch)
2011-03-22 01:45 UTC, Marina Zhurakhinskaya
committed Details | Review

Description Jonathan Strander 2011-03-15 05:09:29 UTC
Per bug 644361 this is the second part of the new tray styling.

Florian Muellner is working on a patch to add the method :expanded to summary-sources which will allow us to style summary-sources when they are (obviously) expanded. With this style it (should) give the user the same feedback they experience when using the panel.
Comment 1 Jonathan Strander 2011-03-15 05:10:09 UTC
Created attachment 183403 [details] [review]
Style expanded summary-sources

When items in the message tray are expanded there
is no feedback from the summary-source. Add a style
to summary-sources which matches them to their
counterpart action in the panel.
Comment 2 Jonathan Strander 2011-03-15 23:10:56 UTC
Created attachment 183478 [details] [review]
Style-expanded-summary-sources

Fixed author and contact information.
Comment 3 Florian Müllner 2011-03-16 19:01:06 UTC
Created attachment 183564 [details] [review]
message-tray: Add :expanded pseudo class to summary buttons

In order to make it more obvious to users that the entire summary
item is clickable (rather than just its icon), it makes sense to
style expanded summary items differently. Add an :expanded pseudo
class to make this possible.
Comment 4 Florian Müllner 2011-03-16 19:55:16 UTC
Created attachment 183567 [details] [review]
message-tray: Add :expanded pseudo class to summary buttons

Add an :expanded pseudo class which allows styling summary buttons
differently while the corresponding notication is popped out.
Comment 5 Jonathan Strander 2011-03-20 06:18:11 UTC
Looking over this again quickly, Florian, I think to get the effect perfect there has to be 2 pseudo classes.

When we've got a notification expanded but the summary-source is collapsed to its smallest state we run into the problem of the aspect for the background glow needing to be the narrow version. So we need to know

a) am I (where I is the summary-source) expanded?
b) is my summary-notification expanded/showing?


So we should if possible have something like:
.summary-source-button:title_expanded
.summary-source-button:notification_expanded {
    border-image: url("source-button-border.svg") 10 10 0 1;
}
.summary-source-button:title_expanded {
    background-image: url("panel-button-highlight-wide.svg");
}
.summary-source-button:notification_expanded {
    background-image: url("panel-button-highlight-narrow.svg");
}

Where title_expanded supersedes notification_expanded (so that we always show the correct-aspect graphic). Would this be possible?
Comment 6 Jonathan Strander 2011-03-20 06:20:19 UTC
Forgot to Note: b would have to be true for _expanded to be true, as it is now, just that now we can also know if the summary-title itself is showing or not.
Comment 7 Marina Zhurakhinskaya 2011-03-21 03:05:14 UTC
Created attachment 183892 [details] [review]
MessageTray: style summary sources

Make summary sources look more clickable and highlight them when selected.
Highlighting the fully expanded summary source when selected matches the
highlighting in the top bar items and teaches the user that any part of the
expanded summary source can be clicked.

Based on the initial patches by Florian Müllner and Jonathan Strander.

----------------------

I've merged the three relevant patches in this one since there were some
changes I was testing and ended up with a patch that was easier to attach
than describe :).

1) It seems that handling border-image "none" is not implemented in
st-theme-node.c . It needs to be implemented similarly to how it is implemented
for setting background-image to "none". This patch depends on that functionality
being there.

2) I removed keeping the summary item text gray when it is not hovered over
because the only time it is visible is when you hover to the left of the
left-most item, and I think it is odd and distracting.

3) The highlight of just the icon was asymmetric because, for example, in LTR
locales it was getting 4px padding on the left and 16px padding on the right.
I moved the symmetric padding to summary-source, so that we can just highlight
summary-source when only the icon is showing. It's better to highlight
summary-source-button when the title is showing because that indicates the
full area that is clickable and titles might have some padding on the right
anyway because we use the length of the longest title for all of them.
Indicating the full area that is clickable when only the icon is showing is not
important because as soon as you hover over it, it expands to show the title.

4) I had to set y_fill to true for summary-source-button so that the bottom
border for summary-source would still be on the bottom of the screen. Then I had
to set y_fill to false when adding source-title-bin and explicitly set its
height to be the same as the height of the icon so that the second line of the
title that is wrapped as the title expands is not visible. (This is a known
Clutter bug that Pango.EllipsizeMode.NONE we set is ignored.)

5) I used "selected" pseudo class to mean that the summary notification is
popped up and "expanded" pseudo class to mean that the title is showing. I moved
adding "selected" pseudo class to _showSummaryBoxPointer() from
_onSummaryBoxPointerExpanded() because it needs to apply both when the summary
notification is shown and when the right click menu is shown.

6) As suggested by Jonathan in his last two comments, I used
background-image: url("panel-button-highlight-narrow.svg");
for when just the icon is being shown. The highlight is a little
more noticeable that way.
Comment 8 Marina Zhurakhinskaya 2011-03-21 03:23:33 UTC
I also noticed that this patch causes the following errors:

(lt-gnome-shell-real:19000): Cogl-glx-CRITICAL **: cogl_object_unref: assertion `object != NULL' failed

(lt-gnome-shell-real:19000): St-CRITICAL **: _st_paint_shadow_with_opacity: assertion `shadow_material != COGL_INVALID_HANDLE' failed

This happens due to just one line that specifies the text-shadow for summary-source-button .
Comment 9 Jasper St. Pierre (not reading bugmail) 2011-03-21 03:31:26 UTC
Indeed, this is because Cogl won't allocate a 0x0 texture, and we don't check the return value for errors.
Comment 10 Owen Taylor 2011-03-21 04:05:25 UTC
(In reply to comment #7)
> 1) It seems that handling border-image "none" is not implemented in
> st-theme-node.c . It needs to be implemented similarly to how it is implemented
> for setting background-image to "none". This patch depends on that
> functionality
> being there.

This turned out to be easy. Will attach a patch.
Comment 11 Owen Taylor 2011-03-21 04:06:20 UTC
Created attachment 183906 [details] [review]
StThemeNode: support border-image: none

Treat border-image: none as a valid specification that overwrites any
previously specified border image.
Comment 12 Jonathan Strander 2011-03-21 05:51:58 UTC
"source-button-border.svg" wasn't included in your patch Marina.
Comment 13 Jonathan Strander 2011-03-21 06:37:35 UTC
Created attachment 183911 [details] [review]
Add source-button-border

To make summary-sources match other UI in Shell
add a border-image.




----

There. Feel free to squash it as part of the overall patch.
Comment 14 Jonathan Strander 2011-03-21 06:40:03 UTC
Created attachment 183912 [details] [review]
Add source-button-border

Woops. This is the real patch. The other was from an older revision of this bug's codebase.
Comment 15 Florian Müllner 2011-03-21 13:15:46 UTC
Review of attachment 183906 [details] [review]:

Looks correct.
Comment 16 Owen Taylor 2011-03-21 13:17:56 UTC
Comment on attachment 183906 [details] [review]
StThemeNode: support border-image: none

Attachment 183906 [details] pushed as adbc1d9 - StThemeNode: support border-image: none
Comment 17 Florian Müllner 2011-03-21 18:30:24 UTC
Review of attachment 183892 [details] [review]:

Some general observations:
 - :expanded is set when the item starts expanding
   and unset when it finished contracting
   (notable as the wide background image behaves
    ugly while expanding)

 - not sure about :selected - maybe :active as in the panel?
   (no strong opinion though, your call)

Other than that, looks fine to me.
(Oh, and I think it makes sense merging the other patch, we
 usually add images when we start using them)

::: data/theme/gnome-shell.css
@@ +972,3 @@
     background-gradient-direction: vertical;
     background-gradient-start: rgba(0,0,0,0.01);
+    background-gradient-end: rgba(0,0,0,0.82);

Unrelated, but probably not worth splitting out to a separate commit.

@@ +1200,3 @@
+
+.source-title-bin {
+    height: 24px;

Why is this necessary? I compared screenshots with and without that class, and I can't spot any difference.
Comment 18 Florian Müllner 2011-03-21 18:32:55 UTC
Review of attachment 183912 [details] [review]:

The image needs to be added to data/Makefile.am.
Comment 19 Florian Müllner 2011-03-21 19:28:18 UTC
Review of attachment 183892 [details] [review]:

Another issue I just noticed:

(lt-gnome-shell-real:14302): Cogl-glx-CRITICAL **: cogl_object_unref: assertion `object != NULL' failed

(lt-gnome-shell-real:14302): St-CRITICAL **: _st_paint_shadow_with_opacity: assertion `shadow_material != COGL_INVALID_HANDLE' failed
Window manager warning: Log level 16: value "-nan" of type `gfloat' is invalid or out of range for property `y' of type `gfloat'

(repeated ad infinitum)

My guess is that this is caused by text-shadows for labels with a width of 0.
Comment 20 Marina Zhurakhinskaya 2011-03-22 01:33:45 UTC
Created attachment 184026 [details] [review]
MessageTray: style summary sources

Make summary sources look more clickable and highlight them when selected.
Highlighting the fully expanded summary source when selected matches the
highlighting in the top bar items and teaches the user that any part of the
expanded summary source can be clicked.

Based on the initial patches by Florian Müllner and Jonathan Strander.

Pseudo class 'active' is set on buttons when they are pressed, so it
was really not a good idea to replace 'selected' with that :). That's
what caused flickering of the tray icon items.
Comment 21 Marina Zhurakhinskaya 2011-03-22 01:37:21 UTC
Created attachment 184027 [details] [review]
MessageTray: style summary sources

small fix
Comment 22 Marina Zhurakhinskaya 2011-03-22 01:45:12 UTC
Created attachment 184028 [details] [review]
MessageTray: style summary sources

Add y_fill: false when adding an icon.
Comment 23 Florian Müllner 2011-03-22 01:50:00 UTC
Review of attachment 184028 [details] [review]:

Looks good!