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:

committed by
Sven Neumann

parent
a780a37830
commit
7cc4f8c1db
@ -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>
|
2008-04-29 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimpwindow.c (gimp_window_key_press_event): formatting.
|
* app/widgets/gimpwindow.c (gimp_window_key_press_event): formatting.
|
||||||
|
@ -1184,6 +1184,8 @@ gimp_display_shell_new (GimpDisplay *display,
|
|||||||
|
|
||||||
gtk_widget_show (main_vbox);
|
gtk_widget_show (main_vbox);
|
||||||
|
|
||||||
|
/* add display filter for color management */
|
||||||
|
|
||||||
filter = gimp_display_shell_filter_new (shell,
|
filter = gimp_display_shell_filter_new (shell,
|
||||||
display->gimp->config->color_management);
|
display->gimp->config->color_management);
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include "display-types.h"
|
#include "display-types.h"
|
||||||
|
|
||||||
|
#include "core/gimpmarshal.h"
|
||||||
|
|
||||||
#include "gimpscalecombobox.h"
|
#include "gimpscalecombobox.h"
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +45,12 @@ enum
|
|||||||
NUM_COLUMNS
|
NUM_COLUMNS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ENTRY_ACTIVATED,
|
||||||
|
LAST_SIGNAL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static void gimp_scale_combo_box_finalize (GObject *object);
|
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
|
#define parent_class gimp_scale_combo_box_parent_class
|
||||||
|
|
||||||
|
static guint scale_combo_box_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_scale_combo_box_class_init (GimpScaleComboBoxClass *klass)
|
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);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class = GTK_WIDGET_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;
|
widget_class->style_set = gimp_scale_combo_box_style_set;
|
||||||
|
|
||||||
|
klass->entry_activated = NULL;
|
||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_double ("label-scale",
|
g_param_spec_double ("label-scale",
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
@ -295,10 +316,12 @@ gimp_scale_combo_box_entry_activate (GtkEntry *entry,
|
|||||||
}
|
}
|
||||||
else
|
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);
|
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
|
static void
|
||||||
|
@ -38,6 +38,8 @@ typedef struct _GimpScaleComboBoxClass GimpScaleComboBoxClass;
|
|||||||
struct _GimpScaleComboBoxClass
|
struct _GimpScaleComboBoxClass
|
||||||
{
|
{
|
||||||
GtkComboBoxEntryClass parent_instance;
|
GtkComboBoxEntryClass parent_instance;
|
||||||
|
|
||||||
|
void (* entry_activated) (GimpScaleComboBox *combo_box);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpScaleComboBox
|
struct _GimpScaleComboBox
|
||||||
|
@ -651,6 +651,10 @@ gimp_statusbar_new (GimpDisplayShell *shell)
|
|||||||
G_CALLBACK (gimp_statusbar_shell_scaled),
|
G_CALLBACK (gimp_statusbar_shell_scaled),
|
||||||
statusbar, 0);
|
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);
|
return GTK_WIDGET (statusbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user