Update the OSD visuals
This commit is contained in:
parent
633f555b91
commit
f3645f2c0d
@ -1,6 +1,6 @@
|
||||
Name: gnome-settings-daemon
|
||||
Version: 2.28.0
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
|
||||
|
||||
Group: System Environment/Daemons
|
||||
@ -32,6 +32,10 @@ BuildRequires: gettext intltool
|
||||
BuildRequires: fontconfig-devel
|
||||
BuildRequires: libcanberra-devel
|
||||
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=596136
|
||||
Patch0: osd-rounded-rectangle.patch
|
||||
Patch1: osd-visual-refresh.patch
|
||||
|
||||
%description
|
||||
A daemon to share settings from GNOME to other applications. It also
|
||||
handles global keybindings, as well as a number of desktop-wide settings.
|
||||
@ -49,6 +53,8 @@ developing applications that use %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .osd-rounded-rectangle
|
||||
%patch1 -p1 -b .osd-visual-refresh
|
||||
|
||||
%build
|
||||
%configure --enable-static=no --enable-profiling --disable-esd
|
||||
@ -160,6 +166,9 @@ fi
|
||||
%{_libdir}/pkgconfig/gnome-settings-daemon.pc
|
||||
|
||||
%changelog
|
||||
* Fri Sep 25 2009 Matthias Clasen <mclasen@redhat.com> - 2.28.0-3
|
||||
- Align the OSD visuals with the notification theme
|
||||
|
||||
* Tue Sep 22 2009 Adam Jackson <ajax@redhat.com> 2.28.0-2
|
||||
- BuildRequires: libcanberra-devel
|
||||
|
||||
|
133
osd-rounded-rectangle.patch
Normal file
133
osd-rounded-rectangle.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From 8fe2c6627deb4d783715f3bbd315c65023451775 Mon Sep 17 00:00:00 2001
|
||||
From: William Jon McCann <jmccann@redhat.com>
|
||||
Date: Wed, 23 Sep 2009 20:23:31 -0400
|
||||
Subject: [PATCH 1/2] Use a rounded instead of curved rectangle
|
||||
|
||||
---
|
||||
plugins/media-keys/gsd-media-keys-window.c | 101 +++++++++++++---------------
|
||||
1 files changed, 48 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
|
||||
index 9306b92..89071b8 100644
|
||||
--- a/plugins/media-keys/gsd-media-keys-window.c
|
||||
+++ b/plugins/media-keys/gsd-media-keys-window.c
|
||||
@@ -260,59 +260,54 @@ gsd_media_keys_window_set_volume_level (GsdMediaKeysWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
-curved_rectangle (cairo_t *cr,
|
||||
- double x0,
|
||||
- double y0,
|
||||
- double width,
|
||||
- double height,
|
||||
- double radius)
|
||||
-{
|
||||
- double x1;
|
||||
- double y1;
|
||||
-
|
||||
- x1 = x0 + width;
|
||||
- y1 = y0 + height;
|
||||
-
|
||||
- if (!width || !height) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (width / 2 < radius) {
|
||||
- if (height / 2 < radius) {
|
||||
- cairo_move_to (cr, x0, (y0 + y1) / 2);
|
||||
- cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1) / 2, y0);
|
||||
- cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2);
|
||||
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1);
|
||||
- cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2);
|
||||
- } else {
|
||||
- cairo_move_to (cr, x0, y0 + radius);
|
||||
- cairo_curve_to (cr, x0, y0, x0, y0, (x0 + x1) / 2, y0);
|
||||
- cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
|
||||
- cairo_line_to (cr, x1, y1 - radius);
|
||||
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1);
|
||||
- cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius);
|
||||
- }
|
||||
- } else {
|
||||
- if (height / 2 < radius) {
|
||||
- cairo_move_to (cr, x0, (y0 + y1) / 2);
|
||||
- cairo_curve_to (cr, x0, y0, x0 , y0, x0 + radius, y0);
|
||||
- cairo_line_to (cr, x1 - radius, y0);
|
||||
- cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2);
|
||||
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
|
||||
- cairo_line_to (cr, x0 + radius, y1);
|
||||
- cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2);
|
||||
- } else {
|
||||
- cairo_move_to (cr, x0, y0 + radius);
|
||||
- cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
|
||||
- cairo_line_to (cr, x1 - radius, y0);
|
||||
- cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
|
||||
- cairo_line_to (cr, x1, y1 - radius);
|
||||
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
|
||||
- cairo_line_to (cr, x0 + radius, y1);
|
||||
- cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+rounded_rectangle (cairo_t* cr,
|
||||
+ gdouble aspect,
|
||||
+ gdouble x,
|
||||
+ gdouble y,
|
||||
+ gdouble corner_radius,
|
||||
+ gdouble width,
|
||||
+ gdouble height)
|
||||
+{
|
||||
+ gdouble radius = corner_radius / aspect;
|
||||
+
|
||||
+ cairo_move_to (cr, x + radius, y);
|
||||
+
|
||||
+ cairo_line_to (cr,
|
||||
+ x + width - radius,
|
||||
+ y);
|
||||
+ cairo_arc (cr,
|
||||
+ x + width - radius,
|
||||
+ y + radius,
|
||||
+ radius,
|
||||
+ -90.0f * G_PI / 180.0f,
|
||||
+ 0.0f * G_PI / 180.0f);
|
||||
+ cairo_line_to (cr,
|
||||
+ x + width,
|
||||
+ y + height - radius);
|
||||
+ cairo_arc (cr,
|
||||
+ x + width - radius,
|
||||
+ y + height - radius,
|
||||
+ radius,
|
||||
+ 0.0f * G_PI / 180.0f,
|
||||
+ 90.0f * G_PI / 180.0f);
|
||||
+ cairo_line_to (cr,
|
||||
+ x + radius,
|
||||
+ y + height);
|
||||
+ cairo_arc (cr,
|
||||
+ x + radius,
|
||||
+ y + height - radius,
|
||||
+ radius,
|
||||
+ 90.0f * G_PI / 180.0f,
|
||||
+ 180.0f * G_PI / 180.0f);
|
||||
+ cairo_line_to (cr,
|
||||
+ x,
|
||||
+ y + radius);
|
||||
+ cairo_arc (cr,
|
||||
+ x + radius,
|
||||
+ y + radius,
|
||||
+ radius,
|
||||
+ 180.0f * G_PI / 180.0f,
|
||||
+ 270.0f * G_PI / 180.0f);
|
||||
cairo_close_path (cr);
|
||||
}
|
||||
|
||||
@@ -795,7 +790,7 @@ on_expose_event (GtkWidget *widget,
|
||||
cairo_paint (cr);
|
||||
|
||||
/* draw a box */
|
||||
- curved_rectangle (cr, 0.5, 0.5, width-1, height-1, height / 10);
|
||||
+ rounded_rectangle (cr, 1.0, 0.5, 0.5, height / 10, width-1, height-1);
|
||||
color = GTK_WIDGET (window)->style->bg [GTK_STATE_NORMAL];
|
||||
r = (float)color.red / 65535.0;
|
||||
g = (float)color.green / 65535.0;
|
||||
--
|
||||
1.6.4.4
|
||||
|
136
osd-visual-refresh.patch
Normal file
136
osd-visual-refresh.patch
Normal file
@ -0,0 +1,136 @@
|
||||
From cca9a6d853b4c1366cf965750f0a7c6e9c74e3a1 Mon Sep 17 00:00:00 2001
|
||||
From: William Jon McCann <jmccann@redhat.com>
|
||||
Date: Wed, 23 Sep 2009 21:15:45 -0400
|
||||
Subject: [PATCH 2/2] Improve the media keys overlay design
|
||||
|
||||
---
|
||||
plugins/media-keys/gsd-media-keys-window.c | 69 ++++++++++++++++++++--------
|
||||
1 files changed, 50 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
|
||||
index 89071b8..a31edca 100644
|
||||
--- a/plugins/media-keys/gsd-media-keys-window.c
|
||||
+++ b/plugins/media-keys/gsd-media-keys-window.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#define DIALOG_FADE_TIMEOUT 1500 /* timeout before fade starts */
|
||||
#define FADE_TIMEOUT 10 /* timeout in ms between each frame of the fade */
|
||||
|
||||
-#define BG_ALPHA 0.50
|
||||
+#define BG_ALPHA 0.75
|
||||
#define FG_ALPHA 1.00
|
||||
|
||||
static void gsd_media_keys_window_class_init (GsdMediaKeysWindowClass *klass);
|
||||
@@ -593,6 +593,36 @@ render_speaker (GsdMediaKeysWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
+color_reverse (const GdkColor *a,
|
||||
+ GdkColor *b)
|
||||
+{
|
||||
+ gdouble red;
|
||||
+ gdouble green;
|
||||
+ gdouble blue;
|
||||
+ gdouble h;
|
||||
+ gdouble s;
|
||||
+ gdouble v;
|
||||
+
|
||||
+ red = (gdouble) a->red / 65535.0;
|
||||
+ green = (gdouble) a->green / 65535.0;
|
||||
+ blue = (gdouble) a->blue / 65535.0;
|
||||
+
|
||||
+ gtk_rgb_to_hsv (red, green, blue, &h, &s, &v);
|
||||
+
|
||||
+ v = 0.5 + (0.5 - v);
|
||||
+ if (v > 1.0)
|
||||
+ v = 1.0;
|
||||
+ else if (v < 0.0)
|
||||
+ v = 0.0;
|
||||
+
|
||||
+ gtk_hsv_to_rgb (h, s, v, &red, &green, &blue);
|
||||
+
|
||||
+ b->red = red * 65535.0;
|
||||
+ b->green = green * 65535.0;
|
||||
+ b->blue = blue * 65535.0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
draw_volume_boxes (GsdMediaKeysWindow *window,
|
||||
cairo_t *cr,
|
||||
double percentage,
|
||||
@@ -605,35 +635,36 @@ draw_volume_boxes (GsdMediaKeysWindow *window,
|
||||
GdkColor color;
|
||||
double r, g, b;
|
||||
|
||||
- x1 = width * percentage;
|
||||
+ x1 = (width - 2) * percentage;
|
||||
|
||||
/* bar background */
|
||||
- color = GTK_WIDGET (window)->style->dark [GTK_STATE_NORMAL];
|
||||
+ color_reverse (>K_WIDGET (window)->style->dark[GTK_STATE_NORMAL], &color);
|
||||
r = (float)color.red / 65535.0;
|
||||
g = (float)color.green / 65535.0;
|
||||
b = (float)color.blue / 65535.0;
|
||||
- cairo_rectangle (cr, x0, y0, width, height);
|
||||
- cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
|
||||
- cairo_fill (cr);
|
||||
+ rounded_rectangle (cr, 1.0, x0, y0, height / 6, width, height);
|
||||
+ cairo_set_source_rgba (cr, r, g, b, FG_ALPHA / 2);
|
||||
+ cairo_fill_preserve (cr);
|
||||
|
||||
/* bar border */
|
||||
- color = GTK_WIDGET (window)->style->dark [GTK_STATE_SELECTED];
|
||||
+ color_reverse (>K_WIDGET (window)->style->light[GTK_STATE_NORMAL], &color);
|
||||
r = (float)color.red / 65535.0;
|
||||
g = (float)color.green / 65535.0;
|
||||
b = (float)color.blue / 65535.0;
|
||||
- cairo_rectangle (cr, x0, y0, width, height);
|
||||
- cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
|
||||
+ cairo_set_source_rgba (cr, r, g, b, FG_ALPHA / 2);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
|
||||
/* bar progress */
|
||||
- color = GTK_WIDGET (window)->style->bg [GTK_STATE_SELECTED];
|
||||
- r = (float)color.red / 65535.0;
|
||||
- g = (float)color.green / 65535.0;
|
||||
- b = (float)color.blue / 65535.0;
|
||||
- cairo_rectangle (cr, x0, y0, x1, height);
|
||||
- cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
|
||||
- cairo_fill (cr);
|
||||
+ if (percentage > 0.01) {
|
||||
+ color = GTK_WIDGET (window)->style->bg[GTK_STATE_NORMAL];
|
||||
+ r = (float)color.red / 65535.0;
|
||||
+ g = (float)color.green / 65535.0;
|
||||
+ b = (float)color.blue / 65535.0;
|
||||
+ rounded_rectangle (cr, 1.0, x0 + 1, y0 + 1, height / 8, x1, height - 2);
|
||||
+ cairo_set_source_rgba (cr, r, g, b, FG_ALPHA);
|
||||
+ cairo_fill (cr);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -791,18 +822,18 @@ on_expose_event (GtkWidget *widget,
|
||||
|
||||
/* draw a box */
|
||||
rounded_rectangle (cr, 1.0, 0.5, 0.5, height / 10, width-1, height-1);
|
||||
- color = GTK_WIDGET (window)->style->bg [GTK_STATE_NORMAL];
|
||||
+ color_reverse (>K_WIDGET (window)->style->bg[GTK_STATE_NORMAL], &color);
|
||||
r = (float)color.red / 65535.0;
|
||||
g = (float)color.green / 65535.0;
|
||||
b = (float)color.blue / 65535.0;
|
||||
cairo_set_source_rgba (cr, r, g, b, BG_ALPHA);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
- color = GTK_WIDGET (window)->style->fg [GTK_STATE_NORMAL];
|
||||
+ color_reverse (>K_WIDGET (window)->style->text_aa[GTK_STATE_NORMAL], &color);
|
||||
r = (float)color.red / 65535.0;
|
||||
g = (float)color.green / 65535.0;
|
||||
b = (float)color.blue / 65535.0;
|
||||
- cairo_set_source_rgba (cr, r, g, b, BG_ALPHA);
|
||||
+ cairo_set_source_rgba (cr, r, g, b, BG_ALPHA / 2);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
|
||||
--
|
||||
1.6.4.4
|
||||
|
Loading…
Reference in New Issue
Block a user