[gnumeric] GUI: Theme the default sheet cursor too.



commit 0f6a92ade18b841eff683c4bd41458f366dd7a07
Author: Morten Welinder <terra gnome org>
Date:   Tue Mar 26 11:38:24 2013 -0400

    GUI: Theme the default sheet cursor too.

 src/gnumeric.css  |    4 ++++
 src/item-cursor.c |   11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 6509c3c..927c63b 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -1,7 +1,11 @@
 /* ------------------------------------------------------------------------- */
 /* The GnmItemGrid is the canvas area that holds all the cells.  */
+/* GnmPreviewGrid is the canvas used for auto-format previews. */
 GnmItemGrid, GnmPreviewGrid {
   background-color: white;
+  padding: 0;
+  border-style: none;
+  border-width: 0;
 }
 
 /* Function markers are enabled from View->View Properties->Cell Markers */
diff --git a/src/item-cursor.c b/src/item-cursor.c
index e3c1d49..981c5ff 100644
--- a/src/item-cursor.c
+++ b/src/item-cursor.c
@@ -88,6 +88,7 @@ struct _GnmItemCursor {
        GdkRGBA  color;
 
        /* Style: */
+       GdkRGBA normal_color;
        GdkRGBA ant_color, ant_background_color;
        GdkRGBA drag_color, drag_background_color;
 };
@@ -111,6 +112,10 @@ ic_reload_style (GnmItemCursor *ic)
        GtkStyleContext *context = goc_item_get_style_context (item);
 
        gtk_style_context_get_color
+               (context, GTK_STATE_FLAG_NORMAL,
+                &ic->normal_color);
+
+       gtk_style_context_get_color
                (context, GTK_STATE_FLAG_PRELIGHT,
                 &ic->ant_color);
        gtk_style_context_get_background_color
@@ -342,7 +347,7 @@ item_cursor_draw (GocItem const *item, cairo_t *cr)
        cairo_set_line_width (cr, 1.);
        cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
        cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
-       gdk_cairo_set_source_rgba (cr, &gs_black);
+       gdk_cairo_set_source_rgba (cr, &ic->normal_color);
 
        if (draw_xor)
                cairo_set_operator (cr, CAIRO_OPERATOR_HARD_LIGHT);
@@ -1470,11 +1475,11 @@ gnm_item_cursor_class_init (GObjectClass *gobject_klass)
                                   "Name of the cursor's color",
                                   0, 0xffffffff, 
                                   GO_COLOR_BLACK,
-                                  GSF_PARAM_STATIC |  G_PARAM_WRITABLE));
+                                  GSF_PARAM_STATIC | G_PARAM_WRITABLE));
 
        item_klass->realize     = item_cursor_realize;
        item_klass->unrealize   = item_cursor_unrealize;
-       item_klass->draw                = item_cursor_draw;
+       item_klass->draw        = item_cursor_draw;
        item_klass->update_bounds = item_cursor_update_bounds;
        item_klass->distance    = item_cursor_distance;
        item_klass->button_pressed = item_cursor_button_pressed;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]