Commit 3a903cdd authored by Tristan Van Berkom's avatar Tristan Van Berkom

- Added Drag/Resize button in the toolbar


	* src/glade-project-window.c: 
	  - Added Drag/Resize button in the toolbar

	* gladeui/glade-design-layout.c: More reliable pointer handling

	* gladeui/glade-app.c: New pointer-mode property
	
	* gladeui/glade-fixed.c, gladeui/glade-placeholder.c, gladeui/glade-palette.c:
	  Use pointer-mode to set pointer interaction mode

	* gladeui/glade-builtins.c: Added trailing end marker on the stock list
	  enum paramspec.


svn path=/trunk/; revision=1368
parent 2365a039
......@@ -5,8 +5,20 @@
* gladeui/glade-project.[ch]: added glade_project_undo_items() and
glade_project_redo_items().
* src/glade-project-window.c: Made Undo/Redo buttons use a GtkMenuToolButton
and include undo/redo history in those buttons
* src/glade-project-window.c:
- Made Undo/Redo buttons use a GtkMenuToolButton and include
undo/redo history in those buttons
- Added Drag/Resize button in the toolbar
* gladeui/glade-design-layout.c: More reliable pointer handling
* gladeui/glade-app.c: New pointer-mode property
* gladeui/glade-fixed.c, gladeui/glade-placeholder.c, gladeui/glade-palette.c:
Use pointer-mode to set pointer interaction mode
* gladeui/glade-builtins.c: Added trailing end marker on the stock list
enum paramspec.
2007-06-18 Juan Pablo Ugarte <juanpablougarte@gmail.com>
......
......@@ -53,7 +53,8 @@ enum
enum
{
PROP_0,
PROP_ACTIVE_PROJECT
PROP_ACTIVE_PROJECT,
PROP_POINTER_MODE
};
struct _GladeAppPrivate
......@@ -78,6 +79,8 @@ struct _GladeAppPrivate
*/
GtkAccelGroup *accel_group; /* Default acceleration group for this app */
GList *undo_list, *redo_list; /* Lists of buttons to refresh in update-ui signal */
GladePointerMode pointer_mode; /* Current mode for the pointer in the workspace */
};
static guint glade_app_signals[LAST_SIGNAL] = { 0 };
......@@ -97,6 +100,27 @@ static void glade_init_check (void);
G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT);
GType
glade_pointer_mode_get_type (void)
{
static GType etype = 0;
if (etype == 0)
{
static const GEnumValue values[] =
{
{ GLADE_POINTER_SELECT, "select", "Select widgets" },
{ GLADE_POINTER_ADD_WIDGET, "add", "Add widgets" },
{ GLADE_POINTER_DRAG_RESIZE, "drag-resize", "Drag and resize widgets" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static ("GladePointerMode",
values);
}
return etype;
}
/*****************************************************************
* GObjectClass *
*****************************************************************/
......@@ -186,6 +210,9 @@ glade_app_set_property (GObject *object,
case PROP_ACTIVE_PROJECT:
glade_app_set_project (g_value_get_object (value));
break;
case PROP_POINTER_MODE:
glade_app_set_pointer_mode (g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(object, property_id, pspec);
......@@ -207,6 +234,9 @@ glade_app_get_property (GObject *object,
case PROP_ACTIVE_PROJECT:
g_value_set_object (value, app->priv->active_project);
break;
case PROP_POINTER_MODE:
g_value_set_enum (value, app->priv->pointer_mode);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object,property_id,pspec);
break;
......@@ -516,6 +546,14 @@ glade_app_class_init (GladeAppClass * klass)
_("The active project"),
GLADE_TYPE_PROJECT, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_POINTER_MODE,
g_param_spec_enum
("pointer-mode", _("Pointer Mode"),
_("Current mode for the pointer in the workspace"),
GLADE_TYPE_POINTER_MODE,
GLADE_POINTER_SELECT,
G_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GladeAppPrivate));
}
......@@ -1071,6 +1109,39 @@ glade_app_set_project (GladeProject *project)
g_object_notify (G_OBJECT (app), "active-project");
}
/**
* glade_app_set_pointer_mode:
* @mode: A #GladePointerMode
*
* Sets the #GladePointerMode
*/
void
glade_app_set_pointer_mode (GladePointerMode mode)
{
GladeApp *app = glade_app_get();
app->priv->pointer_mode = mode;
g_object_notify (G_OBJECT (app), "pointer-mode");
}
/**
* glade_app_get_pointer_mode:
*
* Gets the current #GladePointerMode
*
* Returns: The #GladePointerMode
*/
GladePointerMode
glade_app_get_pointer_mode (void)
{
GladeApp *app = glade_app_get();
return app->priv->pointer_mode;
}
/**
* glade_app_command_copy:
* @app: A #GladeApp
......
......@@ -37,9 +37,29 @@ G_BEGIN_DECLS
#define GLADE_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_APP))
#define GLADE_APP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_APP, GladeAppClass))
#define GLADE_TYPE_POINTER_MODE (glade_pointer_mode_get_type())
typedef struct _GladeApp GladeApp;
typedef struct _GladeAppPrivate GladeAppPrivate;
typedef struct _GladeAppClass GladeAppClass;
typedef enum _GladePointerMode GladePointerMode;
/**
* GladePointerMode:
* @GLADE_POINTER_SELECT: Mouse pointer used for selecting widgets
* @GLADE_POINTER_ADD_WIDGET: Mouse pointer used for adding widgets
* @GLADE_POINTER_DRAG_RESIZE: Mouse pointer used for dragging and
* resizing widgets in containers
*
* Indicates what the pointer is used for in the workspace.
*/
enum _GladePointerMode
{
GLADE_POINTER_SELECT = 0,
GLADE_POINTER_ADD_WIDGET,
GLADE_POINTER_DRAG_RESIZE
};
struct _GladeApp
{
......@@ -68,6 +88,8 @@ struct _GladeAppClass
GType glade_app_get_type (void) G_GNUC_CONST;
GType glade_pointer_mode_get_type (void) G_GNUC_CONST;
GladeApp* glade_app_get (void);
void glade_app_update_ui (void);
......@@ -88,11 +110,14 @@ GladeClipboard* glade_app_get_clipboard (void);
GtkWidget* glade_app_get_clipboard_view (void);
GladeProject* glade_app_get_project (void);
void glade_app_set_project (GladeProject *project);
GladePointerMode glade_app_get_pointer_mode (void);
void glade_app_set_pointer_mode (GladePointerMode mode);
void glade_app_add_project (GladeProject *project);
void glade_app_remove_project (GladeProject *project);
......
......@@ -100,7 +100,7 @@ list_stock_items (gboolean include_images)
stock_list = g_slist_reverse (gtk_stock_list_ids ());
values = g_array_sized_new (TRUE, TRUE, sizeof (GEnumValue),
g_slist_length (stock_list) + 1);
g_slist_length (stock_list) + 2);
/* Add first "no stock" element */
......@@ -145,6 +145,12 @@ list_stock_items (gboolean include_images)
}
/* Add the trailing end marker */
value.value = 0;
value.value_name = NULL;
value.value_nick = NULL;
values = g_array_append_val (values, value);
stock_prefixs_done = TRUE;
g_slist_free (stock_list);
......
......@@ -9,8 +9,9 @@ G_BEGIN_DECLS
typedef struct _GladeParamSpecObjects GladeParamSpecObjects;
typedef struct _GladeParamSpecAccel GladeParamSpecAccel;
typedef struct _GladeKey GladeKey;
struct _GladeKey {
guint value;
gchar *name;
......@@ -29,7 +30,7 @@ extern const GladeKey GladeKeys[];
#define GLADE_TYPE_ACCEL_GLIST (glade_accel_glist_get_type())
#define GLADE_TYPE_PARAM_OBJECTS (glade_param_objects_get_type())
#define GLADE_TYPE_PARAM_ACCEL (glade_param_accel_get_type())
#define GLADE_ITEM_APPEARANCE_TYPE (glade_item_appearance_get_type())
#define GLADE_TYPE_ITEM_APPEARANCE (glade_item_appearance_get_type())
#define GLADE_IS_STOCK(pspec) \
(G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GLADE_TYPE_STOCK))
......@@ -59,7 +60,6 @@ GType glade_param_objects_get_type (void) G_GNUC_CONST;
GType glade_param_accel_get_type (void) G_GNUC_CONST;
GType glade_item_appearance_get_type (void) G_GNUC_CONST;
guint glade_builtin_key_from_string (const gchar *string);
const gchar *glade_builtin_string_from_key (guint key);
......
......@@ -338,13 +338,7 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
if (((GdkEventMotion *)ev)->is_hint)
gdk_window_get_pointer (priv->event_window, &x, &y, NULL);
else
{
x = (gint) ((GdkEventMotion *)ev)->x;
y = (gint) ((GdkEventMotion *)ev)->y;
}
child_glade_widget = glade_widget_get_from_gobject (child);
allocation = child->allocation;
......@@ -425,10 +419,9 @@ glade_design_layout_button_press_event (GtkWidget *widget, GdkEventButton *ev)
if ((child = GTK_BIN (widget)->child) == NULL)
return FALSE;
x = (gint) ((GdkEventButton *) ev)->x;
y = (gint) ((GdkEventButton *) ev)->y;
priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (widget);
gdk_window_get_pointer (priv->event_window, &x, &y, NULL);
region = glade_design_layout_get_pointer_region (GLADE_DESIGN_LAYOUT (widget), x, y);
if (((GdkEventButton *) ev)->button == 1)
......
......@@ -197,7 +197,7 @@ glade_editor_property_sensitivity_cb (GladeProperty *property,
gtk_widget_set_sensitive (eprop->check, sensitive);
}
void
static void
glade_editor_property_value_changed_cb (GladeProperty *property,
GValue *old_value,
GValue *value,
......
......@@ -511,6 +511,7 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
{
GladeCursorType operation;
GdkModifierType event_state = 0;
GladePointerMode pointer_mode;
GtkWidget *fixed_widget, *child_widget;
gint fixed_x, fixed_y, child_x, child_y;
gboolean handled = FALSE, sig_handled;
......@@ -518,6 +519,8 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
fixed_widget = GTK_WIDGET (GLADE_WIDGET (fixed)->object);
child_widget = GTK_WIDGET (child->object);
pointer_mode = glade_app_get_pointer_mode ();
/* when widget->window points to a parent window, these calculations
* would be wrong if we based them on the GTK_WIDGET (fixed)->window,
* so we must always consult the event widget's window
......@@ -545,10 +548,11 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
case GDK_MOTION_NOTIFY:
if (fixed->configuring == NULL)
{
if (event_state & GDK_SHIFT_MASK)
if ((event_state & GDK_SHIFT_MASK) ||
pointer_mode == GLADE_POINTER_DRAG_RESIZE)
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
else
else if (pointer_mode == GLADE_POINTER_SELECT)
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_SELECTOR);
......@@ -578,7 +582,9 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
/* We cant rely on GDK_BUTTON1_MASK since event->state isnt yet updated
* by the current event itself
*/
if (((GdkEventButton *)event)->button == 1 && (event_state & GDK_SHIFT_MASK))
if (((GdkEventButton *)event)->button == 1 &&
((event_state & GDK_SHIFT_MASK) ||
pointer_mode == GLADE_POINTER_DRAG_RESIZE))
{
fixed->configuring = child;
/* Save widget allocation and pointer pos */
......@@ -598,7 +604,8 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
if (((GdkEventButton *)event)->button == 1 && fixed->configuring)
{
if (event_state & GDK_SHIFT_MASK)
if ((event_state & GDK_SHIFT_MASK) ||
pointer_mode == GLADE_POINTER_DRAG_RESIZE)
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
else
......@@ -639,7 +646,7 @@ glade_fixed_child_event (GladeWidget *gwidget,
* the palette.
*/
if (GLADE_IS_FIXED (gwidget) &&
glade_palette_get_current_item (glade_app_get_palette ()) != NULL)
glade_app_get_pointer_mode() == GLADE_POINTER_ADD_WIDGET)
{
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_ADD_WIDGET);
......@@ -804,15 +811,15 @@ glade_fixed_event (GladeWidget *gwidget_fixed,
}
break;
case GDK_MOTION_NOTIFY:
if (adaptor != NULL)
if (glade_app_get_pointer_mode() == GLADE_POINTER_ADD_WIDGET)
{
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_ADD_WIDGET);
handled = TRUE;
}
/* XXX I dont think this line is needed */
else if (GLADE_IS_FIXED (gwidget_fixed->parent) == FALSE)
else if (GLADE_IS_FIXED (gwidget_fixed->parent) == FALSE &&
glade_app_get_pointer_mode() == GLADE_POINTER_SELECT)
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_SELECTOR);
break;
......
......@@ -281,7 +281,7 @@ glade_palette_item_class_init (GladePaletteItemClass *klass)
g_param_spec_enum ("appearance",
"Appearance",
"The appearance of the item",
GLADE_ITEM_APPEARANCE_TYPE,
GLADE_TYPE_ITEM_APPEARANCE,
GLADE_ITEM_ICON_ONLY,
G_PARAM_READWRITE));
......
......@@ -358,7 +358,7 @@ glade_palette_class_init (GladePaletteClass *klass)
g_param_spec_enum ("item-appearance",
"Item Appearance",
"The appearance of the palette items",
GLADE_ITEM_APPEARANCE_TYPE,
GLADE_TYPE_ITEM_APPEARANCE,
GLADE_ITEM_ICON_ONLY,
G_PARAM_READWRITE));
......@@ -410,6 +410,10 @@ glade_palette_on_button_toggled (GtkWidget *button, GladePalette *palette)
if (priv->current_item == GLADE_PALETTE_ITEM (button))
{
priv->current_item = NULL;
g_object_notify (G_OBJECT (palette), "current-item");
glade_app_set_pointer_mode (GLADE_POINTER_SELECT);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->selector_button), TRUE);
priv->sticky_selection_mode = FALSE;
......@@ -427,6 +431,10 @@ glade_palette_on_button_toggled (GtkWidget *button, GladePalette *palette)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->current_item), FALSE);
priv->current_item = GLADE_PALETTE_ITEM (button);
g_object_notify (G_OBJECT (palette), "current-item");
glade_app_set_pointer_mode (GLADE_POINTER_ADD_WIDGET);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->selector_button), FALSE);
/* check whether to enable sticky selection */
......@@ -434,7 +442,6 @@ glade_palette_on_button_toggled (GtkWidget *button, GladePalette *palette)
gdk_window_get_pointer (button->window, NULL, NULL, &mask);
priv->sticky_selection_mode = (!GWA_IS_TOPLEVEL (adaptor)) && (mask & GDK_CONTROL_MASK);
g_signal_emit (G_OBJECT (palette), glade_palette_signals[TOGGLED], 0);
}
......@@ -722,8 +729,12 @@ glade_palette_deselect_current_item (GladePalette *palette, gboolean sticky_awar
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (palette->priv->selector_button), TRUE);
palette->priv->current_item = NULL;
g_object_notify (G_OBJECT (palette), "current-item");
glade_app_set_pointer_mode (GLADE_POINTER_SELECT);
g_signal_emit (G_OBJECT (palette), glade_palette_signals[TOGGLED], 0);
}
}
......
......@@ -309,15 +309,15 @@ glade_placeholder_expose (GtkWidget *widget, GdkEventExpose *event)
static gboolean
glade_placeholder_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
{
GladeWidgetAdaptor *adaptor;
GladePointerMode pointer_mode;
GladeWidget *gparent;
g_return_val_if_fail (GLADE_IS_PLACEHOLDER (widget), FALSE);
gparent = glade_placeholder_get_parent (GLADE_PLACEHOLDER (widget));
adaptor = glade_palette_get_current_item (glade_app_get_palette ());
pointer_mode = glade_app_get_pointer_mode ();
if (adaptor == NULL &&
if (pointer_mode == GLADE_POINTER_SELECT &&
/* If we are the child of a widget that is in a GladeFixed, then
* we are the means of drag/resize and we dont want to fight for
* the cursor (ideally; GladeCursor should somehow deal with such
......@@ -326,7 +326,7 @@ glade_placeholder_motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
(gparent->parent &&
GLADE_IS_FIXED (gparent->parent)) == FALSE)
glade_cursor_set (event->window, GLADE_CURSOR_SELECTOR);
else if (adaptor)
else if (pointer_mode == GLADE_POINTER_ADD_WIDGET)
glade_cursor_set (event->window, GLADE_CURSOR_ADD_WIDGET);
return FALSE;
......
......@@ -26,6 +26,7 @@ typedef struct _GladeWidgetAdaptor GladeWidgetAdaptor;
typedef struct _GladeWidgetAdaptorPrivate GladeWidgetAdaptorPrivate;
typedef struct _GladeWidgetAdaptorClass GladeWidgetAdaptorClass;
typedef struct _GladeSignalClass GladeSignalClass;
typedef enum _GladeCreateReason GladeCreateReason;
/**
* GWA_IS_FIXED:
......@@ -121,14 +122,14 @@ typedef struct _GladeSignalClass GladeSignalClass;
*
* These are the reasons your #GladePostCreateFunc can be called.
*/
typedef enum _GladeCreateReason
enum _GladeCreateReason
{
GLADE_CREATE_USER = 0,
GLADE_CREATE_COPY,
GLADE_CREATE_LOAD,
GLADE_CREATE_REBUILD,
GLADE_CREATE_REASONS
} GladeCreateReason;
};
#define GLADE_CREATE_REASON (glade_create_reason_get_type())
......
......@@ -79,6 +79,8 @@ struct _GladeProjectWindowPrivate
gchar *default_path; /* the default path for open/save operations */
GtkToggleToolButton *selector_button; /* the widget selector button (replaces the one in the palette) */
GtkToggleToolButton *drag_resize_button; /* sets the pointer to drag/resize mode */
gboolean setting_pointer_mode; /* avoid feedback signal loops */
GtkToolItem *undo; /* customized buttons for undo/redo with history */
GtkToolItem *redo;
......@@ -710,22 +712,52 @@ gpw_construct_dock_item (GladeProjectWindow *gpw, const gchar *title, GtkWidget
return vbox;
}
void
on_palette_toggled (GladePalette *palette, GladeProjectWindow *gpw)
static void
on_selector_button_toggled (GtkToggleToolButton *button, GladeProjectWindow *gpw)
{
if (glade_palette_get_current_item (palette))
gtk_toggle_tool_button_set_active (gpw->priv->selector_button, FALSE);
if (gpw->priv->setting_pointer_mode)
return;
if (gtk_toggle_tool_button_get_active (gpw->priv->selector_button))
{
glade_palette_deselect_current_item (glade_app_get_palette(), FALSE);
glade_app_set_pointer_mode (GLADE_POINTER_SELECT);
}
else
gtk_toggle_tool_button_set_active (gpw->priv->selector_button, TRUE);
}
void
on_selector_button_toggled (GtkToggleToolButton *button, GladeProjectWindow *gpw)
static void
on_drag_resize_button_toggled (GtkToggleToolButton *button, GladeProjectWindow *gpw)
{
if (gtk_toggle_tool_button_get_active (gpw->priv->selector_button))
glade_palette_deselect_current_item (glade_app_get_palette(), FALSE);
else if (glade_palette_get_current_item (glade_app_get_palette()) == FALSE)
if (gpw->priv->setting_pointer_mode)
return;
if (gtk_toggle_tool_button_get_active (gpw->priv->drag_resize_button))
glade_app_set_pointer_mode (GLADE_POINTER_DRAG_RESIZE);
else
gtk_toggle_tool_button_set_active (gpw->priv->drag_resize_button, TRUE);
}
static void
on_pointer_mode_changed (GladeApp *app,
GParamSpec *pspec,
GladeProjectWindow *gpw)
{
gpw->priv->setting_pointer_mode = TRUE;
if (glade_app_get_pointer_mode () == GLADE_POINTER_SELECT)
gtk_toggle_tool_button_set_active (gpw->priv->selector_button, TRUE);
else
gtk_toggle_tool_button_set_active (gpw->priv->selector_button, FALSE);
if (glade_app_get_pointer_mode () == GLADE_POINTER_DRAG_RESIZE)
gtk_toggle_tool_button_set_active (gpw->priv->drag_resize_button, TRUE);
else
gtk_toggle_tool_button_set_active (gpw->priv->drag_resize_button, FALSE);
gpw->priv->setting_pointer_mode = FALSE;
}
static void
......@@ -2119,6 +2151,35 @@ create_selector_tool_button (GtkToolbar *toolbar)
return GTK_WIDGET (button);
}
static GtkWidget *
create_drag_resize_tool_button (GtkToolbar *toolbar)
{
GtkToolItem *button;
GtkWidget *image;
gchar *image_path;
image_path = g_build_filename (glade_app_get_pixmaps_dir (), "selector.png", NULL);
image = gtk_image_new_from_file (image_path);
g_free (image_path);
button = gtk_toggle_tool_button_new ();
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (button), TRUE);
gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (button), image);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (button), _("Drag Resize"));
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (button),
toolbar->tooltips,
_("Drag and resize widgets in the workspace"),
NULL);
gtk_widget_show (GTK_WIDGET (button));
gtk_widget_show (image);
return GTK_WIDGET (button);
}
static gint
gpw_hijack_editor_key_press (GtkWidget *win,
GdkEventKey *event,
......@@ -2272,19 +2333,31 @@ glade_project_window_create (GladeProjectWindow *gpw)
widget = gtk_ui_manager_get_widget (gpw->priv->ui, "/MenuBar/FileMenu/OpenRecent");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget), gpw->priv->recent_menu);
/* palette selector button */
gpw->priv->selector_button = GTK_TOGGLE_TOOL_BUTTON (create_selector_tool_button (GTK_TOOLBAR (toolbar)));
/* palette selector & drag/resize buttons */
sep = gtk_separator_tool_item_new();
gtk_widget_show (GTK_WIDGET (sep));
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (sep), -1);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (gpw->priv->selector_button), -1);
gpw->priv->selector_button =
GTK_TOGGLE_TOOL_BUTTON (create_selector_tool_button (GTK_TOOLBAR (toolbar)));
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
GTK_TOOL_ITEM (gpw->priv->selector_button), -1);
gpw->priv->drag_resize_button =
GTK_TOGGLE_TOOL_BUTTON (create_drag_resize_tool_button
(GTK_TOOLBAR (toolbar)));
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
GTK_TOOL_ITEM (gpw->priv->drag_resize_button), -1);
gtk_toggle_tool_button_set_active (gpw->priv->selector_button, TRUE);
gtk_toggle_tool_button_set_active (gpw->priv->drag_resize_button, FALSE);
g_signal_connect (G_OBJECT (glade_app_get_palette ()), "toggled",
G_CALLBACK (on_palette_toggled), gpw);
g_signal_connect (G_OBJECT (gpw->priv->selector_button), "toggled",
G_CALLBACK (on_selector_button_toggled), gpw);
g_signal_connect (G_OBJECT (gpw->priv->drag_resize_button), "toggled",
G_CALLBACK (on_drag_resize_button_toggled), gpw);
g_signal_connect (G_OBJECT (glade_app_get()), "notify::pointer-mode",
G_CALLBACK (on_pointer_mode_changed), gpw);
/* support for opening a file by dragging onto the project window */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment