Author: Yu Chen <[email protected]>
Date: Wed Feb 22 03:23:17 2012 +0800
Move the previewing frame numbering from draw area to the button of the window
near by the last rendered frame label.
---
synfig-studio/src/gui/preview.cpp | 52 ++++++++++--------------------------
synfig-studio/src/gui/preview.h | 1 +
2 files changed, 16 insertions(+), 37 deletions(-)
diff --git a/synfig-studio/src/gui/preview.cpp
b/synfig-studio/src/gui/preview.cpp
index deb0d88..a797d55 100644
--- a/synfig-studio/src/gui/preview.cpp
+++ b/synfig-studio/src/gui/preview.cpp
@@ -455,13 +455,14 @@ Widget_Preview::Widget_Preview():
controller->show_all();
- //3rd row: last rendered frame
- Gtk::HBox *lastrendered = manage(new Gtk::HBox);
- Gtk::Label *label = manage(new Gtk::Label(_("Last rendered: ")));
- lastrendered->pack_start(*label, Gtk::PACK_SHRINK, 10);
- //l_lasttime.show();
- lastrendered->pack_start(l_lasttime, Gtk::PACK_SHRINK, 0);
- lastrendered->show_all();
+ //3rd row: previewing frame numbering and rendered frame numbering
+ Gtk::HBox *status = manage(new Gtk::HBox);
+ status->pack_start(l_currenttime, Gtk::PACK_SHRINK, 5);
+ Gtk::Label *label = manage(new Gtk::Label(_("/")));
+ status->pack_start(*label, Gtk::PACK_SHRINK, 5);
+ status->pack_start(l_lasttime, Gtk::PACK_SHRINK, 5);
+
+ status->show_all();
//5th row: sound track
disp_sound.set_size_request(-1,32);
@@ -470,7 +471,7 @@ Widget_Preview::Widget_Preview():
attach(preview_window, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL,
Gtk::EXPAND|Gtk::FILL, 0);
attach(scr_time_scrub, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
attach(*controller, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL,
Gtk::SHRINK|Gtk::FILL);
- attach(*lastrendered, 0, 1, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
+ attach(*status, 0, 1, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
// attach(disp_sound,0,1,4,5,Gtk::EXPAND|Gtk::FILL,Gtk::SHRINK);
show_all();
@@ -574,6 +575,12 @@ void studio::Widget_Preview::update()
disp_sound.set_position(time);
disp_sound.queue_draw();
}
+
+ //current frame in previewing
+ Glib::ustring
timecode(Time((double)timedisp).round(preview->get_global_fps())
+ .get_string(preview->get_global_fps(),
App::get_time_format()));
+ l_currenttime.set_text(timecode);
+
}
void studio::Widget_Preview::preview_draw()
{
@@ -670,35 +677,6 @@ bool studio::Widget_Preview::redraw(GdkEventExpose
*/*heh*/)
);
cr->paint();
cr->restore();
-
- Glib::RefPtr<Pango::Layout>
layout(Pango::Layout::create(get_pango_context()));
- Glib::ustring
timecode(Time((double)timedisp).round(preview->get_global_fps())
- .get_string(preview->get_global_fps(),
- App::get_time_format()));
- //synfig::info("Time for preview draw is: %s for time %g",
timecode.c_str(), adj_time_scrub.get_value());
-
- cr->save();
-
- layout->set_text(timecode);
-
- //numbering frames which inside duration of canvas in bule
- if(timedisp >=
preview->get_canvas()->rend_desc().get_time_start()
- && timedisp <=
preview->get_canvas()->rend_desc().get_time_end())
- {
- cr->set_source_rgb(0, 0, 1);
- }
-
- //numbering frames which outside duration of canvas in red
- else
- {
- cr->set_source_rgb(1, 0, 0);
- }
-
- cr->move_to(4,4);
- layout->show_in_cairo_context(cr);
- cr->stroke();
-
- cr->restore();
}
//synfig::warning("Refresh the draw area");
diff --git a/synfig-studio/src/gui/preview.h b/synfig-studio/src/gui/preview.h
index 0e720a0..28c031a 100644
--- a/synfig-studio/src/gui/preview.h
+++ b/synfig-studio/src/gui/preview.h
@@ -194,6 +194,7 @@ class Widget_Preview : public Gtk::Table
Gtk::Adjustment adj_sound;
Gtk::Label l_lasttime;
+ Gtk::Label l_currenttime;
//only for internal stuff, doesn't set anything
bool playing;
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl