[gnome-calendar] gcal-days-grid: refactored a bit :draw method
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] gcal-days-grid: refactored a bit :draw method
- Date: Thu, 4 Dec 2014 22:29:46 +0000 (UTC)
commit fd87ba68c6211893946fc27e8b051475fb125e57
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sat Jul 27 19:06:40 2013 -0400
gcal-days-grid: refactored a bit :draw method
Moved querying the background color to only when
it's needed
src/gcal-days-grid.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-days-grid.c b/src/gcal-days-grid.c
index 96adc9d..c28059f 100644
--- a/src/gcal-days-grid.c
+++ b/src/gcal-days-grid.c
@@ -640,11 +640,6 @@ gcal_days_grid_draw (GtkWidget *widget,
gtk_widget_get_state_flags (widget) | GTK_STATE_FLAG_INSENSITIVE,
&ligther_color);
- gtk_style_context_get_background_color (
- gtk_widget_get_style_context (widget),
- gtk_widget_get_state_flags (widget) | GTK_STATE_FLAG_SELECTED,
- &background_selected_color);
-
gtk_style_context_get (
gtk_widget_get_style_context (widget),
gtk_widget_get_state_flags (widget),
@@ -690,7 +685,11 @@ gcal_days_grid_draw (GtkWidget *widget,
gint last_cell;
gint columns;
- cairo_save (cr);
+ gtk_style_context_get_background_color (
+ gtk_widget_get_style_context (widget),
+ gtk_widget_get_state_flags (widget) | GTK_STATE_FLAG_SELECTED,
+ &background_selected_color);
+
if (priv->start_mark_cell < priv->end_mark_cell)
{
first_cell = priv->start_mark_cell;
@@ -702,6 +701,7 @@ gcal_days_grid_draw (GtkWidget *widget,
last_cell = priv->start_mark_cell;
}
+ cairo_save (cr);
cairo_set_source_rgba (cr,
background_selected_color.red,
background_selected_color.green,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]