added signal "entry-activated".

2008-04-29  Sven Neumann  <sven@gimp.org>

	* 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.


svn path=/trunk/; revision=25549
This commit is contained in:
Sven Neumann 2008-04-29 09:08:53 +00:00 committed by Sven Neumann
parent a780a37830
commit 7cc4f8c1db
5 changed files with 42 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2008-04-29 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* app/widgets/gimpwindow.c (gimp_window_key_press_event): formatting.

View File

@ -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);

View File

@ -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);
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

View File

@ -38,6 +38,8 @@ typedef struct _GimpScaleComboBoxClass GimpScaleComboBoxClass;
struct _GimpScaleComboBoxClass
{
GtkComboBoxEntryClass parent_instance;
void (* entry_activated) (GimpScaleComboBox *combo_box);
};
struct _GimpScaleComboBox

View File

@ -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);
}