Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / gtkmm / canvasview.cpp
index 34fc7bd..7ffc505 100644 (file)
@@ -690,6 +690,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigap
        statusbar                               (manage(new class Gtk::Statusbar())),
 
        timeslider                              (new Widget_Timeslider),
+       widget_kf_list                  (new Widget_Keyframe_List),
 
        ui_interface_                   (new CanvasViewUIInterface(this)),
        selection_manager_              (new CanvasViewSelectionManager(this)),
@@ -966,6 +967,10 @@ CanvasView::create_time_bar()
        timeslider->set_time_adjustment(&time_adjustment());
        timeslider->set_bounds_adjustment(&time_window_adjustment());
        //layout_table->attach(*timeslider, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL);
+       //Setup the keyframe list widget
+       widget_kf_list->set_time_adjustment(&time_adjustment());
+       widget_kf_list->set_canvas_interface(canvas_interface());
+       widget_kf_list->show();
 
        tooltips.set_tip(*time_window_scroll,_("Moves the time window"));
        tooltips.set_tip(*timeslider,_("Changes the current time"));
@@ -1033,16 +1038,26 @@ CanvasView::create_time_bar()
        keyframedial->show();
        keyframebutton=keyframedial->get_lock_button();
 
-       timebar = manage(new class Gtk::Table(5, 4, false));
+       timebar = Gtk::manage(new class Gtk::Table(5, 4, false));
+
+       //Adjust both widgets to be the same as the
+       int header_height = 0;
+       if(getenv("SYNFIG_TIMETRACK_HEADER_HEIGHT"))
+               header_height = atoi(getenv("SYNFIG_TIMETRACK_HEADER_HEIGHT"));
+       if (header_height < 3)
+               header_height = 24;
+       timeslider->set_size_request(-1,header_height-header_height/3+1);
+       widget_kf_list->set_size_request(-1,header_height/3+1);
 
        //Attach widgets to the timebar
-       timebar->attach(*manage(disp_audio), 1, 5, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
-       timebar->attach(*framedial, 0, 1, 2, 3,Gtk::SHRINK, Gtk::SHRINK);
-       timebar->attach(*current_time_widget, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
-       timebar->attach(*timeslider, 1, 3, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
+       //timebar->attach(*manage(disp_audio), 1, 5, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
+       timebar->attach(*current_time_widget, 0, 1, 0, 2, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0);
+       timebar->attach(*framedial, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK);
+       timebar->attach(*timeslider, 1, 3, 1, 2, Gtk::FILL|Gtk::SHRINK, Gtk::FILL|Gtk::SHRINK);
+       timebar->attach(*widget_kf_list, 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK);
        timebar->attach(*time_window_scroll, 1, 3, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
-       timebar->attach(*keyframedial, 3, 4, 1, 2, Gtk::SHRINK, Gtk::SHRINK);
-       timebar->attach(*animatebutton, 4, 5, 1, 2, Gtk::SHRINK, Gtk::SHRINK);
+       timebar->attach(*keyframedial, 3, 4, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
+       timebar->attach(*animatebutton, 4, 5, 0, 2, Gtk::SHRINK, Gtk::SHRINK);
        //timebar->attach(*keyframebutton, 1, 2, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
 
        timebar->show();
@@ -1183,7 +1198,7 @@ CanvasView::create_display_bar()
        snap_grid->add(*icon2);
        snap_grid->signal_toggled().connect(
                        sigc::mem_fun(*this, &studio::CanvasView::toggle_snap_grid));
-       tooltips.set_tip(*snap_grid, _("snap grid when enabled"));
+       tooltips.set_tip(*snap_grid, _("Snap grid when enabled"));
        snap_grid->set_relief(Gtk::RELIEF_NONE);
        snap_grid->show();
 
@@ -1196,7 +1211,7 @@ CanvasView::create_display_bar()
        onion_skin->add(*icon3);
        onion_skin->signal_toggled().connect(
                        sigc::mem_fun(*this, &studio::CanvasView::toggle_onion_skin));
-       tooltips.set_tip(*snap_grid, _("Shows onion skin when enabled"));
+       tooltips.set_tip(*onion_skin, _("Shows onion skin when enabled"));
        onion_skin->set_relief(Gtk::RELIEF_NONE);
        onion_skin->show();
 
@@ -1531,7 +1546,7 @@ CanvasView::init_menus()
                sigc::mem_fun(*this, &studio::CanvasView::play)
        );
 
-       action_group->add( Gtk::Action::create("dialog-flipbook", _("Flipbook Dialog")),
+       action_group->add( Gtk::Action::create("dialog-flipbook", _("Preview Window")),
                sigc::mem_fun0(*preview_dialog, &studio::Dialog_Preview::present)
        );
 
@@ -2887,6 +2902,18 @@ CanvasView::on_duck_changed(const synfig::Point &value,const synfigapp::ValueDes
                }
        }
 
+       if (ValueNode_Scale::Handle scale_value_node = ValueNode_Scale::Handle::cast_dynamic(value_desc.get_value_node()))
+       {
+               int link_index(scale_value_node->get_link_index_from_name("link"));
+               if(scale_value_node->is_invertible(get_time()))
+                       return canvas_interface()->change_value(
+                               synfigapp::ValueDesc(scale_value_node,link_index),
+                                       scale_value_node->get_inverse(get_time(), value)
+                                       );
+               else
+                       return false;
+       }
+
        switch(value_desc.get_value_type())
        {
        case ValueBase::TYPE_REAL:
@@ -2908,6 +2935,18 @@ CanvasView::on_duck_angle_changed(const synfig::Angle &rotation,const synfigapp:
                return canvas_interface()->change_value(synfigapp::ValueDesc(bline_tangent,offset_index), old_offset + rotation);
        }
 
+       if (ValueNode_Scale::Handle scale_value_node = ValueNode_Scale::Handle::cast_dynamic(value_desc.get_value_node()))
+       {
+               int link_index(scale_value_node->get_link_index_from_name("link"));
+               if(scale_value_node->is_invertible(get_time()))
+                       return canvas_interface()->change_value(
+                               synfigapp::ValueDesc(scale_value_node,link_index),
+                                       scale_value_node->get_inverse(get_time(), rotation)
+                                       );
+               else
+                       return false;
+
+       }
        // \todo will this really always be the case?
        assert(value_desc.get_value_type() == ValueBase::TYPE_ANGLE);
        return canvas_interface()->change_value(value_desc, value_desc.get_value(get_time()).get(Angle()) + rotation);
@@ -3253,8 +3292,8 @@ CanvasView::toggle_low_res_pixel_flag()
 void
 CanvasView::update_quality()
 {
-       if(working_depth)
-                       return;
+       //if(working_depth)
+       //              return;
        if(updating_quality_)
                return;
        updating_quality_=true;