From 85b2913a380c69f14ae0254ad23b10fabfb33667 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 24 Oct 2008 23:52:05 +0000 Subject: Merge revisions 36534:36684 from trunk. svn path=/branches/kill-bonobo/; revision=36685 --- widgets/misc/e-reflow.c | 50 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'widgets/misc/e-reflow.c') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 6fd7021b54..f51a502a83 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -1,26 +1,24 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * e-reflow.c - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * - * Authors: - * Chris Lahey + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. + * Authors: + * Chris Lahey + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) */ - #include #include @@ -955,14 +953,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) case 1: { GdkEventButton *button = (GdkEventButton *) event; - double n_x, max_x; + double n_x; n_x = button->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); - max_x = E_REFLOW_BORDER_WIDTH; - max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count; - if ( button->y >= E_REFLOW_BORDER_WIDTH && button->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > button->x ) { + if ( button->y >= E_REFLOW_BORDER_WIDTH && button->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) { /* don't allow to drag the first line*/ if (e_reflow_pick_line(reflow, button->x) == 0) return TRUE; @@ -1046,16 +1042,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) return TRUE; } else { GdkEventMotion *motion = (GdkEventMotion *) event; - double n_x, max_x; + double n_x; n_x = motion->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); - max_x = E_REFLOW_BORDER_WIDTH; - max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count; - - if ( motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > motion->x) { + if ( motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) { if ( reflow->default_cursor_shown ) { gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; @@ -1071,14 +1064,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_ENTER_NOTIFY: if (!reflow->column_drag) { GdkEventCrossing *crossing = (GdkEventCrossing *) event; - double n_x, max_x; + double n_x; n_x = crossing->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); - max_x = E_REFLOW_BORDER_WIDTH; - max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count; - if ( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > crossing->x) { + if ( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) { if ( reflow->default_cursor_shown ) { gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; @@ -1541,4 +1532,3 @@ e_reflow_init (EReflow *reflow) e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow); } - -- cgit v1.2.3