diff --git a/ChangeLog b/ChangeLog index 1f09fcc7f9..bec066a599 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-04-29 Sven Neumann + + * app/display/gimpscalecombobox.[ch]: added signal "entry-activated". + + * app/display/gimpstatusbar.c (gimp_statusbar_new): connect to the + new signal and move the focus to the canvas. + + * app/display/gimpdisplayshell.c (gimp_display_shell_new): comment. + 2008-04-29 Sven Neumann * app/widgets/gimpwindow.c (gimp_window_key_press_event): formatting. diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index a405584238..0b181baec6 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1184,6 +1184,8 @@ gimp_display_shell_new (GimpDisplay *display, gtk_widget_show (main_vbox); + /* add display filter for color management */ + filter = gimp_display_shell_filter_new (shell, display->gimp->config->color_management); diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c index 8df9ec26ca..6d8cd9c69f 100644 --- a/app/display/gimpscalecombobox.c +++ b/app/display/gimpscalecombobox.c @@ -30,6 +30,8 @@ #include "display-types.h" +#include "core/gimpmarshal.h" + #include "gimpscalecombobox.h" @@ -43,6 +45,12 @@ enum NUM_COLUMNS }; +enum +{ + ENTRY_ACTIVATED, + LAST_SIGNAL +}; + static void gimp_scale_combo_box_finalize (GObject *object); @@ -64,6 +72,8 @@ G_DEFINE_TYPE (GimpScaleComboBox, gimp_scale_combo_box, #define parent_class gimp_scale_combo_box_parent_class +static guint scale_combo_box_signals[LAST_SIGNAL] = { 0 }; + static void gimp_scale_combo_box_class_init (GimpScaleComboBoxClass *klass) @@ -71,10 +81,21 @@ gimp_scale_combo_box_class_init (GimpScaleComboBoxClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - object_class->finalize = gimp_scale_combo_box_finalize; + scale_combo_box_signals[ENTRY_ACTIVATED] = + g_signal_new ("entry-activated", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpScaleComboBoxClass, entry_activated), + NULL, NULL, + gimp_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + object_class->finalize = gimp_scale_combo_box_finalize; widget_class->style_set = gimp_scale_combo_box_style_set; + klass->entry_activated = NULL; + gtk_widget_class_install_style_property (widget_class, g_param_spec_double ("label-scale", NULL, NULL, @@ -295,10 +316,12 @@ gimp_scale_combo_box_entry_activate (GtkEntry *entry, } else { - gtk_widget_error_bell (GTK_WIDGET (combo_box)); + gtk_widget_error_bell (GTK_WIDGET (entry)); gimp_scale_combo_box_set_scale (combo_box, combo_box->scale); } + + g_signal_emit (combo_box, scale_combo_box_signals[ENTRY_ACTIVATED], 0); } static void diff --git a/app/display/gimpscalecombobox.h b/app/display/gimpscalecombobox.h index 6ea843a126..672c3d3579 100644 --- a/app/display/gimpscalecombobox.h +++ b/app/display/gimpscalecombobox.h @@ -38,6 +38,8 @@ typedef struct _GimpScaleComboBoxClass GimpScaleComboBoxClass; struct _GimpScaleComboBoxClass { GtkComboBoxEntryClass parent_instance; + + void (* entry_activated) (GimpScaleComboBox *combo_box); }; struct _GimpScaleComboBox diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c index 4ea87fc02f..22bad4c326 100644 --- a/app/display/gimpstatusbar.c +++ b/app/display/gimpstatusbar.c @@ -651,6 +651,10 @@ gimp_statusbar_new (GimpDisplayShell *shell) G_CALLBACK (gimp_statusbar_shell_scaled), statusbar, 0); + g_signal_connect_object (statusbar->scale_combo, "entry-activated", + G_CALLBACK (gtk_widget_grab_focus), + shell->canvas, G_CONNECT_SWAPPED); + return GTK_WIDGET (statusbar); }