forked from AuroraMiddleware/gtk
gizmo: Add a css_changed function
In a break from the current gizmo api, add a separate setter, since the calls with long argument lists full of NULL are getting out of hand.
This commit is contained in:
parent
7332b4f1d9
commit
39f72b3834
@ -82,6 +82,16 @@ gtk_gizmo_grab_focus (GtkWidget *widget)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gizmo_css_changed (GtkWidget *widget,
|
||||
GtkCssStyleChange *change)
|
||||
{
|
||||
GtkGizmo *self = GTK_GIZMO (widget);
|
||||
|
||||
if (self->css_changed_func)
|
||||
self->css_changed_func (self, change);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gizmo_finalize (GObject *object)
|
||||
{
|
||||
@ -115,6 +125,7 @@ gtk_gizmo_class_init (GtkGizmoClass *klass)
|
||||
widget_class->contains = gtk_gizmo_contains;
|
||||
widget_class->grab_focus = gtk_gizmo_grab_focus;
|
||||
widget_class->focus = gtk_gizmo_focus;
|
||||
widget_class->css_changed = gtk_gizmo_css_changed;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -165,3 +176,12 @@ gtk_gizmo_new_with_role (const char *css_name,
|
||||
|
||||
return GTK_WIDGET (gizmo);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_gizmo_set_css_changed_func (GtkGizmo *gizmo,
|
||||
GtkGizmoCssChangedFunc css_changed_func)
|
||||
{
|
||||
g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (gizmo)));
|
||||
|
||||
gizmo->css_changed_func = css_changed_func;
|
||||
}
|
||||
|
@ -33,7 +33,9 @@ typedef gboolean (* GtkGizmoContainsFunc) (GtkGizmo *gizmo,
|
||||
double y);
|
||||
typedef gboolean (* GtkGizmoFocusFunc) (GtkGizmo *gizmo,
|
||||
GtkDirectionType direction);
|
||||
typedef gboolean (* GtkGizmoGrabFocusFunc)(GtkGizmo *gizmo);
|
||||
typedef gboolean (* GtkGizmoGrabFocusFunc) (GtkGizmo *gizmo);
|
||||
typedef void (* GtkGizmoCssChangedFunc) (GtkGizmo *gizmo,
|
||||
GtkCssStyleChange *change);
|
||||
|
||||
struct _GtkGizmo
|
||||
{
|
||||
@ -45,6 +47,7 @@ struct _GtkGizmo
|
||||
GtkGizmoContainsFunc contains_func;
|
||||
GtkGizmoFocusFunc focus_func;
|
||||
GtkGizmoGrabFocusFunc grab_focus_func;
|
||||
GtkGizmoCssChangedFunc css_changed_func;
|
||||
};
|
||||
|
||||
struct _GtkGizmoClass
|
||||
@ -71,5 +74,7 @@ GtkWidget *gtk_gizmo_new_with_role (const char *css_name,
|
||||
GtkGizmoFocusFunc focus_func,
|
||||
GtkGizmoGrabFocusFunc grab_focus_func);
|
||||
|
||||
void gtk_gizmo_set_css_changed_func (GtkGizmo *gizmo,
|
||||
GtkGizmoCssChangedFunc css_changed_func);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user