[gnumeric] Sheet widgets: add css class for styling.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Sheet widgets: add css class for styling.
- Date: Mon, 12 Aug 2013 20:24:53 +0000 (UTC)
commit e1fd66d6cbb1be260e542677ac892dee8461b596
Author: Morten Welinder <terra gnome org>
Date: Mon Aug 12 16:24:28 2013 -0400
Sheet widgets: add css class for styling.
ChangeLog | 5 +++++
src/sheet-object-widget.c | 17 ++++++++++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6e3dd77..680e491 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-12 Morten Welinder <terra gnome org>
+
+ * src/sheet-object-widget.c (sow_create_widget): New function.
+ Add sheet-object class to widgets.
+
2013-08-12 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/sheet-object-widget.c (sheet_widget_frame_draw_cairo): set
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index fa50e6b..3214909 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -223,6 +223,15 @@ typedef struct {
static GObjectClass *sheet_object_widget_class = NULL;
+static GtkWidget *
+sow_create_widget (SheetObjectWidget *sow)
+{
+ GtkWidget *w = SOW_CLASS(sow)->create_widget (sow);
+ GtkStyleContext *context = gtk_widget_get_style_context (w);
+ gtk_style_context_add_class (context, "sheet-object");
+ return w;
+}
+
static void
sheet_widget_draw_cairo (SheetObject const *so, cairo_t *cr,
double width, double height)
@@ -231,7 +240,7 @@ sheet_widget_draw_cairo (SheetObject const *so, cairo_t *cr,
/* See bugs #705638 and #705640 */
if (NULL != gdk_screen_get_default ()) {
GtkWidget *win = gtk_offscreen_window_new ();
- GtkWidget *w = SOW_CLASS(so)->create_widget (GNM_SOW (so));
+ GtkWidget *w = sow_create_widget (GNM_SOW (so));
gtk_container_add (GTK_CONTAINER (win), w);
gtk_widget_set_size_request (w, width, height);
@@ -285,8 +294,7 @@ sax_read_dep (xmlChar const * const *attrs, char const *name,
static SheetObjectView *
sheet_object_widget_new_view (SheetObject *so, SheetObjectViewContainer *container)
{
- GtkWidget *view_widget =
- SOW_CLASS(so)->create_widget (GNM_SOW (so));
+ GtkWidget *view_widget = sow_create_widget (GNM_SOW (so));
GocItem *view_item = goc_item_new (
gnm_pane_object_group (GNM_PANE (container)),
so_widget_view_get_type (),
@@ -1458,8 +1466,7 @@ sheet_widget_adjustment_set_horizontal (SheetWidgetAdjustment *swa,
for (ptr = swa->sow.so.realized_list; ptr != NULL; ptr = ptr->next) {
SheetObjectView *view = ptr->data;
GocWidget *item = get_goc_widget (view);
- GtkWidget *neww =
- SOW_CLASS (swa)->create_widget (GNM_SOW (swa));
+ GtkWidget *neww = sow_create_widget (GNM_SOW (swa));
gtk_widget_show (neww);
goc_item_set (GOC_ITEM (item), "widget", neww, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]