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 705634 - add a style class for the clock label
add a style class for the clock label
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: 2013-08-07 18:43 UTC by Jonh Wendell
Modified: 2013-08-08 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (846 bytes, patch)
2013-08-07 18:45 UTC, Jonh Wendell
committed Details | Review

Description Jonh Wendell 2013-08-07 18:43:44 UTC
it's useful if we need to tweak only the clock's label css.
Comment 1 Jonh Wendell 2013-08-07 18:45:53 UTC
Created attachment 251098 [details] [review]
proposed patch
Comment 2 Ray Strode [halfline] 2013-08-08 17:35:01 UTC
Review of attachment 251098 [details] [review]:

probably okay

::: js/ui/dateMenu.js
@@ +52,3 @@
         this._clockDisplay = new St.Label();
         this.actor.add_actor(this._clockDisplay);
+        this.actor.add_style_class_name ('clock-display');

it's unusual in the shell code to use add_style_class_name unless you're going to remove_style_class_name later.  A more typical idiom for this type of thing would be:

this.actor.style_class = 'clock-display';
Comment 3 Ray Strode [halfline] 2013-08-08 17:35:31 UTC
(okay to push with that change)
Comment 4 Jonh Wendell 2013-08-08 17:45:38 UTC
that's the trick... We don't want to set one class for this item.

We want to add another class for it, so that other styles in the panel, or in the container be still applied.

notice that I'm not adding a class in the "this._clockDisplay" object. I'm adding it to "this.actor".

example:

all panel buttons on mouse over I want white:
.panel-button:hover {
    color: white;
}

and want the clock red, but still inherit mouse over of its parent:
.clock-display {
    color: red;
}

this works in my patch. if I do as you suggest, it doesn't work...
Comment 5 Ray Strode [halfline] 2013-08-08 18:15:20 UTC
Comment on attachment 251098 [details] [review]
proposed patch

fair enough
Comment 6 Jonh Wendell 2013-08-08 18:31:46 UTC
thanks, pushed to master.