mirror of https://github.com/MidnightCommander/mc
1999-01-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_drag_data_received): Do not force links on the desktop. * gscreen.c (panel_create_file_list): Do not use GTK_DEST_DEFAULT_ALL for the drop site. Only use GTK_DEST_DEFAULT_DROP, since we need to check motion ourselves. (panel_clist_drag_motion): Do not allow dropping on the clist buttons. (panel_clist_button_press): Do not assign the panel->maybe_drag_start flag if the user clicked outside the clist_window. * gdesktop.h: Removed old crud (desktop_icon_t, icon_t).
This commit is contained in:
parent
6f7a1992e7
commit
7dec59687e
|
@ -1,3 +1,19 @@
|
|||
1999-01-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (desktop_drag_data_received): Do not force links on
|
||||
the desktop.
|
||||
|
||||
* gscreen.c (panel_create_file_list): Do not use
|
||||
GTK_DEST_DEFAULT_ALL for the drop site. Only use
|
||||
GTK_DEST_DEFAULT_DROP, since we need to check motion ourselves.
|
||||
(panel_clist_drag_motion): Do not allow dropping on the clist buttons.
|
||||
(panel_clist_button_press): Do not assign the
|
||||
panel->maybe_drag_start flag if the user clicked outside the clist_window.
|
||||
|
||||
* gdesktop.h: Removed old crud (desktop_icon_t, icon_t).
|
||||
|
||||
* gscreen.c (drag_types, drop_types): Use the constants from gdnd.h.
|
||||
|
||||
1999-01-21 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gnome-file-property-dialog.c (apply_uid_group_change): uh, lets
|
||||
|
|
|
@ -1676,15 +1676,6 @@ desktop_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x,
|
|||
break;
|
||||
|
||||
case TARGET_URI_LIST:
|
||||
/*
|
||||
* Unless the user is dragging with button-2 (ask action)
|
||||
* drops on the desktop will be symlinks.
|
||||
*
|
||||
* I have got enough complaints as it is.
|
||||
*/
|
||||
if (context->suggested_action != GDK_ACTION_ASK)
|
||||
context->suggested_action = GDK_ACTION_LINK;
|
||||
|
||||
retval = gdnd_drop_on_directory (context, data, desktop_directory);
|
||||
if (retval)
|
||||
reload_desktop_icons (x, y);
|
||||
|
|
|
@ -8,8 +8,10 @@
|
|||
|
||||
#ifndef GDESKTOP_H
|
||||
#define GDESKTOP_H
|
||||
|
||||
#include "dir.h"
|
||||
|
||||
|
||||
/* Snap granularity for desktop icons -- maybe these should be calculated in
|
||||
* terms of the font size?
|
||||
*/
|
||||
|
@ -48,22 +50,6 @@ void desktop_icon_info_destroy (DesktopIconInfo *dii);
|
|||
void desktop_icon_info_open (DesktopIconInfo *dii);
|
||||
void desktop_icon_info_delete (DesktopIconInfo *dii);
|
||||
|
||||
typedef enum {
|
||||
application,
|
||||
directory,
|
||||
file
|
||||
} icon_t;
|
||||
|
||||
/* A structure that describes each icon on the desktop */
|
||||
typedef struct {
|
||||
GnomeDesktopEntry *dentry;
|
||||
GtkWidget *widget;
|
||||
icon_t type;
|
||||
int x, y;
|
||||
int grid_x, grid_y;
|
||||
char *pathname;
|
||||
} desktop_icon_t;
|
||||
|
||||
file_entry *file_entry_from_file (char *filename);
|
||||
void file_entry_free (file_entry *fe);
|
||||
|
||||
|
|
|
@ -62,13 +62,13 @@ GdkPixmap *icon_dev_pixmap;
|
|||
GdkBitmap *icon_dev_mask;
|
||||
|
||||
static GtkTargetEntry drag_types [] = {
|
||||
{ "text/uri-list", 0, TARGET_URI_LIST },
|
||||
{ "text/plain", 0, TARGET_TEXT_PLAIN },
|
||||
{ "_NETSCAPE_URL", 0, TARGET_URL }
|
||||
{ TARGET_URI_LIST_TYPE, 0, TARGET_URI_LIST },
|
||||
{ TARGET_TEXT_PLAIN_TYPE, 0, TARGET_TEXT_PLAIN },
|
||||
{ TARGET_URL_TYPE, 0, TARGET_URL }
|
||||
};
|
||||
|
||||
static GtkTargetEntry drop_types [] = {
|
||||
{ "text/uri-list", 0, TARGET_URI_LIST }
|
||||
{ TARGET_URI_LIST_TYPE, 0, TARGET_URI_LIST }
|
||||
};
|
||||
|
||||
#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
|
||||
|
@ -899,6 +899,9 @@ load_dnd_icons (void)
|
|||
static int
|
||||
panel_clist_button_press (GtkWidget *widget, GdkEventButton *event, WPanel *panel)
|
||||
{
|
||||
if (event->window != GTK_CLIST (widget)->clist_window)
|
||||
return FALSE;
|
||||
|
||||
panel->maybe_start_drag = event->button;
|
||||
|
||||
panel->click_x = event->x;
|
||||
|
@ -1029,8 +1032,15 @@ static gboolean
|
|||
panel_clist_drag_motion (GtkWidget *widget, GdkDragContext *ctx, int x, int y, guint time, void *data)
|
||||
{
|
||||
WPanel *panel = data;
|
||||
|
||||
panel_setup_drag_motion (panel, x, y, panel_clist_scrolling_is_desirable, panel_clist_scroll);
|
||||
|
||||
if (ctx->dest_window != GTK_CLIST (widget)->clist_window)
|
||||
gdk_drag_status (ctx, 0, time);
|
||||
else {
|
||||
panel_setup_drag_motion (panel, x, y,
|
||||
panel_clist_scrolling_is_desirable, panel_clist_scroll);
|
||||
gdk_drag_status (ctx, ctx->suggested_action, time);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1189,7 +1199,7 @@ panel_create_file_list (WPanel *panel)
|
|||
|
||||
load_dnd_icons ();
|
||||
|
||||
gtk_drag_dest_set (GTK_WIDGET (file_list), GTK_DEST_DEFAULT_ALL,
|
||||
gtk_drag_dest_set (GTK_WIDGET (file_list), GTK_DEST_DEFAULT_DROP,
|
||||
drop_types, ELEMENTS (drop_types),
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
|
||||
|
||||
|
|
Loading…
Reference in New Issue