diff options
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-field-chooser-dialog.c | 2 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser-item.c | 8 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser.c | 6 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser.glade | 17 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 26 |
5 files changed, 27 insertions, 32 deletions
diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index c4be650bf1..b218f07c73 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -96,6 +96,8 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos GNOME_STOCK_BUTTON_CLOSE, NULL); + gtk_window_set_policy(GTK_WINDOW(e_table_field_chooser_dialog), FALSE, TRUE, FALSE); + widget = e_table_field_chooser_new(); e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER(widget); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 4d0d03b0d4..e23fc4c9f5 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -150,6 +150,7 @@ etfci_drop_table_header (ETableFieldChooserItem *etfci) gtk_object_unref (header); etfci->full_header = NULL; etfci->height = 0; + e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } static void @@ -280,6 +281,7 @@ etfci_realize (GnomeCanvasItem *item) etfci->drag_data_get_id = gtk_signal_connect ( GTK_OBJECT (item->canvas), "drag_data_get", GTK_SIGNAL_FUNC (etfci_drag_data_get), etfci); + e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } static void @@ -407,7 +409,7 @@ etfci_maybe_start_drag (ETableFieldChooserItem *etfci, double x, double y) } static void -etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event) +etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, double x, double y) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas); GtkTargetList *list; @@ -420,7 +422,7 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event) { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; - drag_col = event->motion.x / etfci->button_height; + drag_col = y / etfci->button_height; if (drag_col < 0 || drag_col > e_table_header_count(etfci->full_header)) return; @@ -464,7 +466,7 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) gnome_canvas_w2c (canvas, e->motion.x, e->motion.y, &x, &y); if (etfci_maybe_start_drag (etfci, x, y)) - etfci_start_drag (etfci, e); + etfci_start_drag (etfci, e, x, y); break; case GDK_BUTTON_PRESS: diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index b72c93a197..4be2675ce6 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -95,7 +95,8 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETab gtk_object_get(GTK_OBJECT(etfc->item), "height", &height, NULL); - gnome_canvas_set_scroll_region(GNOME_CANVAS( etfc->canvas ), 0, 0, allocation->width, height ); + height = MAX(height, allocation->height); + gnome_canvas_set_scroll_region(GNOME_CANVAS( etfc->canvas ), 0, 0, allocation->width, height); gnome_canvas_item_set( etfc->rect, "x2", (double) allocation->width, "y2", (double) height, @@ -109,6 +110,8 @@ static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc) "height", &height, NULL); + height = MAX(height, etfc->last_alloc.height); + gnome_canvas_set_scroll_region (GNOME_CANVAS(etfc->canvas), 0, 0, etfc->last_alloc.width, height); gnome_canvas_item_set( etfc->rect, "x2", (double) etfc->last_alloc.width, @@ -148,7 +151,6 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) etfc->item = gnome_canvas_item_new(gnome_canvas_root(etfc->canvas), e_table_field_chooser_item_get_type(), - "height", (double) 100, "width", (double) 100, "full_header", etfc->full_header, "dnd_code", etfc->dnd_code, diff --git a/widgets/table/e-table-field-chooser.glade b/widgets/table/e-table-field-chooser.glade index 96408b9891..40997e7a68 100644 --- a/widgets/table/e-table-field-chooser.glade +++ b/widgets/table/e-table-field-chooser.glade @@ -85,8 +85,8 @@ <widget> <class>GtkScrolledWindow</class> <name>scrolledwindow1</name> - <hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy> - <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> + <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> <child> @@ -96,15 +96,12 @@ </child> <widget> - <class>GnomeCanvas</class> + <class>Custom</class> <name>canvas-buttons</name> - <can_focus>True</can_focus> - <anti_aliased>False</anti_aliased> - <scroll_x1>0</scroll_x1> - <scroll_y1>0</scroll_y1> - <scroll_x2>100</scroll_x2> - <scroll_y2>100</scroll_y2> - <pixels_per_unit>1</pixels_per_unit> + <creation_function>e_canvas_new</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Thu, 08 Jun 2000 07:27:33 GMT</last_modification_time> </widget> </widget> </widget> diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index d9b10343ce..8ee5242447 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -425,10 +425,6 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, gint x, gint y, guint time, ETableHeaderItem *ethi) { - /* Check if it's the correct ethi */ - if (ethi->drag_col == -1) - return FALSE; - gdk_drag_status (context, 0, time); if ((x >= 0) && (x <= (ethi->width)) && (y >= 0) && (y <= (ethi->height))){ @@ -437,16 +433,19 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, col = ethi_find_col_by_x (ethi, x); if (col != -1){ - ethi_remove_destroy_marker (ethi); + if (ethi->drag_col != -1) + ethi_remove_destroy_marker (ethi); ethi_add_drop_marker (ethi, col); gdk_drag_status (context, context->suggested_action, time); } else { ethi_remove_drop_marker (ethi); - ethi_add_destroy_marker (ethi); + if (ethi->drag_col != -1) + ethi_add_destroy_marker (ethi); } } else { ethi_remove_drop_marker (ethi); - ethi_add_destroy_marker (ethi); + if (ethi->drag_col != -1) + ethi_add_destroy_marker (ethi); } return TRUE; @@ -455,9 +454,6 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, static void ethi_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableHeaderItem *ethi) { - if (ethi->drag_col == -1) - return; - if (context->action == 0) { e_table_header_remove (ethi->eth, ethi->drag_col); gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); @@ -503,6 +499,7 @@ ethi_drag_data_received (GtkWidget *canvas, } } } + ethi_remove_drop_marker (ethi); gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); } @@ -537,9 +534,6 @@ ethi_drag_drop (GtkWidget *canvas, { gboolean successful = FALSE; - if (ethi->drag_col == -1) - return FALSE; - if ((x >= 0) && (x <= (ethi->width)) && (y >= 0) && (y <= (ethi->height))){ int col; @@ -563,11 +557,9 @@ ethi_drag_drop (GtkWidget *canvas, static void ethi_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETableHeaderItem *ethi) { - if (ethi->drag_col == -1) - return; - ethi_remove_drop_marker (ethi); - ethi_add_destroy_marker (ethi); + if (ethi->drag_col != -1) + ethi_add_destroy_marker (ethi); } static void |