Ticket #122 (enhancement)

Opened 1 year ago

Last modified 1 year ago

Allow changing urgency and background colors, opacity et. al. via GConf

Status: new

Reported by: abock Assigned to: chipx86
Priority: normal Milestone:
Component: notification-daemon Version:
Severity: normal Keywords:
Cc: D-BUS Version:
Patch Included: 1 OS/Distro Version:

Currently for distributions to change "branding" of the standard notification theme, they must apply a patch against theme.c to change the colors.

The following settings should be configurable via GConf so distributions can use the core functionality of the standard theme but tweak its looks:

Urgency colors, Background color, Opacity level, Visibility of the close button, Use of gradients, Width of the notification bubble

In SLED we have a patch that sets the urgency colors to values from Tango, we remove the close button (for a reason I'm not really sure of, but it was a decision from our usability and design team), and it looks like we also reduce the width of the bubble slightly. While I like the new opacity support, it should be able to be turned off (setting to 1.0).

I've got a patch to address all of this. It will allow distributions to change these common settings by simply providing a different schema file.

Additionally, the patch addresses a number of minor Cairo rendering and calculation bugs.

Depending on the reception of this patch, some of these things may need to be broken down into smaller patches, but I figured I'd post the whole thing first. It is my opinion that all the functionality in the patch is fully applicable for upstream (as were my intentions), is generic, provides sane defaults, and should benefit anyone shipping and using notification-daemon.

Attachments

notify-standard-theme-love.diff (20.9 kB) - added by abock on 02/28/07 21:38:39.
The big bad patch
notify-standard-theme-love.txt (3.1 kB) - added by abock on 02/28/07 21:42:10.
Standalone version of the summary and patch overview because Trac mangled my bullets!

Change History

02/28/07 21:38:39: Modified by abock

  • attachment notify-standard-theme-love.diff added.

The big bad patch

02/28/07 21:42:10: Modified by abock

  • attachment notify-standard-theme-love.txt added.

Standalone version of the summary and patch overview because Trac mangled my bullets!

02/28/07 21:43:35: Modified by abock

I've also blogged about the patch. A screenshot and screencast are available which demo the functionality:

http://abock.org/2007/03/01/notification-theme-love/

03/01/07 06:03:51: Modified by MattW

There's a graphical problem with this patch. Because of the way the theme draws the countdown pie seen on notifications with actions, the gradient's all mucked up in there. If the bottom gradient's turned off, the problem doesn't happen because you can't tell the two differently-drawn areas of background apart.

This is admittedly my fault, but I never noticed it because I always patch the bottom gradient out, I just happened to notice it while playing around with this patch (and wondering if you'd put in an option to turn off the bottom gradient).

03/01/07 06:29:27: Modified by MattW

Also for some reason the GConf schema isn't installing for me, but I know next to nothing about GConf and have no idea what's going on. It seems to install to /usr/etc/gconf/schemas, where there isn't anything else at all. I asked gconftool-2 to install it for me so I could play around for the time being.

A border colour preference might be nice. I really liked the old black border, rather than drawing it in stripe colour. On my system a standard notification comes up with a blue border, and that just looks odd.

Background colour settings demand text colour settings really - somebody's going to want a black background, and then they won't be able to see their text (unless they're using a dark GTK+ theme, but we can't be sure of that. There's a definite appeal to dark notifications with a light theme).

I know I'm doing a fair bit of criticising here with little credence to back it up with, but if notification-daemon's going to go this way - which would be pretty cool, especially if it then gets hooked into the Theme capplet - then the set of preferences needs to be complete.

03/01/07 12:08:11: Modified by abock

I wasn't even aware of the pie thing. What notify-send command could I run to do future testing?

MattW: you need to configure notification-daemon with the --with-gconf-schema-file-dir set. Under openSUSE 10.2 the schemas dir is /etc/opt/gnome/gconf/schemas. For example, this is the full configure path to make "upstream" notification-daemon tarballs integrate properly with the rest of the distro (packages would mask this craziness):

$ ./configure --prefix=/opt/gnome --with-dbus-services=/usr/share/dbus-1/services --with-dbus-sys=/etc/dbus-1/system.d --with-gconf-schema-file-dir=/etc/opt/gnome/gconf/schemas/

One the schemas are installed, you usually need to force GConf to reload them:

# gconftool-rebuild

Also, I've got some better ideas than the GConf stuff. What I am working on now is actually reusing the parser pieces for GtkRC. I think it would be best if the standard theme provided its own defaults and then an RC engine that read settings from the current GTK+ theme, set in say, a notifyrc file, like gtkrc files.

I've already got a good chunk of an RC manager for notification-daemon written, but am going to need a few days to get it worked in.

Christian: while I'm happy with this GConf patch, I'd like to request that it *not* get merged until we can discuss some other options, namely, "proper" GtkRC support - I'm new to the theming game and want to get it right :)

Mind holding out until say, middle/end of next week?

03/01/07 13:14:09: Modified by chipx86

abock: Sure, I can hold off. I like your idea about the GtkRC parser. The only problem is that people probably won't want to tweak their gtk theme just to change their opacity or toggle gradients. Maybe those settings should remain in GConf and just the color scheme should be in gtkrc?

In the meantime, I'd like to suggest a few changes. First, can you update the patch to more closely follow the coding style (braces and aligning parameters passed to functions are the main things). I'd also agree with Matt-W on the borders. I really prefer having black borders, so maybe a use_themed_border pref is required here.

There are a couple of bugs. When running libnotify/tests/test-urgency after restarting notification-daemon, the "low" urgency color is black (when using the defaults). The second time, it's the proper color. Also, when using X, Y notifications (libnotify/tests/test-xy, libnotify/tests/test-xy-stress), the stripe is too far down the notification.

Other than that, I'm pretty happy with the patch.

I wouldn't worry too much about older GTK+'s without Cairo. In fact, feel free to not touch anything for non-Cairo paths, and update any references in the schema file. I'm going to drop support for GTK+ < 2.8 in this release.

For the time being, I think I'd rather see the defaults match what the current notification-daemon ships with (no gradients, no themed border colors). I've been playing around with different looks for the gradients, as I'm just not convinced we have it right yet. Once you have several notifications on the screen at once, the gradients (to me at least) feel like they clutter things. They might just need to be more subtle.

Regarding your question above about testing the little pie timer, use libnotify/tests/test-multi-actions.

Thanks!

06/13/07 02:10:23: Modified by chipx86

Hey abock.

What's the status on this? I can't remember where we left off exactly.