Fix 2112320: "Change 'Grab' button in the Gradient Editor". Renamed the 'Grab' butto...
[synfig.git] / synfig-studio / trunk / src / gtkmm / widget_defaults.cpp
index 4e85ffe..5158af0 100644 (file)
@@ -6,6 +6,8 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**  Copyright (c) 2008 Chris Moore
+**  Copyright (c) 2008 Carlos López
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -170,13 +172,15 @@ public:
                                {
                                        Distance dist(synfigapp::Main::get_bline_width());
 
-                                       if(event->scroll.direction==GDK_SCROLL_UP)
-                                       {
-                                               dist+=DEFAULT_INCREMENT;
-                                       }
-                                       else if(event->scroll.direction==GDK_SCROLL_DOWN)
-                                       {
-                                               dist-=DEFAULT_INCREMENT;
+                                       switch(event->scroll.direction){
+                                               case GDK_SCROLL_UP:
+                                               case GDK_SCROLL_RIGHT:
+                                                       dist+=DEFAULT_INCREMENT;
+                                               break;
+                                               case GDK_SCROLL_DOWN:
+                                               case GDK_SCROLL_LEFT:
+                                                       dist-=DEFAULT_INCREMENT;
+                                               break;
                                        }
                                        synfigapp::Main::set_bline_width(dist);
                                        return true;
@@ -207,7 +211,7 @@ Widget_Defaults::Widget_Defaults()
                widget_fg_color->show();
                widget_fg_color->set_size_request(16,16);
                widget_fg_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_fg_color_clicked));
-               subtable->attach(*widget_fg_color, 0, 2, 0, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+               subtable->attach(*widget_fg_color, 0, 4, 0, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
                tooltips_.set_tip(*widget_fg_color,_("Foreground Color"));
 
                // Background Color
@@ -215,7 +219,7 @@ Widget_Defaults::Widget_Defaults()
                widget_bg_color->show();
                widget_bg_color->set_size_request(16,16);
                widget_bg_color->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_bg_color_clicked));
-               subtable->attach(*widget_bg_color, 1, 3, 1, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+               subtable->attach(*widget_bg_color, 3, 7, 3, 7, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
                tooltips_.set_tip(*widget_bg_color,_("Background Color"));
 
                Gtk::Image* icon;
@@ -232,18 +236,21 @@ Widget_Defaults::Widget_Defaults()
                //button_swap->set_size_request(16/3,16/3);
                dynamic_cast<Gtk::Misc*>(button_swap->get_child())->set_padding(0,0);
                button_swap->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_swap_color_clicked));
-               subtable->attach(*button_swap, 2, 3, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+               subtable->attach(*button_swap, 4, 7, 0, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
                tooltips_.set_tip(*button_swap,_("Swap Background and\nForeground Colors"));
 
                // Reset button
-               Gtk::Button* button_reset(manage(new Gtk::Button("R")));
+               Gtk::Button* button_reset(manage(new Gtk::Button()));
                button_reset->show();
                button_reset->set_relief(Gtk::RELIEF_NONE);
                button_reset->set_border_width(0);
+               icon=manage(new Gtk::Image(Gtk::StockID("synfig-reset_colors"),Gtk::IconSize(1)));
+               icon->show();
+               button_reset->add(*icon);
                dynamic_cast<Gtk::Misc*>(button_reset->get_child())->set_padding(0,0);
                //button_reset->set_size_request(16/3,16/3);
                button_reset->signal_clicked().connect(sigc::mem_fun(*this,&Widget_Defaults::on_reset_color_clicked));
-               subtable->attach(*button_reset, 0,1, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+               subtable->attach(*button_reset, 0, 3, 4, 7, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
                tooltips_.set_tip(*button_reset,_("Reset Colors to Black and White"));
 
 
@@ -282,10 +289,10 @@ Widget_Defaults::Widget_Defaults()
        widget_interpolation->set_param_desc(
                ParamDesc("interpolation")
                        .set_hint("enum")
-                       .add_enum_value(INTERPOLATION_TCB,"auto",_("TCB"))
-                       .add_enum_value(INTERPOLATION_CONSTANT,"constant",_("Constant"))
-                       .add_enum_value(INTERPOLATION_HALT,"ease",_("Ease in/out"))
-                       .add_enum_value(INTERPOLATION_LINEAR,"linear",_("Linear"))
+                       .add_enum_value(INTERPOLATION_TCB,"auto",_("_TCB"))
+                       .add_enum_value(INTERPOLATION_CONSTANT,"constant",_("_Constant"))
+                       .add_enum_value(INTERPOLATION_HALT,"ease",_("_Ease In/Out"))
+                       .add_enum_value(INTERPOLATION_LINEAR,"linear",_("_Linear"))
        );
        attach(*widget_interpolation,0, 2, 5, 6, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 1, 1);
        tooltips_.set_tip(*widget_interpolation,_("Default Interpolation"));
@@ -457,6 +464,7 @@ Widget_Defaults::on_gradient_clicked()
        App::dialog_gradient->set_gradient(synfigapp::Main::get_gradient());
        App::dialog_gradient->reset();
        App::dialog_gradient->signal_edited().connect(sigc::ptr_fun(synfigapp::Main::set_gradient));
+       App::dialog_gradient->grab_button_set_sensitive(false);
        App::dialog_gradient->present();
 }