aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/shortcut-bar/e-group-bar.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-09-30 23:17:12 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-09-30 23:17:12 +0800
commit3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1 (patch)
tree9d58f7f4ddda2cddf31ae57d9d10c52465891d4c /widgets/shortcut-bar/e-group-bar.c
parent024c4bee0a0c289ae6f9ad2d5b9370df10ce291b (diff)
downloadgsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar.gz
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar.bz2
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar.lz
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar.xz
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.tar.zst
gsoc2013-evolution-3f23fba5e0ed7efd438c57db2e2e6ae30c7cdaa1.zip
updated to use new EShortcutBar signals for DnD.
2000-09-30 Damon Chaplin <damon@helixcode.com> * test-shortcut-bar.c: updated to use new EShortcutBar signals for DnD. * e-group-bar.c (e_group_bar_add_group): show the new windows if the EGroupBar is realized, handle the position argument properly, and fixed the window z-order code. * e-shortcut-bar.c (e_shortcut_bar_add_group): pass group_num to the e_group_bar_add_group() function. * e-icon-bar-bg-item.c (e_icon_bar_bg_item_draw): fixed SEGV when trying to drag into a group with no items. svn path=/trunk/; revision=5643
Diffstat (limited to 'widgets/shortcut-bar/e-group-bar.c')
-rw-r--r--widgets/shortcut-bar/e-group-bar.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/widgets/shortcut-bar/e-group-bar.c b/widgets/shortcut-bar/e-group-bar.c
index dd78fe6243..b5aa471d0e 100644
--- a/widgets/shortcut-bar/e-group-bar.c
+++ b/widgets/shortcut-bar/e-group-bar.c
@@ -914,8 +914,11 @@ e_group_bar_add_group (EGroupBar *group_bar,
/* Append an empty group to the children array and get a pointer to
it, so we can use it like a normal group. */
- group_num = group_bar->children->len;
- g_array_append_val (group_bar->children, empty_group);
+ if (position == -1)
+ group_num = group_bar->children->len;
+ else
+ group_num = position;
+ g_array_insert_val (group_bar->children, group_num, empty_group);
group = &g_array_index (group_bar->children,
EGroupBarChild, group_num);
@@ -929,26 +932,32 @@ e_group_bar_add_group (EGroupBar *group_bar,
group->button_window_target_y = 0;
group->child_window_target_y = 0;
- /* If we don't have a current group, set it to the first one. */
+ /* If we don't have a current group, set it to the first one.
+ Move the currently shown group index forward if necessary. */
if (group_bar->current_group_num == -1)
group_bar->current_group_num = 0;
+ else if (group_bar->current_group_num >= group_num)
+ group_bar->current_group_num++;
/* If the EGroupBar widget is realize, we need to create the child
windows to put the button & child in. */
if (GTK_WIDGET_REALIZED (group_bar)) {
e_group_bar_create_group_button_window (group_bar, group_num);
+ gdk_window_show (group->button_window);
+
e_group_bar_create_group_child_window (group_bar, group_num);
+ gdk_window_show (group->child_window);
/* We need to lower all the child windows of the previous
groups, in reverse order, to keep the stacking order
correct. */
- for (tmp_group_num = group_num - 1;
+ for (tmp_group_num = group_num;
tmp_group_num >= 0;
tmp_group_num--) {
tmp_group = &g_array_index (group_bar->children,
EGroupBarChild,
tmp_group_num);
- gdk_window_lower (group->child_window);
+ gdk_window_lower (tmp_group->child_window);
}
}
@@ -1136,6 +1145,7 @@ e_group_bar_set_current_group_num (EGroupBar *group_bar,
/* The positions will be sorted out when the widget's size is
allocated. */
group_bar->current_group_num = group_num;
+ gtk_widget_queue_resize (GTK_WIDGET (group_bar));
}
}