[anjal] Coloring Anjal.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Coloring Anjal.
- Date: Wed, 27 May 2009 12:02:09 -0400 (EDT)
commit ca55ff998a149316c29f37fe97ed71653e0b0148
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed May 27 21:36:35 2009 +0530
Coloring Anjal.
---
src/mail-message-view.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index c924b0f..1f12008 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -603,6 +603,37 @@ mmv_finished_mozilla (GtkWidget *w, MailMessageView *mmv)
#define RADIUS 8
static void
+draw_full_rounded_rectangle (cairo_t *cr, gdouble x, gdouble y, gdouble width, gdouble height)
+{
+ int radius = RADIUS;
+
+ if (width < 1 || height < 1)
+ return;
+
+ /* this allows for calculating end co-ordinates */
+ width--;
+ height--;
+
+ if (width < RADIUS * 2)
+ {
+ radius = width / 2;
+ }
+ else if (height < RADIUS * 2)
+ {
+ radius = height / 2;
+ }
+
+ cairo_line_to (cr, x, y + height - radius);
+ cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI * 1.5);
+ cairo_arc (cr, x + width - radius, y + radius, radius, G_PI * 1.5, 0);
+ cairo_arc (cr, x + width - radius, y + height - radius, radius, 0, G_PI * 0.5 );
+ cairo_line_to (cr, x +radius , y + height);
+ cairo_arc (cr, x + radius, y + height - radius, radius, G_PI * 0.5, G_PI );
+ cairo_move_to (cr, x + radius, y + height );
+
+}
+
+static void
draw_rounded_rectangle (cairo_t *cr, gdouble x, gdouble y, gdouble width, gdouble height)
{
int radius = RADIUS;
@@ -750,6 +781,28 @@ mmv_arrow_expose (GtkWidget *widget, GdkEventExpose *event, MailMessageView *mmv
}
static int
+mmv_foot_color_expose (GtkWidget *w, GdkEventExpose *event, GtkWidget *widget)
+{
+ cairo_t *cr = gdk_cairo_create (widget->window);
+ int wid = w->allocation.width;
+ int heig = w->allocation.height;
+ GtkStyle *style = gtk_widget_get_default_style ();
+ GdkColor colr;
+ GdkRectangle rect = {0, 0, wid, heig};
+
+ gdk_color_parse ("#edd400", &colr);
+ gdk_cairo_set_source_color (cr, &colr);
+ if (GTK_IS_HBOX(w))
+ draw_full_rounded_rectangle (cr, w->allocation.x+3, w->allocation.y-3, wid-12, heig+6);
+
+ cairo_fill (cr);
+ cairo_destroy (cr);
+
+
+ return FALSE;
+}
+
+static int
mmv_sh_color_expose (GtkWidget *w, GdkEventExpose *event, MailMessageView *mmv)
{
cairo_t *cr = gdk_cairo_create (w->window);
@@ -883,6 +936,7 @@ mail_message_view_set_web_flags (gpointer web, int flags)
}
#define EXPOSE(widget,mmv) g_signal_connect (widget, "expose-event", G_CALLBACK (mmv_sh_color_expose), mmv);
+#define EXPOSE_HEADER(widget,mmv) g_signal_connect (widget, "expose-event", G_CALLBACK (mmv_foot_color_expose), mmv);
static void
unread_toggled (GtkWidget *w, GdkEventButton *event, MailMessageView *mmv)
@@ -1188,6 +1242,8 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
*/
str = g_strdup_printf (_("Reply to %s"), *strv);
reply = gtk_button_new_with_label (str);
+ EXPOSE_HEADER(mmview->footer, reply);
+
g_free (str);
g_strfreev(strv);
g_signal_connect (reply, "clicked", G_CALLBACK (invoke_reply_name_composer_cb), mmview);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]