aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/shortcut-bar/e-shortcut-bar.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-04-16 21:21:26 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-04-16 21:21:26 +0800
commit13a168017cd5b6d8907293a56732dc6f88ec4400 (patch)
tree235538aabba7939b2249750730b4632f13d0ca08 /widgets/shortcut-bar/e-shortcut-bar.c
parent23c29cbcf654883e1243f51adb4bfe3556477cff (diff)
downloadgsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.gz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.bz2
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.lz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.xz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.zst
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.zip
added buttons to test moving/reordering groups.
2000-04-16 Damon Chaplin <damon@helixcode.com> * test-shortcut-bar.c: added buttons to test moving/reordering groups. * e-shortcut-bar.c (e_shortcut_bar_on_drag_end): new function to free the dragged name & URL when the drag is finished. * e-group-bar.c (e_group_bar_get_increment): fixed bug when distance was 0. Should just return 0. (e_group_bar_set_current_group_num): added animate option and finished. (e_group_bar_unmap): called e_group_bar_stop_all_animation(). (e_group_bar_reorder_group): finished. * e-icon-bar-text-item.[hc]: removed, since we now use EText. svn path=/trunk/; revision=2459
Diffstat (limited to 'widgets/shortcut-bar/e-shortcut-bar.c')
-rw-r--r--widgets/shortcut-bar/e-shortcut-bar.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/widgets/shortcut-bar/e-shortcut-bar.c b/widgets/shortcut-bar/e-shortcut-bar.c
index 6fc50dd41a..5195f2d856 100644
--- a/widgets/shortcut-bar/e-shortcut-bar.c
+++ b/widgets/shortcut-bar/e-shortcut-bar.c
@@ -78,6 +78,9 @@ static void e_shortcut_bar_on_drag_data_received (GtkWidget *widget,
static void e_shortcut_bar_on_drag_data_delete (GtkWidget *widget,
GdkDragContext *context,
EShortcutBar *shortcut_bar);
+static void e_shortcut_bar_on_drag_end (GtkWidget *widget,
+ GdkDragContext *context,
+ EShortcutBar *shortcut_bar);
static void e_shortcut_bar_stop_editing (GtkWidget *button,
EShortcutBar *shortcut_bar);
static GdkPixbuf* e_shortcut_bar_get_image_from_url (EShortcutBar *shortcut_bar,
@@ -154,6 +157,9 @@ e_shortcut_bar_init (EShortcutBar *shortcut_bar)
{
shortcut_bar->groups = g_array_new (FALSE, FALSE,
sizeof (EShortcutBarGroup));
+
+ shortcut_bar->dragged_url = NULL;
+ shortcut_bar->dragged_name = NULL;
}
@@ -228,6 +234,9 @@ e_shortcut_bar_add_group (EShortcutBar *shortcut_bar, gchar *group_name)
gtk_signal_connect (GTK_OBJECT (group->icon_bar), "drag_data_delete",
GTK_SIGNAL_FUNC (e_shortcut_bar_on_drag_data_delete),
shortcut_bar);
+ gtk_signal_connect (GTK_OBJECT (group->icon_bar), "drag_end",
+ GTK_SIGNAL_FUNC (e_shortcut_bar_on_drag_end),
+ shortcut_bar);
e_shortcut_bar_set_canvas_style (shortcut_bar, group->icon_bar);
@@ -382,7 +391,6 @@ e_shortcut_bar_item_dragged (EIconBar *icon_bar,
group_num = e_group_bar_get_group_num (E_GROUP_BAR (shortcut_bar),
GTK_WIDGET (icon_bar)->parent);
- /* FIXME: free both somewhere - drag_end? */
shortcut_bar->dragged_url = g_strdup (e_icon_bar_get_item_data (icon_bar, item_num));
shortcut_bar->dragged_name = e_icon_bar_get_item_text (icon_bar, item_num);
@@ -474,6 +482,19 @@ e_shortcut_bar_on_drag_data_delete (GtkWidget *widget,
}
+static void
+e_shortcut_bar_on_drag_end (GtkWidget *widget,
+ GdkDragContext *context,
+ EShortcutBar *shortcut_bar)
+{
+ g_free (shortcut_bar->dragged_name);
+ shortcut_bar->dragged_name = NULL;
+
+ g_free (shortcut_bar->dragged_url);
+ shortcut_bar->dragged_url = NULL;
+}
+
+
void
e_shortcut_bar_start_editing_item (EShortcutBar *shortcut_bar,
gint group_num,