1
1

use notebook instead of hack, fixes

Этот коммит содержится в:
Miguel de Icaza 1998-12-30 00:32:41 +00:00
родитель 282e95805b
Коммит 94d3dbac8b
6 изменённых файлов: 50 добавлений и 51 удалений

Просмотреть файл

@ -1,3 +1,14 @@
1998-12-29 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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 <nwarmuth@privat.circular.de> Tue Dec 29 16:55:24 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
* gmain.c: According to the man page the color keyword for executable * gmain.c: According to the man page the color keyword for executable

Просмотреть файл

@ -103,17 +103,11 @@ desktop_icon_init (DesktopIcon *dicon)
gtk_window_set_wmclass (GTK_WINDOW (dicon), "desktop_icon", "gmc"); gtk_window_set_wmclass (GTK_WINDOW (dicon), "desktop_icon", "gmc");
/* Create the canvas */ /* Create the canvas */
gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
dicon->canvas = gnome_canvas_new (); dicon->canvas = gnome_canvas_new ();
gtk_signal_connect (GTK_OBJECT (dicon->canvas), "size_allocate", gtk_signal_connect (GTK_OBJECT (dicon->canvas), "size_allocate",
(GtkSignalFunc) canvas_size_allocated, (GtkSignalFunc) canvas_size_allocated,
NULL); NULL);
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
gtk_container_add (GTK_CONTAINER (dicon), dicon->canvas); gtk_container_add (GTK_CONTAINER (dicon), dicon->canvas);
gtk_widget_show (dicon->canvas); gtk_widget_show (dicon->canvas);

Просмотреть файл

@ -117,15 +117,21 @@ find_panel_owning_window (GdkDragContext *context)
* specified destination directory. * specified destination directory.
*/ */
static void 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) { switch (action) {
case GDK_ACTION_COPY: 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; break;
case GDK_ACTION_MOVE: 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; break;
default: default:
@ -224,7 +230,7 @@ perform_action (GList *names, GdkDragAction action, char *destdir)
copy_file_file ( copy_file_file (
name, dest_name, name, dest_name,
TRUE, TRUE,
&count, &bytes); &count, &bytes, 1);
else else
move_file_file ( move_file_file (
name, dest_name, name, dest_name,
@ -263,6 +269,7 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat
if (action == GDK_ACTION_ASK) if (action == GDK_ACTION_ASK)
return FALSE; return FALSE;
} else } else
action = context->suggested_action; action = context->suggested_action;
@ -273,7 +280,7 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat
/* Symlinks do not use file.c */ /* Symlinks do not use file.c */
if (source_panel && action != GDK_ACTION_LINK) 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 { else {
names = gnome_uri_list_extract_uris (selection_data->data); names = gnome_uri_list_extract_uris (selection_data->data);

Просмотреть файл

@ -505,6 +505,7 @@ create_panels (void)
GList *p, *g; GList *p, *g;
char *geo; char *geo;
WPanel *panel; WPanel *panel;
#if 1 #if 1
desktop_init (); desktop_init ();
#else #else

Просмотреть файл

@ -1524,7 +1524,7 @@ display_mini_info (WPanel *panel)
return; return;
} }
if (panel->estimated_total){ if (panel->estimated_total > 8){
int len = panel->estimated_total; int len = panel->estimated_total;
char *buffer; 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 *status_line, *filter, *vbox, *ministatus_box;
GtkWidget *frame, *cwd, *back_p, *fwd_p, *up_p; GtkWidget *frame, *cwd, *back_p, *fwd_p, *up_p;
GtkWidget *hbox, *evbox, *dock; GtkWidget *hbox, *evbox, *dock, *box;
GtkWidget *display, *table_frame; GtkWidget *table_frame;
int display;
panel->xwindow = gtk_widget_get_toplevel (GTK_WIDGET (panel->widget.wdata)); panel->xwindow = gtk_widget_get_toplevel (GTK_WIDGET (panel->widget.wdata));
panel->table = gtk_table_new (2, 1, 0); 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 * 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->icons = panel_create_icon_display (panel);
panel->scrollbar = gtk_vscrollbar_new (GNOME_ICON_LIST (panel->icons)->adj); panel->scrollbar = gtk_vscrollbar_new (GNOME_ICON_LIST (panel->icons)->adj);
gtk_widget_show (panel->scrollbar); 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->icons);
gtk_widget_ref (panel->list); gtk_widget_ref (panel->list);
if (panel->list_type == list_icons) box = gtk_hbox_new (FALSE, 0);
display = panel->icons; gtk_box_pack_start (GTK_BOX (box), panel->icons, TRUE, TRUE, 0);
else gtk_box_pack_end (GTK_BOX (box), panel->scrollbar, FALSE, TRUE, 0);
display = panel->list;
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 * 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); gtk_container_add (GTK_CONTAINER (table_frame), panel->view_table);
/* Add both the icon view and the listing view */ /* 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,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0); 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_table_attach (GTK_TABLE (panel->table), panel->pane, 0, 1, 1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@ -2270,24 +2272,12 @@ paint_frame (WPanel *panel)
void void
x_reset_sort_labels (WPanel *panel) x_reset_sort_labels (WPanel *panel)
{ {
if (panel->list_type == list_icons){ if (!panel->notebook)
if (panel->icons){ return;
gtk_widget_show (panel->icons);
gtk_widget_show (panel->scrollbar); gtk_notebook_set_page (
} GTK_NOTEBOOK (panel->notebook),
if (panel->list) panel->list_type == list_icons ? 0 : 1);
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);
}
}
} }
/* Releases all of the X resources allocated */ /* Releases all of the X resources allocated */

Просмотреть файл

@ -522,12 +522,8 @@ gtk_dtree_new (void)
{ {
GtkWidget *widget; 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); widget = gtk_type_new (GTK_TYPE_DTREE);
gtk_dtree_construct (GTK_DTREE (widget)); gtk_dtree_construct (GTK_DTREE (widget));
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
return widget; return widget;
} }