Add function to add css style context to a widget

This commit is contained in:
Robert Fewell 2017-07-02 09:54:00 +01:00
parent 489edfe1dd
commit 887a74e6d1
2 changed files with 23 additions and 0 deletions

View File

@ -270,6 +270,20 @@ gnc_tree_view_get_grid_lines_pref (void)
return grid_lines;
}
/********************************************************************\
* Add a style context to a Widget so it can be altered with css *
* *
* Args: widget - widget to add css style too *
* gnc_class - character string for css class name *
* Returns: nothing *
\********************************************************************/
void
gnc_widget_set_style_context (GtkWidget *widget, const char *gnc_class)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
gtk_style_context_add_class (context, gnc_class);
}
gboolean
gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,

View File

@ -79,6 +79,15 @@ void gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign);
\********************************************************************/
GtkTreeViewGridLines gnc_tree_view_get_grid_lines_pref (void);
/********************************************************************\
* Add a style context to a Widget so it can be altered with css *
* *
* Args: widget - widget to add css style too *
* gnc_class - character string for css class name *
* Returns: nothing *
\********************************************************************/
void gnc_widget_set_style_context (GtkWidget *widget, const char *gnc_class);
gboolean gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,
const char *date_str);