From 76a7c3b0f43528c603c597cb733f704cba4f83c1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 26 Dec 2008 15:17:05 +0000 Subject: [PATCH] Store the default background color along with the default foreground color. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2324 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/synfigapp/inputdevice.cpp | 16 ++++++++++++++++ synfig-studio/trunk/src/synfigapp/main.cpp | 1 + 2 files changed, 17 insertions(+) diff --git a/synfig-studio/trunk/src/synfigapp/inputdevice.cpp b/synfig-studio/trunk/src/synfigapp/inputdevice.cpp index 4169471..4a513a6 100644 --- a/synfig-studio/trunk/src/synfigapp/inputdevice.cpp +++ b/synfig-studio/trunk/src/synfigapp/inputdevice.cpp @@ -87,6 +87,13 @@ public: return true; } + if(key=="bgcolor") + { + Color c(input_device->get_background_color()); + value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a()); + + return true; + } return Settings::get_value(key, value); } @@ -121,6 +128,14 @@ public: input_device->set_foreground_color(synfig::Color(r,g,b,a)); return true; } + if(key=="bgcolor") + { + float r=0,g=0,b=0,a=1; + if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a)) + return false; + input_device->set_background_color(synfig::Color(r,g,b,a)); + return true; + } return Settings::set_value(key, value); } @@ -129,6 +144,7 @@ public: { KeyList ret(Settings::get_key_list()); ret.push_back("color"); + ret.push_back("bgcolor"); ret.push_back("state"); ret.push_back("bline_width"); ret.push_back("blend_method"); diff --git a/synfig-studio/trunk/src/synfigapp/main.cpp b/synfig-studio/trunk/src/synfigapp/main.cpp index 081d5f7..1c3ec5d 100644 --- a/synfig-studio/trunk/src/synfigapp/main.cpp +++ b/synfig-studio/trunk/src/synfigapp/main.cpp @@ -389,6 +389,7 @@ synfigapp::Main::select_input_device(InputDevice::Handle input_device) set_bline_width(input_device->get_bline_width()); set_foreground_color(input_device->get_foreground_color()); + set_background_color(input_device->get_background_color()); set_opacity(input_device->get_opacity()); set_blend_method(input_device->get_blend_method()); -- 2.7.4