Store the default background color along with the default foreground color.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 26 Dec 2008 15:17:05 +0000 (15:17 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 26 Dec 2008 15:17:05 +0000 (15:17 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2324 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/inputdevice.cpp
synfig-studio/trunk/src/synfigapp/main.cpp

index 4169471..4a513a6 100644 (file)
@@ -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");
index 081d5f7..1c3ec5d 100644 (file)
@@ -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());