diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2000-07-06 21:46:58 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2000-07-06 21:46:58 +0000 |
commit | 3cc4d73954489d161ea604a77c0620754064b644 (patch) | |
tree | 1d28e1289968e50c8dd0ae901f73a318a1b8ebf2 /src | |
parent | 67d85d6f3aaee4759bbe8d1284f90829afb7f7b8 (diff) | |
download | nautilus-3cc4d73954489d161ea604a77c0620754064b644.tar.gz |
fixed long-standing bug where the sidebar tabs would display the wrong
fixed long-standing bug where the sidebar tabs would display the
wrong view by decrementing the appropriate index when a view
is removed; gave sidebar views more room and solved the variable
height problem by hiding the sidebar title when a sidebar view
is displayed; reduced slop on splitter to avoid accidental
toggling; and some new images from Susan.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-information-panel.c | 11 | ||||
-rw-r--r-- | src/nautilus-sidebar-tabs.c | 12 | ||||
-rw-r--r-- | src/nautilus-sidebar.c | 11 |
3 files changed, 25 insertions, 9 deletions
diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index 83089480c..fbd82e14e 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -230,7 +230,7 @@ nautilus_sidebar_initialize (GtkObject *object) GTK_WIDGET (sidebar->details->title), FALSE, FALSE, GNOME_PAD); - /* first, allocate the index tabs */ + /* allocate the index tabs */ sidebar->details->sidebar_tabs = NAUTILUS_SIDEBAR_TABS (nautilus_sidebar_tabs_new ()); sidebar->details->selected_index = -1; @@ -825,7 +825,8 @@ nautilus_sidebar_activate_panel (NautilusSidebar *sidebar, int which_view) g_free (title); /* hide the buttons, since they look confusing when partially overlapped */ - gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->title)); gtk_notebook_set_page (notebook, which_view); } @@ -839,7 +840,8 @@ nautilus_sidebar_deactivate_panel(NautilusSidebar *sidebar) gtk_widget_hide (GTK_WIDGET (sidebar->details->title_tab)); } - gtk_widget_show (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_show (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_show (GTK_WIDGET (sidebar->details->title)); sidebar->details->selected_index = -1; nautilus_sidebar_tabs_select_tab (sidebar->details->sidebar_tabs, -1); } @@ -1251,7 +1253,8 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar) /* Hide button box if a sidebar panel is showing. */ if (sidebar->details->selected_index != -1) { - gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->title)); } } } diff --git a/src/nautilus-sidebar-tabs.c b/src/nautilus-sidebar-tabs.c index 1ab487db2..fba13a368 100644 --- a/src/nautilus-sidebar-tabs.c +++ b/src/nautilus-sidebar-tabs.c @@ -776,8 +776,10 @@ nautilus_sidebar_tabs_get_title_from_index (NautilusSidebarTabs *sidebar_tabs, i void nautilus_sidebar_tabs_remove_view (NautilusSidebarTabs *sidebar_tabs, const char *name) { + GList *next_tab; TabItem *tab_item; - + int old_page_number; + g_return_if_fail (NAUTILUS_IS_SIDEBAR_TABS (sidebar_tabs)); g_return_if_fail (name != NULL); @@ -792,8 +794,16 @@ nautilus_sidebar_tabs_remove_view (NautilusSidebarTabs *sidebar_tabs, const char /* Remove the item from the list */ sidebar_tabs->details->tab_items = g_list_remove (sidebar_tabs->details->tab_items, tab_item); + old_page_number = tab_item->notebook_page; tab_item_destroy (tab_item); + /* decrement all page numbers greater than the one we're removing */ + for (next_tab = sidebar_tabs->details->tab_items; next_tab != NULL; next_tab = next_tab->next) { + TabItem *item = next_tab->data; + if (item->notebook_page >= old_page_number) + item->notebook_page -= 1; + } + sidebar_tabs->details->tab_count -= 1; recalculate_size (sidebar_tabs); diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index 83089480c..fbd82e14e 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -230,7 +230,7 @@ nautilus_sidebar_initialize (GtkObject *object) GTK_WIDGET (sidebar->details->title), FALSE, FALSE, GNOME_PAD); - /* first, allocate the index tabs */ + /* allocate the index tabs */ sidebar->details->sidebar_tabs = NAUTILUS_SIDEBAR_TABS (nautilus_sidebar_tabs_new ()); sidebar->details->selected_index = -1; @@ -825,7 +825,8 @@ nautilus_sidebar_activate_panel (NautilusSidebar *sidebar, int which_view) g_free (title); /* hide the buttons, since they look confusing when partially overlapped */ - gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->title)); gtk_notebook_set_page (notebook, which_view); } @@ -839,7 +840,8 @@ nautilus_sidebar_deactivate_panel(NautilusSidebar *sidebar) gtk_widget_hide (GTK_WIDGET (sidebar->details->title_tab)); } - gtk_widget_show (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_show (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_show (GTK_WIDGET (sidebar->details->title)); sidebar->details->selected_index = -1; nautilus_sidebar_tabs_select_tab (sidebar->details->sidebar_tabs, -1); } @@ -1251,7 +1253,8 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar) /* Hide button box if a sidebar panel is showing. */ if (sidebar->details->selected_index != -1) { - gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->button_box_centerer)); + gtk_widget_hide (GTK_WIDGET (sidebar->details->title)); } } } |