Allow the user to set the default foreground and background color
authorgballintijn <gballintijn@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 3 Feb 2009 00:50:23 +0000 (00:50 +0000)
committerCarlos Lopez <carlos@pcnuevo.(none)>
Fri, 12 Jun 2009 14:21:21 +0000 (16:21 +0200)
from the color dialog.

git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2340 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/images/Makefile.am
synfig-studio/trunk/images/set_bg_color.sif [new file with mode: 0644]
synfig-studio/trunk/images/set_fg_color.sif [new file with mode: 0644]
synfig-studio/trunk/src/gtkmm/dialog_color.cpp
synfig-studio/trunk/src/gtkmm/dialog_color.h
synfig-studio/trunk/src/gtkmm/iconcontroller.cpp

index c108414..d15d25d 100644 (file)
@@ -2,8 +2,8 @@
 SYNFIG=synfig
 EXT=@imageext@
 
-EXTRA_DIST=installer_logo.sif installer_logo_osx.sif splash_screen.sifz splash_screen-0.61.08.sif splash_screen-0.61.07.sif about_icon.sif angle_icon.sif bline_icon.sif blinepoint_icon.sif bool_icon.sif canvas_icon.sif canvas_pointer_icon.sif children_icon.sif circle_icon.sif clear_redo_icon.sif clear_undo_icon.sif color_icon.sif curves_icon.sif draw_icon.sif duplicate_icon.sif encapsulate_icon.sif eyedrop_icon.sif fill_icon.sif gradient_icon.sif group_icon.sif info_icon.sif integer_icon.sif keyframe_icon.sif keyframe_lock_icon.sif layer_icon.sif list_icon.sif logo.sif meta_data_icon.sif mirror_icon.sif navigator_icon.sif normal_icon.sif pastecanvas_icon.sif polygon_icon.sif real_icon.sif rectangle_icon.sif rotate_icon.sif saveall_icon.sif scale_icon.sif segment_icon.sif select_all_child_layers_icon.sif sif_icon.sif sketch_icon.sif smooth_move_icon.sif string_icon.sif reset_colors_icon.sif swap_colors_icon.sif synfig_icon.sif synfig_icon.svg time_icon.sif time_track_icon.sif valuenode_icon.sif vector_icon.sif wallpaper.sif width_icon.sif zoom_icon.sif rename_icon.sif plant_icon.sif text_icon.sif polyline_icon.sif star_icon.sif
-IMAGES=installer_logo.$(EXT) installer_logo_osx.$(EXT) mirror_icon.$(EXT) time_icon.$(EXT) time_track_icon.$(EXT) curves_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) reset_colors_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) select_all_child_layers_icon.$(EXT) sif_icon.$(EXT) synfig_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) splash_screen.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) encapsulate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT) rename_icon.$(EXT) plant_icon.$(EXT) text_icon.$(EXT) polyline_icon.$(EXT) star_icon.$(EXT)
+EXTRA_DIST=installer_logo.sif installer_logo_osx.sif splash_screen.sifz splash_screen-0.61.08.sif splash_screen-0.61.07.sif about_icon.sif angle_icon.sif bline_icon.sif blinepoint_icon.sif bool_icon.sif canvas_icon.sif canvas_pointer_icon.sif children_icon.sif circle_icon.sif clear_redo_icon.sif clear_undo_icon.sif color_icon.sif curves_icon.sif draw_icon.sif duplicate_icon.sif encapsulate_icon.sif eyedrop_icon.sif fill_icon.sif gradient_icon.sif group_icon.sif info_icon.sif integer_icon.sif keyframe_icon.sif keyframe_lock_icon.sif layer_icon.sif list_icon.sif logo.sif meta_data_icon.sif mirror_icon.sif navigator_icon.sif normal_icon.sif pastecanvas_icon.sif polygon_icon.sif real_icon.sif rectangle_icon.sif rotate_icon.sif saveall_icon.sif scale_icon.sif segment_icon.sif select_all_child_layers_icon.sif sif_icon.sif sketch_icon.sif smooth_move_icon.sif string_icon.sif reset_colors_icon.sif swap_colors_icon.sif synfig_icon.sif synfig_icon.svg time_icon.sif time_track_icon.sif valuenode_icon.sif vector_icon.sif wallpaper.sif width_icon.sif zoom_icon.sif rename_icon.sif plant_icon.sif text_icon.sif polyline_icon.sif star_icon.sif set_bg_color.sif set_fg_color.sif
+IMAGES=installer_logo.$(EXT) installer_logo_osx.$(EXT) mirror_icon.$(EXT) time_icon.$(EXT) time_track_icon.$(EXT) curves_icon.$(EXT) pastecanvas_icon.$(EXT) group_icon.$(EXT) clear_redo_icon.$(EXT) clear_undo_icon.$(EXT) navigator_icon.$(EXT) info_icon.$(EXT) zoom_icon.$(EXT) meta_data_icon.$(EXT) children_icon.$(EXT) keyframe_icon.$(EXT) reset_colors_icon.$(EXT) swap_colors_icon.$(EXT) rotate_icon.$(EXT) scale_icon.$(EXT) smooth_move_icon.$(EXT) width_icon.$(EXT) rectangle_icon.$(EXT) circle_icon.$(EXT) draw_icon.$(EXT) sketch_icon.$(EXT) fill_icon.$(EXT) normal_icon.$(EXT) select_all_child_layers_icon.$(EXT) sif_icon.$(EXT) synfig_icon.$(EXT) saveall_icon.$(EXT) bool_icon.$(EXT) integer_icon.$(EXT) angle_icon.$(EXT) segment_icon.$(EXT) blinepoint_icon.$(EXT) list_icon.$(EXT) canvas_pointer_icon.$(EXT) string_icon.$(EXT) eyedrop_icon.$(EXT) about_icon.$(EXT) splash_screen.$(EXT) canvas_icon.$(EXT) vector_icon.$(EXT) real_icon.$(EXT) color_icon.$(EXT) valuenode_icon.$(EXT) polygon_icon.$(EXT) bline_icon.$(EXT) layer_icon.$(EXT) duplicate_icon.$(EXT) encapsulate_icon.$(EXT) gradient_icon.$(EXT) keyframe_lock_all.$(EXT) keyframe_lock_past.$(EXT) keyframe_lock_future.$(EXT) keyframe_lock_none.$(EXT) rename_icon.$(EXT) plant_icon.$(EXT) text_icon.$(EXT) polyline_icon.$(EXT) star_icon.$(EXT) set_bg_color.$(EXT) set_fg_color.$(EXT)
 
 MAINTAINERCLEANFILES=Makefile.in
 CLEANFILES=$(IMAGES) images.nsh unimages.nsh installer_logo.bmp sif_icon.ico synfig_icon.ico icons.nsh unicons.nsh
