Commit dce368dd authored by John Sullivan's avatar John Sullivan

Remove button now has a little padding; clicking it now moves the selection

to the next item in the list.
parent fd8bad00
2000-01-04 John Sullivan <sullivan@eazel.com>
* src/nautilus-bookmarks-menu.c: comment changes only
* src/nautilus-bookmarks-window.c:
(create_bookmarks_window): added padding to "Remove" button
so it isn't so scrawny.
(on_remove_button_clicked): Removed item from clist explicitly
instead of relying on notification that bookmark list changed;
this correctly moves the selection to the next item instead of
jumping it back to the top of the list.
2000-01-04 Darin Adler <darin@eazel.com>
A couple of quick fixes to make "make check" work again.
......
......@@ -134,8 +134,6 @@ bookmark_activated_cb(GtkMenuItem* item, gpointer func_data)
nautilus_window_goto_uri(menu->window,
nautilus_bookmark_get_uri(
nautilus_bookmarklist_item_at(bookmarks, item_index)));
/* FIXME: bookmark created for this signal is never destroyed. */
}
static void
......@@ -144,11 +142,13 @@ edit_bookmarks_cb(GtkMenuItem* item, gpointer ignored)
GtkWidget *gtk_window = get_bookmarks_window();
if (GTK_WIDGET_VISIBLE(gtk_window))
{
// Handle behind-other-windows and iconified cases.
// This successfully leaves the window in its original position
// on top of other windows, but unfortunately does not always leave the
// window with focus. Changing window focus programatically is an
// X no-no that we'd like to find a workaround for.
/*
* Handle behind-other-windows and iconified cases.
* This successfully leaves the window in its original position
* on top of other windows, but unfortunately does not always leave the
* window with focus. Changing window focus programatically is an
* X no-no that we'd like to find a workaround for.
*/
gdk_window_show(gtk_window->window);
}
else
......
......@@ -173,6 +173,9 @@ create_bookmarks_window(NautilusBookmarklist *list)
gtk_box_pack_start (GTK_BOX (right_side), hbox2, FALSE, FALSE, 0);
remove_button = gtk_button_new_with_label (_("Remove"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN(remove_button)->child),
GNOME_PAD_SMALL,
GNOME_PAD_SMALL);
gtk_widget_ref (remove_button);
gtk_widget_show (remove_button);
gtk_box_pack_start (GTK_BOX (hbox2), remove_button, TRUE, FALSE, 0);
......@@ -284,7 +287,19 @@ static void
on_remove_button_clicked (GtkButton *button,
gpointer user_data)
{
g_assert(GTK_IS_CLIST(bookmark_list_widget));
/* Turn off list updating since we're handling the list widget explicitly.
* This allows the selection to move to the next row, instead of leaping
* back to the top.
*/
gtk_signal_handler_block(GTK_OBJECT(bookmarks),
bookmarklist_changed_signalID);
nautilus_bookmarklist_delete_item_at(bookmarks, get_selected_row());
gtk_signal_handler_unblock(GTK_OBJECT(bookmarks),
bookmarklist_changed_signalID);
gtk_clist_remove(GTK_CLIST(bookmark_list_widget), get_selected_row());
}
......@@ -296,10 +311,6 @@ on_row_move (GtkCList *clist,
{
NautilusBookmark *bookmark;
g_assert(clist == GTK_CLIST(bookmark_list_widget));
g_assert(GTK_IS_ENTRY(name_field));
g_assert(GTK_IS_ENTRY(uri_field));
bookmark = nautilus_bookmark_copy(
nautilus_bookmarklist_item_at(bookmarks, old_row));
......@@ -325,7 +336,6 @@ on_select_row (GtkCList *clist,
{
const NautilusBookmark *selected;
g_assert(clist == GTK_CLIST(bookmark_list_widget));
g_assert(GTK_IS_ENTRY(name_field));
g_assert(GTK_IS_ENTRY(uri_field));
......
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