1
1

1999-02-03 Miguel de Icaza <miguel@nuclecu.unam.mx>

* gscreen.c (panel_file_list_configure_contents): Make the icon on
	the type column be displayed.
	(panel_file_list_select_row): Removed dead code.
	(panel_file_list_press_row): Select the row before calling
	gpopup_do_popup.
Этот коммит содержится в:
Miguel de Icaza 1999-02-03 21:55:11 +00:00
родитель 912d258e8a
Коммит 06e379de33
2 изменённых файлов: 22 добавлений и 25 удалений

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

@ -1,3 +1,11 @@
1999-02-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gscreen.c (panel_file_list_configure_contents): Make the icon on
the type column be displayed.
(panel_file_list_select_row): Removed dead code.
(panel_file_list_press_row): Select the row before calling
gpopup_do_popup.
1999-02-03 Federico Mena Quintero <federico@nuclecu.unam.mx> 1999-02-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gscreen.c (drop_types): Allow dropping URLs on file panels. * gscreen.c (drop_types): Allow dropping URLs on file panels.

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

@ -389,12 +389,17 @@ panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width
* and compute how much space we lost to the column decorations * and compute how much space we lost to the column decorations
*/ */
lost_pixels = used_columns = expandables = items = 0; lost_pixels = used_columns = expandables = items = 0;
char_width = gdk_string_width (sw->style->font, "xW") / 2;
for (format = panel->format; format; format = format->next) { for (format = panel->format; format; format = format->next) {
format->field_len = format->requested_field_len; format->field_len = format->requested_field_len;
if (!format->use_in_gui) if (!format->use_in_gui)
continue; continue;
used_columns += format->field_len; if (format->use_in_gui == 2)
used_columns += 2;
else
used_columns += format->field_len;
items++; items++;
if (format->expand) if (format->expand)
expandables++; expandables++;
@ -409,7 +414,6 @@ panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width
lost_pixels += scrollbar_space + scrollbar_width; lost_pixels += scrollbar_space + scrollbar_width;
} }
char_width = gdk_string_width (sw->style->font, "xW") / 2;
width = main_width - lost_pixels; width = main_width - lost_pixels;
extra_pixels = width % char_width; extra_pixels = width % char_width;
@ -463,13 +467,16 @@ panel_file_list_press_row (GtkWidget *file_list, GdkEvent *event, WPanel *panel)
/* FIXME: This is still very broken. */ /* FIXME: This is still very broken. */
if (event->type == GDK_BUTTON_PRESS && event->button.button == 3) { if (event->type == GDK_BUTTON_PRESS && event->button.button == 3) {
gint row, column; gint row, column;
gtk_clist_get_selection_info (GTK_CLIST (file_list), gtk_clist_get_selection_info (GTK_CLIST (file_list),
event->button.x, event->button.y, event->button.x, event->button.y,
&row, &column); &row, &column);
gtk_clist_select_row (GTK_CLIST (file_list), row, 0);
gpopup_do_popup ((GdkEventButton *) event, panel, NULL, row, panel->dir.list[row].fname); gpopup_do_popup ((GdkEventButton *) event, panel, NULL, row, panel->dir.list[row].fname);
} }
return TRUE; return TRUE;
} }
static void static void
panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent *event, WPanel *panel) panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent *event, WPanel *panel)
{ {
@ -481,13 +488,8 @@ panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent
if (!event) if (!event)
return; return;
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS:
if (event->button.button == 3)
gpopup_do_popup ((GdkEventButton *) event, panel, NULL, row, panel->dir.list[row].fname);
break;
case GDK_BUTTON_RELEASE: case GDK_BUTTON_RELEASE:
if (event->button.button == 2){ if (event->button.button == 2){
char *fullname; char *fullname;
@ -1288,10 +1290,10 @@ panel_create_file_list (WPanel *panel)
gtk_signal_connect (GTK_OBJECT (file_list), "unselect_row", gtk_signal_connect (GTK_OBJECT (file_list), "unselect_row",
GTK_SIGNAL_FUNC (panel_file_list_unselect_row), GTK_SIGNAL_FUNC (panel_file_list_unselect_row),
panel); panel);
#if 0 #if 1
gtk_signal_connect (GTK_OBJECT (file_list), "button_press_event", gtk_signal_connect_after (GTK_OBJECT (file_list), "button_press_event",
GTK_SIGNAL_FUNC (panel_file_list_press_row), GTK_SIGNAL_FUNC (panel_file_list_press_row),
panel); panel);
#endif #endif
gtk_clist_set_button_actions (GTK_CLIST (file_list), 1, GTK_BUTTON_SELECTS | GTK_BUTTON_DRAGS); gtk_clist_set_button_actions (GTK_CLIST (file_list), 1, GTK_BUTTON_SELECTS | GTK_BUTTON_DRAGS);
gtk_clist_set_button_actions (GTK_CLIST (file_list), 2, GTK_BUTTON_SELECTS); gtk_clist_set_button_actions (GTK_CLIST (file_list), 2, GTK_BUTTON_SELECTS);
@ -1413,18 +1415,6 @@ panel_icon_renamed (GtkWidget *widget, int index, char *dest, WPanel *panel)
return FALSE; return FALSE;
} }
static void
load_imlib_icons (void)
{
static int loaded;
if (loaded)
return;
loaded = 1;
}
/* /*
* Strategy for activaing the drags from the icon-list: * Strategy for activaing the drags from the icon-list:
* *
@ -1494,7 +1484,6 @@ panel_create_icon_display (WPanel *panel)
/* Setup the icons and DnD */ /* Setup the icons and DnD */
load_imlib_icons ();
load_dnd_icons (); load_dnd_icons ();
gtk_drag_dest_set (GTK_WIDGET (ilist), gtk_drag_dest_set (GTK_WIDGET (ilist),