diff --git a/synfig-studio/trunk/images/set_bg_color.sif b/synfig-studio/trunk/images/set_bg_color.sif
new file mode 100644 (file)
index 0000000..82eab68
--- /dev/null
@@ -0,0 +1,306 @@
+<?xml version="1.0"?>
+<canvas version="0.7" width="200" height="200" xres="2834.645752" yres="2834.645752" view-box="-3.245196 3.245196 3.245196 -3.245196" antialias="1" fps="24.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
+  <name>Synfig Studio Save as Default Foreground Color</name>
+  <desc>Placed in the Public Domain in 2009 by Carlos L&#xF3;pez (genete)</desc>
+  <meta name="grid_show" content="1"/>
+  <meta name="grid_size" content="0.500000 0.500000"/>
+  <meta name="grid_snap" content="1"/>
+  <meta name="guide_show" content="1"/>
+  <meta name="guide_snap" content="0"/>
+  <meta name="onion_skin" content="0"/>
+  <layer type="outline" active="true" version="0.2" desc="Rectangle007Contorno">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.0000000000</x>
+        <y>0.0000000000</y>
+      </vector>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+    <param name="antialias">
+      <bool value="true"/>
+    </param>
+    <param name="feather">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="blurtype">
+      <integer value="1"/>
+    </param>
+    <param name="winding_style">
+      <integer value="0"/>
+    </param>
+    <param name="bline">
+      <bline type="bline_point" loop="true">
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>-2.5000000000</x>
+                <y>-1.0000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>1.0000000000</x>
+                <y>-1.0000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>1.0000000000</x>
+                <y>2.5000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>-2.5000000000</x>
+                <y>2.5000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+      </bline>
+    </param>
+    <param name="width">
+      <real value="0.0973558828"/>
+    </param>
+    <param name="expand">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="sharp_cusps">
+      <bool value="true"/>
+    </param>
+    <param name="round_tip[0]">
+      <bool value="true"/>
+    </param>
+    <param name="round_tip[1]">
+      <bool value="true"/>
+    </param>
+    <param name="loopyness">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="homogeneous_width">
+      <bool value="true"/>
+    </param>
+  </layer>
+  <layer type="rectangle" active="true" version="0.2" desc="Rectangle005">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.960827</r>
+        <g>0.960701</g>
+        <b>0.960701</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="point1">
+      <vector>
+        <x>-1.0000000000</x>
+        <y>1.0000000000</y>
+      </vector>
+    </param>
+    <param name="point2">
+      <vector>
+        <x>2.5000000000</x>
+        <y>-2.5000000000</y>
+      </vector>
+    </param>
+    <param name="expand">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+  <layer type="shade" active="true" version="0.2">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="0.5000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="12"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.2000000030</x>
+        <y>-0.2000000030</y>
+      </vector>
+    </param>
+    <param name="size">
+      <vector>
+        <x>0.1000000015</x>
+        <y>0.1000000015</y>
+      </vector>
+    </param>
+    <param name="type">
+      <integer value="1"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+</canvas>
diff --git a/synfig-studio/trunk/images/set_fg_color.sif b/synfig-studio/trunk/images/set_fg_color.sif
new file mode 100644 (file)
index 0000000..8694f4e
--- /dev/null
@@ -0,0 +1,306 @@
+<?xml version="1.0"?>
+<canvas version="0.7" width="200" height="200" xres="2834.645752" yres="2834.645752" view-box="-3.245196 3.245196 3.245196 -3.245196" antialias="1" fps="24.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
+  <name>Synfig Studio Save as Default Foreground Color</name>
+  <desc>Placed in the Public Domain in 2009 by Carlos L&#xF3;pez (genete)</desc>
+  <meta name="grid_show" content="0"/>
+  <meta name="grid_size" content="0.500000 0.500000"/>
+  <meta name="grid_snap" content="0"/>
+  <meta name="guide_show" content="1"/>
+  <meta name="guide_snap" content="0"/>
+  <meta name="onion_skin" content="0"/>
+  <layer type="outline" active="true" version="0.2" desc="Rectangle006Contorno">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>1.000000</r>
+        <g>1.000000</g>
+        <b>1.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.0000000000</x>
+        <y>0.0000000000</y>
+      </vector>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+    <param name="antialias">
+      <bool value="true"/>
+    </param>
+    <param name="feather">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="blurtype">
+      <integer value="1"/>
+    </param>
+    <param name="winding_style">
+      <integer value="0"/>
+    </param>
+    <param name="bline">
+      <bline type="bline_point" loop="true">
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>-1.0000000000</x>
+                <y>-2.5000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>2.5000000000</x>
+                <y>-2.5000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>2.5000000000</x>
+                <y>1.0000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+        <entry>
+          <composite type="bline_point">
+            <point>
+              <vector>
+                <x>-1.0000000000</x>
+                <y>1.0000000000</y>
+              </vector>
+            </point>
+            <width>
+              <real value="1.0000000000"/>
+            </width>
+            <origin>
+              <real value="0.5000000000"/>
+            </origin>
+            <split>
+              <bool value="false"/>
+            </split>
+            <t1>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t1>
+            <t2>
+              <radial_composite type="vector">
+                <radius>
+                  <real value="0.0000000000"/>
+                </radius>
+                <theta>
+                  <angle value="0.000000"/>
+                </theta>
+              </radial_composite>
+            </t2>
+          </composite>
+        </entry>
+      </bline>
+    </param>
+    <param name="width">
+      <real value="0.0973558828"/>
+    </param>
+    <param name="expand">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="sharp_cusps">
+      <bool value="true"/>
+    </param>
+    <param name="round_tip[0]">
+      <bool value="true"/>
+    </param>
+    <param name="round_tip[1]">
+      <bool value="true"/>
+    </param>
+    <param name="loopyness">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="homogeneous_width">
+      <bool value="true"/>
+    </param>
+  </layer>
+  <layer type="rectangle" active="true" version="0.2" desc="Rectangle005">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="point1">
+      <vector>
+        <x>-2.5000000000</x>
+        <y>2.5000000000</y>
+      </vector>
+    </param>
+    <param name="point2">
+      <vector>
+        <x>1.0000000000</x>
+        <y>-1.0000000000</y>
+      </vector>
+    </param>
+    <param name="expand">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+  <layer type="shade" active="true" version="0.2">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="0.5000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="12"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.2000000030</x>
+        <y>-0.2000000030</y>
+      </vector>
+    </param>
+    <param name="size">
+      <vector>
+        <x>0.1000000015</x>
+        <y>0.1000000015</y>
+      </vector>
+    </param>
+    <param name="type">
+      <integer value="1"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+</canvas>
index 1903ec8..4d98e83 100644 (file)
@@ -72,6 +72,27 @@ Dialog_Color::Dialog_Color():
 {
        set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
        // Setup the buttons
+
+       Gtk::Image *icon;
+
+       Gtk::Button *set_fg_color(manage(new class Gtk::Button()));
+       icon = manage(new Gtk::Image(Gtk::StockID("synfig-set_fg_color"), Gtk::IconSize::IconSize(Gtk::ICON_SIZE_BUTTON)));
+       set_fg_color->add(*icon);
+       icon->show();
+       tooltips.set_tip(*set_fg_color, _("Set as Foreground"));
+       set_fg_color->show();
+       add_action_widget(*set_fg_color, 4);
+       set_fg_color->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Color::on_set_fg_pressed));
+
+       Gtk::Button *set_bg_color(manage(new class Gtk::Button()));
+       icon = manage(new Gtk::Image(Gtk::StockID("synfig-set_bg_color"), Gtk::IconSize::IconSize(Gtk::ICON_SIZE_BUTTON)));
+       set_bg_color->add(*icon);
+       icon->show();
+       tooltips.set_tip(*set_bg_color, _("Set as Background"));
+       set_bg_color->show();
+       add_action_widget(*set_bg_color, 3);
+       set_bg_color->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_Color::on_set_bg_pressed));
+
        //Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
        //ok_button->show();
        //add_action_widget(*ok_button,2);
