[evolution-patches] Re: Resubmit patch for bug 45631, "activate popup menu in mail composer's to/cc"



On Thu, 2003-08-07 at 03:11, Maxx Cao wrote:

> Corrections made according to Mike's comments. I can't hook this to "popup_menu" event, 
> because e-text is not inherited from GtkWidget.
> 
> Please review this new one. Thank you!

A few more tiny things:


        case GDK_KEY_PRESS: /* Fall Through */

Move that /* Fall Through */ to the bottom of the case so it's clear
control continues into the RELEASE case.

+
+               /* Handle S-F10 key binding here. */
+
+               if (event->key.keyval == GDK_F10 
+                   && (event->key.state&GDK_SHIFT_MASK)

Always put spaces before and after operators for more readability.

+                   && text->handle_popup ){
+
+                       /* Simulate a GdkEventButton here, so that we
can call e_text_do_popup directly */
+
+                       GdkEventButton *button = gdk_event_new
(GDK_BUTTON_PRESS);
+                       button->time = GDK_CURRENT_TIME;

As Larry suggested, please copy the time into the event from the
original key event.

+                       button->button = 0;
+                       e_text_do_popup (text, button, 0);
+                       return TRUE;
+               }
+
        case GDK_KEY_RELEASE:
+
                if (text->editing) {
                        GdkEventKey key;
                        gint ret;
@@ -2517,6 +2535,22 @@
 }
 
 static void
+popup_menu_placement_cb (GtkMenu *menu, gint *x, gint *y, gboolean
*push_in, gpointer user_data)
+{
+       EText *text = E_TEXT(user_data);
+       GnomeCanvasItem *item = &text->item;
+       GnomeCanvas *parent = item->canvas;
+
+       if (parent){
+               gdk_window_get_origin (((GtkWidget*) parent)->window, x,
y);
+               *x += item->x1 + text->width/2;
+               *y += item->y1 + text->height/2;

Again, spaces before and after operators.

+       }
+
+       return;
+}

After you resolve the above issues, go ahead and commit.  Thanks again
for the patch.

-- 
Mike Kestner <mkestner ximian com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]