diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 7159d9888..da2afaaa4 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,14 @@ +1998-12-29 Miguel de Icaza + + * gscreen.c (panel_create_file_list): Use a notebook instead of + the hack I was using before for switching the panel contents. + + * gtkdtree.c (gtk_dtree_new): We now rely on the whole code to be + running in the proper visual. The more I look at this, the more + desires I have to do a proper imlib. + + * gdesktop-icon.c (desktop_icon_init): ditto. + Tue Dec 29 16:55:24 1998 Norbert Warmuth * gmain.c: According to the man page the color keyword for executable diff --git a/gnome/gdesktop-icon.c b/gnome/gdesktop-icon.c index bb2e8cde1..8bcab4cd5 100644 --- a/gnome/gdesktop-icon.c +++ b/gnome/gdesktop-icon.c @@ -103,17 +103,11 @@ desktop_icon_init (DesktopIcon *dicon) gtk_window_set_wmclass (GTK_WINDOW (dicon), "desktop_icon", "gmc"); /* Create the canvas */ - gtk_widget_push_visual (gdk_imlib_get_visual ()); - gtk_widget_push_colormap (gdk_imlib_get_colormap ()); - dicon->canvas = gnome_canvas_new (); gtk_signal_connect (GTK_OBJECT (dicon->canvas), "size_allocate", (GtkSignalFunc) canvas_size_allocated, NULL); - gtk_widget_pop_colormap (); - gtk_widget_pop_visual (); - gtk_container_add (GTK_CONTAINER (dicon), dicon->canvas); gtk_widget_show (dicon->canvas); diff --git a/gnome/gdnd.c b/gnome/gdnd.c index edc340064..30364ed6c 100644 --- a/gnome/gdnd.c +++ b/gnome/gdnd.c @@ -117,15 +117,21 @@ find_panel_owning_window (GdkDragContext *context) * specified destination directory. */ static void -perform_action_on_panel (WPanel *source_panel, GdkDragAction action, char *destdir) +perform_action_on_panel (WPanel *source_panel, GdkDragAction action, char *destdir, int ask) { switch (action) { case GDK_ACTION_COPY: - panel_operate_def (source_panel, OP_COPY, destdir); + if (ask) + panel_operate (source_panel, OP_COPY, destdir); + else + panel_operate_def (source_panel, OP_COPY, destdir); break; case GDK_ACTION_MOVE: - panel_operate_def (source_panel, OP_MOVE, destdir); + if (ask) + panel_operate (source_panel, OP_MOVE, destdir); + else + panel_operate_def (source_panel, OP_MOVE, destdir); break; default: @@ -224,7 +230,7 @@ perform_action (GList *names, GdkDragAction action, char *destdir) copy_file_file ( name, dest_name, TRUE, - &count, &bytes); + &count, &bytes, 1); else move_file_file ( name, dest_name, @@ -263,6 +269,7 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat if (action == GDK_ACTION_ASK) return FALSE; + } else action = context->suggested_action; @@ -273,7 +280,7 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat /* Symlinks do not use file.c */ if (source_panel && action != GDK_ACTION_LINK) - perform_action_on_panel (source_panel, action, destdir); + perform_action_on_panel (source_panel, action, destdir, context->suggested_action == GDK_ACTION_ASK); else { names = gnome_uri_list_extract_uris (selection_data->data); diff --git a/gnome/gmain.c b/gnome/gmain.c index fa190bcba..b43b799f4 100644 --- a/gnome/gmain.c +++ b/gnome/gmain.c @@ -505,6 +505,7 @@ create_panels (void) GList *p, *g; char *geo; WPanel *panel; + #if 1 desktop_init (); #else diff --git a/gnome/gscreen.c b/gnome/gscreen.c index c5bb71f51..c3231692d 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -1524,7 +1524,7 @@ display_mini_info (WPanel *panel) return; } - if (panel->estimated_total){ + if (panel->estimated_total > 8){ int len = panel->estimated_total; char *buffer; @@ -2001,9 +2001,10 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) { GtkWidget *status_line, *filter, *vbox, *ministatus_box; GtkWidget *frame, *cwd, *back_p, *fwd_p, *up_p; - GtkWidget *hbox, *evbox, *dock; - GtkWidget *display, *table_frame; - + GtkWidget *hbox, *evbox, *dock, *box; + GtkWidget *table_frame; + int display; + panel->xwindow = gtk_widget_get_toplevel (GTK_WIDGET (panel->widget.wdata)); panel->table = gtk_table_new (2, 1, 0); @@ -2022,6 +2023,10 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) /* * Icon and Listing display */ + panel->notebook = gtk_notebook_new (); + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (panel->notebook), FALSE); + gtk_widget_show (panel->notebook); + panel->icons = panel_create_icon_display (panel); panel->scrollbar = gtk_vscrollbar_new (GNOME_ICON_LIST (panel->icons)->adj); gtk_widget_show (panel->scrollbar); @@ -2030,11 +2035,17 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) gtk_widget_ref (panel->icons); gtk_widget_ref (panel->list); - if (panel->list_type == list_icons) - display = panel->icons; - else - display = panel->list; + box = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (box), panel->icons, TRUE, TRUE, 0); + gtk_box_pack_end (GTK_BOX (box), panel->scrollbar, FALSE, TRUE, 0); + gtk_notebook_append_page (GTK_NOTEBOOK (panel->notebook), box, NULL); + gtk_notebook_append_page (GTK_NOTEBOOK (panel->notebook), panel->list, NULL); + gtk_notebook_set_page (GTK_NOTEBOOK (panel->notebook), panel->list_type == list_icons ? 0 : 1); + gtk_widget_show_all (box); + gtk_widget_show (panel->list); + gtk_widget_show (panel->notebook); + /* * Pane */ @@ -2150,19 +2161,10 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) gtk_container_add (GTK_CONTAINER (table_frame), panel->view_table); /* Add both the icon view and the listing view */ - gtk_table_attach (GTK_TABLE (panel->view_table), panel->icons, 0, 1, 0, 1, + gtk_table_attach (GTK_TABLE (panel->view_table), panel->notebook, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); - gtk_table_attach (GTK_TABLE (panel->view_table), panel->scrollbar, 1, 2, 0, 1, - 0, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, - 0, 0); - gtk_table_attach (GTK_TABLE (panel->view_table), panel->list, 0, 1, 0, 1, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, - 0, 0); - gtk_widget_show (display); gtk_table_attach (GTK_TABLE (panel->table), panel->pane, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL | GTK_SHRINK, @@ -2270,24 +2272,12 @@ paint_frame (WPanel *panel) void x_reset_sort_labels (WPanel *panel) { - if (panel->list_type == list_icons){ - if (panel->icons){ - gtk_widget_show (panel->icons); - gtk_widget_show (panel->scrollbar); - } - if (panel->list) - gtk_widget_hide (panel->list); - } else { - panel_switch_new_display_mode (panel); - if (panel->list){ - gtk_widget_show (panel->list); - gtk_widget_show (panel->scrollbar); - } - if (panel->icons){ - gtk_widget_hide (panel->icons); - gtk_widget_hide (panel->scrollbar); - } - } + if (!panel->notebook) + return; + + gtk_notebook_set_page ( + GTK_NOTEBOOK (panel->notebook), + panel->list_type == list_icons ? 0 : 1); } /* Releases all of the X resources allocated */ diff --git a/gnome/gtkdtree.c b/gnome/gtkdtree.c index 8686f76eb..9fde903d9 100644 --- a/gnome/gtkdtree.c +++ b/gnome/gtkdtree.c @@ -522,12 +522,8 @@ gtk_dtree_new (void) { GtkWidget *widget; - gtk_widget_push_visual (gdk_imlib_get_visual ()); - gtk_widget_push_colormap (gdk_imlib_get_colormap ()); widget = gtk_type_new (GTK_TYPE_DTREE); gtk_dtree_construct (GTK_DTREE (widget)); - gtk_widget_pop_colormap (); - gtk_widget_pop_visual (); return widget; }