@@ -131,6 +152,22 @@ Dialog_Color::on_apply_pressed()
 }
 
 void
+Dialog_Color::on_set_fg_pressed()
+{
+       busy_=true;
+       synfigapp::Main::set_foreground_color(get_color());
+       busy_=false;
+}
+
+void
+Dialog_Color::on_set_bg_pressed()
+{
+       busy_=true;
+       synfigapp::Main::set_background_color(get_color());
+       busy_=false;
+}
+
+void
 Dialog_Color::on_color_changed()
 {
        busy_=true;
index 3d0025a..960f414 100644 (file)
@@ -35,6 +35,7 @@
 #include <gtkmm/drawingarea.h>
 #include <gtkmm/optionmenu.h>
 #include <gtkmm/checkbutton.h>
+#include <gtkmm/tooltips.h>
 
 #include <synfig/gamma.h>
 #include <synfig/time.h>
@@ -65,12 +66,15 @@ class Widget_Color;
 class Dialog_Color : public Gtk::Dialog
 {
        DialogSettings dialog_settings;
+       Gtk::Tooltips tooltips;
 
        sigc::signal<void,synfig::Color> signal_edited_;
        //sigc::signal<void,synfig::Color> signal_apply_;
 
        bool on_close_pressed();
        void on_apply_pressed();
+       void on_set_fg_pressed();
+       void on_set_bg_pressed();
        void on_color_changed();
 
        Widget_ColorEdit* widget_color;
index 58b8d89..6fa4e69 100644 (file)
@@ -185,6 +185,9 @@ IconController::IconController(const synfig::String& /*basepath*/)
        INIT_STOCK_ICON(keyframe_lock_future,"keyframe_lock_future."IMAGE_EXT,_("Future Keyframes Locked"));
        INIT_STOCK_ICON(keyframe_lock_none,"keyframe_lock_none."IMAGE_EXT,_("No Keyframes Locked"));
 
+       INIT_STOCK_ICON(set_fg_color,"set_fg_color."IMAGE_EXT,_("Set as Foreground"));
+       INIT_STOCK_ICON(set_bg_color,"set_bg_color."IMAGE_EXT,_("Set as Background"));
+
        INIT_STOCK_ICON_CLONE(cvs_add,"gtk-add",_("CVS Add"));
        INIT_STOCK_ICON_CLONE(cvs_update,"gtk-open",_("CVS Update"));
        INIT_STOCK_ICON_CLONE(cvs_commit,"gtk-save",_("CVS Commit"));