From 862376ea15b9fe602e787b03652b83a49aa28cd1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 23 Feb 2008 02:18:41 +0000 Subject: [PATCH] Hide the root canvas if we have saved the position and size of other canvases and not of the root canvas. git-svn-id: http://svn.voria.com/code@1804 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/app.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index d766019..27a7373 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -1350,12 +1350,13 @@ App::set_recent_file_window_size(etl::handle instance) return; synfig::String::size_type current=0; + bool seen_root(false), shown_non_root(false); while(current != synfig::String::npos) { // find end of first field (canvas) or return synfig::String::size_type separator = canvas_window_size.find_first_of(' ', current); - if(separator == synfig::String::npos) return; + if(separator == synfig::String::npos) break; // find the canvas synfig::Canvas::Handle canvas; @@ -1373,6 +1374,11 @@ App::set_recent_file_window_size(etl::handle instance) CanvasView::Handle canvasview = instance->find_canvas_view(canvas); canvasview->present(); + if (canvas->is_root()) + seen_root = true; + else + shown_non_root = true; + // check that we have the tab character the ends this canvas' data or return current = separator+1; separator = canvas_window_size.find_first_of('\t', current); @@ -1404,6 +1410,9 @@ App::set_recent_file_window_size(etl::handle instance) current = separator+1; } + + if (shown_non_root && !seen_root) + instance->find_canvas_view(instance->get_canvas())->hide(); } void -- 2.7.4