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 624381 - #panel to have a special class added when overview is active
#panel to have a special class added when overview is active
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.29.x
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-14 20:08 UTC by Jakub Steiner
Modified: 2010-08-20 10:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[panel] Add a style class while the overview is active (1.15 KB, patch)
2010-07-16 12:02 UTC, Florian Müllner
needs-work Details | Review
[panel] Add a style class while the overview is active (1.14 KB, patch)
2010-08-02 15:17 UTC, Florian Müllner
committed Details | Review

Description Jakub Steiner 2010-07-14 20:08:40 UTC
Would be nice for styling purposes to have the panel have a class added when the overview is visible.
Comment 1 Florian Müllner 2010-07-16 12:02:39 UTC
Created attachment 166019 [details] [review]
[panel] Add a style class while the overview is active

Designers have asked for the possibility to style the panel
differently in the overview.

Nothing fancy here - add .panel-overview style class while the overview is visible and remove it when it's hidden.
Comment 2 Dan Winship 2010-07-16 13:59:28 UTC
Comment on attachment 166019 [details] [review]
[panel] Add a style class while the overview is active

>+        Main.overview.connect('showing', Lang.bind(this, function () {
>+            this.actor.add_style_class_name('panel-overview');

I'm not a CSS guru, but it seems to me that this should be a pseudo-class? (It seems similar to "hover" and "focus".)

>+        Main.overview.connect('hiding', Lang.bind(this, function () {

You probably don't want to connect to that pair of signals. If the special style should only be in effect when the overview is fully visible, then you want to connect to 'shown' and 'hiding'. If you want it to be in effect when the overview is zooming in/out as well, then you want 'showing' and 'hidden'. ('showing' and 'hiding' means that the special style would be in effect when zooming into the overview, but not when zooming out of it.)
Comment 3 Florian Müllner 2010-07-16 16:34:41 UTC
(In reply to comment #2)
> I'm not a CSS guru, but it seems to me that this should be a pseudo-class? (It
> seems similar to "hover" and "focus".)

Uhm - not sure, I always thought of pseudo-classes as an expression of element state, not some external condition - but then note how that definition already doesn't match existing classes like :first-child/:last-child, so I insist on being less of a CSS guru than you :)

I'll update the patch accordingly.


> >+        Main.overview.connect('hiding', Lang.bind(this, function () {
> 
> You probably don't want to connect to that pair of signals. If the special
> style should only be in effect when the overview is fully visible, then you
> want to connect to 'shown' and 'hiding'. If you want it to be in effect when
> the overview is zooming in/out as well, then you want 'showing' and 'hidden'.
> ('showing' and 'hiding' means that the special style would be in effect when
> zooming into the overview, but not when zooming out of it.)

Right. I automatically assumed that it would use the transition-duration property to match the overview animation, in which case the transition-to-transition definition would be correct.

Maybe
 * :overview-active (from 'shown' to 'hiding')
 * :overview-transition (from 'showing' to 'shown'/ from 'hiding' to 'hidden')?

could cover both cases?
Comment 4 Owen Taylor 2010-07-16 17:00:44 UTC
(In reply to comment #2)
> (From update of attachment 166019 [details] [review])
> >+        Main.overview.connect('showing', Lang.bind(this, function () {
> >+            this.actor.add_style_class_name('panel-overview');
> 
> I'm not a CSS guru, but it seems to me that this should be a pseudo-class? (It
> seems similar to "hover" and "focus".)

The CSS pseudo-classes are all built into the spec - it's not a free-wheeling extensible set. So, for web programming, stuff like this is definitely a class not a pseudo-class.

We have a lot more flexibility, but I've sort of thought of pseudo-classes as being used for things that are more or less built-in to the widget, not about what our application is doing.
Comment 5 Dan Winship 2010-07-16 17:51:45 UTC
(In reply to comment #4)
> We have a lot more flexibility, but I've sort of thought of pseudo-classes as
> being used for things that are more or less built-in to the widget, not about
> what our application is doing.

Hm... and my theory was that style class is for identifying "type" ("this is a menu", "this is a notification popup"), and pseudo classes are for identifying a particular state within that type.

see also bug 612605
Comment 6 Owen Taylor 2010-07-16 18:13:15 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > We have a lot more flexibility, but I've sort of thought of pseudo-classes as
> > being used for things that are more or less built-in to the widget, not about
> > what our application is doing.
> 
> Hm... and my theory was that style class is for identifying "type" ("this is a
> menu", "this is a notification popup"), and pseudo classes are for identifying
> a particular state within that type.

I suspect the main reason for the separation between pseudo-class and class in CSS is one of namespacing. If there was no separate syntax for pseudo-classes, then the set of pseudo-classes would be fixed for all time, because if a new version of CSS added new pseudo-classes, it could break existing web pages.

In this interpretation, :focus is a shorthand for '.org-w3c-focus'

I'm not sure the world breaks down into type and state cleanly enough to make that interpretation useful. Certainly a few of the standard pseudo-classes are only partly state (I'm thinking of :first-child.)
Comment 7 Owen Taylor 2010-08-01 11:49:17 UTC
Review of attachment 166019 [details] [review]:

I think this is fine this way with the style class. 

('panel-overview' is just a bit odd to me - it sort of implies that it's the  overview inside the panel or something. I can't think of that much that is better though - one approach would be to make it simply .in-overview, so you can do .panel.in-overview - is that better?)
Comment 8 Florian Müllner 2010-08-01 12:37:56 UTC
(In reply to comment #7)
> I think this is fine this way with the style class.

Hmmm, but what about Dan's comment about the signals used? It is pretty odd to include the transition to the overview, but not the transition from the overview (even if it's very convenient for transitions)

 
> one approach would be to make it simply .in-overview, so you
> can do .panel.in-overview - is that better?)

Yes.
Comment 9 Owen Taylor 2010-08-02 14:47:45 UTC
Comment on attachment 166019 [details] [review]
[panel] Add a style class while the overview is active

(In reply to comment #8)
> (In reply to comment #7)
> > I think this is fine this way with the style class.
> 
> Hmmm, but what about Dan's comment about the signals used? It is pretty odd to
> include the transition to the overview, but not the transition from the
> overview (even if it's very convenient for transitions)

Ah, missed that part of the comment. Yeah, I agree with Dan 100% on that.
Comment 10 Florian Müllner 2010-08-02 15:17:52 UTC
Created attachment 166985 [details] [review]
[panel] Add a style class while the overview is active

(In reply to comment #9)
> Ah, missed that part of the comment. Yeah, I agree with Dan 100% on that.

OK.
Comment 11 Florian Müllner 2010-08-20 10:07:45 UTC
Attachment 166985 [details] pushed as c18ff91 - [panel] Add a style class while the overview is active