X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_gradient.cpp;h=c9645996f03251ff1430c7c54ed4f73d4e85740e;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=945e791b129fe46555fbc4b5cd234454c6c589a8;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp b/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp index 945e791..c964599 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -35,6 +36,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -119,7 +122,7 @@ Widget_Gradient::~Widget_Gradient() #define CONTROL_HEIGHT 16 bool -Widget_Gradient::redraw(GdkEventExpose*bleh) +Widget_Gradient::redraw(GdkEventExpose */*bleh*/) { const int h(get_height()); const int w(get_width()); @@ -203,6 +206,7 @@ void Widget_Gradient::remove_cpoint(float x) { gradient_.erase(gradient_.proximity(x)); + signal_value_changed_(); queue_draw(); } @@ -210,6 +214,7 @@ void Widget_Gradient::popup_menu(float x) { Gtk::Menu* menu(manage(new Gtk::Menu())); + menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu)); menu->items().clear(); @@ -290,8 +295,9 @@ Widget_Gradient::on_event(GdkEvent *event) case GDK_MOTION_NOTIFY: if(editable_ && y>get_height()-CONTROL_HEIGHT) { + if(!gradient_.size()) return true; Gradient::iterator iter(gradient_.find(selected_cpoint)); - + //! Use SHIFT to stack two CPoints together. if(event->button.state&GDK_SHIFT_MASK) { float begin(-100000000),end(100000000);