diff options
Diffstat (limited to 'src/ege-output-action.cpp')
| -rw-r--r-- | src/ege-output-action.cpp | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/src/ege-output-action.cpp b/src/ege-output-action.cpp index c1a5be694..9a7d7e318 100644 --- a/src/ege-output-action.cpp +++ b/src/ege-output-action.cpp @@ -46,8 +46,6 @@ #include "ege-output-action.h" -static void ege_output_action_class_init( EgeOutputActionClass* klass ); -static void ege_output_action_init( EgeOutputAction* action ); static void ege_output_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec ); static void ege_output_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec ); static void fixup_labels( GObject *gobject, GParamSpec *arg1, gpointer user_data ); @@ -55,9 +53,6 @@ static void fixup_labels( GObject *gobject, GParamSpec *arg1, gpointer user_data /* static GtkWidget* create_menu_item( GtkAction* action ); */ static GtkWidget* create_tool_item( GtkAction* action ); -static GtkActionClass* gParentClass = 0; - - struct _EgeOutputActionPrivate { gboolean useMarkup; @@ -69,34 +64,12 @@ enum { PROP_USE_MARKUP = 1, }; -GType ege_output_action_get_type( void ) -{ - static GType myType = 0; - if ( !myType ) { - static const GTypeInfo myInfo = { - sizeof( EgeOutputActionClass ), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)ege_output_action_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof( EgeOutputAction ), - 0, /* n_preallocs */ - (GInstanceInitFunc)ege_output_action_init, - NULL - }; - - myType = g_type_register_static( GTK_TYPE_ACTION, "EgeOutputAction", &myInfo, (GTypeFlags)0 ); - } - - return myType; -} +G_DEFINE_TYPE(EgeOutputAction, ege_output_action, GTK_TYPE_ACTION); void ege_output_action_class_init( EgeOutputActionClass* klass ) { if ( klass ) { GObjectClass* objClass = G_OBJECT_CLASS( klass ); - gParentClass = GTK_ACTION_CLASS( g_type_class_peek_parent( klass ) ); objClass->get_property = ege_output_action_get_property; objClass->set_property = ege_output_action_set_property; @@ -193,7 +166,12 @@ GtkWidget* create_tool_item( GtkAction* action ) if ( IS_EGE_OUTPUT_ACTION(action) ) { GValue value; +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget* hb = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5); + gtk_box_set_homogeneous(GTK_BOX(hb), FALSE); +#else GtkWidget* hb = gtk_hbox_new( FALSE, 5 ); +#endif GtkWidget* lbl = 0; memset( &value, 0, sizeof(value) ); @@ -223,7 +201,7 @@ GtkWidget* create_tool_item( GtkAction* action ) g_value_unset( &value ); } else { - item = gParentClass->create_tool_item( action ); + item = GTK_ACTION_CLASS(ege_output_action_parent_class)->create_tool_item( action ); } return item; @@ -243,7 +221,7 @@ void fixup_labels( GObject *gobject, GParamSpec *arg1, gpointer user_data ) /* Search for the things we built up in create_tool_item() */ GList* children = gtk_container_get_children( GTK_CONTAINER(proxies->data) ); if ( children && children->data ) { - if ( GTK_IS_HBOX(children->data) ) { + if ( GTK_IS_BOX(children->data) ) { children = gtk_container_get_children( GTK_CONTAINER(children->data) ); if ( children && g_list_next(children) ) { GtkWidget* child = GTK_WIDGET( g_list_next(children)->data ); |
