Code

replace single toggle button with less confusing pick-alpha and set-alpha options
[inkscape.git] / src / arc-context.cpp
index 8bee7fe028803b41f1597a185ed70b0654445d7f..0b0aad79e563890d2fcea8120b8a992e920f0593 100644 (file)
@@ -30,6 +30,7 @@
 #include "desktop-handles.h"
 #include "snap.h"
 #include "pixmaps/cursor-ellipse.xpm"
+#include "pixmaps/cursor-ellipse.pixbuf"
 #include "sp-metrics.h"
 #include "xml/repr.h"
 #include "xml/node-event-vector.h"
@@ -39,6 +40,7 @@
 #include "desktop.h"
 #include "desktop-style.h"
 #include "context-fns.h"
+#include "verbs.h"
 
 #include "arc-context.h"
 
@@ -94,6 +96,11 @@ static void sp_arc_context_init(SPArcContext *arc_context)
     SPEventContext *event_context = SP_EVENT_CONTEXT(arc_context);
 
     event_context->cursor_shape = cursor_ellipse_xpm;
+    event_context->cursor_pixbuf = gdk_pixbuf_new_from_inline(
+            -1,
+            cursor_ellipse_pixbuf,
+            FALSE,
+            NULL);  
     event_context->hot_x = 4;
     event_context->hot_y = 4;
     event_context->xp = 0;
@@ -261,7 +268,7 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
                 dragging = true;
                 ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
 
-                SnapManager const m(desktop->namedview);
+                SnapManager const &m = desktop->namedview->snap_manager;
                 ac->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, ac->center, ac->item).getPoint();
                 sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
                                     GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
@@ -426,7 +433,8 @@ static void sp_arc_finish(SPArcContext *ac)
         SP_OBJECT(ac->item)->updateRepr();
 
         sp_desktop_selection(desktop)->set(ac->item);
-        sp_document_done(sp_desktop_document(desktop));
+        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC, 
+                         _("Create ellipse"));
 
         ac->item = NULL;
     }