Clone in a terminal:
Commit 520ea8b
Johan Mattsson - 2014-08-31T10:27:25+00:00
520ea8b9db0828d21c668958be8f8abe4980aa0ajohan.mattsson.m@gmail.com

Upgrade color selector to GTK3

Changed files (2)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex 83771b2..4f733e5 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -285,20 +285,53 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	} 	 	class ColorWindow : Gtk.Window {-		ColorSelection color_selection = new ColorSelection ();+		+		ColorChooserWidget color_selection;+		+		public ColorWindow (ColorTool color_tool) {+			Button set_button;+			+			title = t_("Select color");+			window_position = Gtk.WindowPosition.CENTER; -		public ColorWindow (ColorTool color_tool) {			-			color_selection.color_changed.connect (() => {+			Box box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);+			add (box);++			color_selection = new Gtk.ColorChooserWidget ();+			box.add (color_selection);+			+			color_selection.show_editor = true;++			color_selection.color_activated.connect ((color) => {+				Gdk.RGBA c = color_selection.rgba;+				color_tool.color_r = c.red;+				color_tool.color_g = c.green;+				color_tool.color_b = c.blue;+				color_tool.color_a = c.alpha;+				color_tool.color_updated ();+			});++			color_selection.color_activated.connect (() => { 				Gdk.RGBA c = new Gdk.RGBA ();-				color_selection.get_current_rgba (c);+				c.red = color_tool.color_r;+				c.green = color_tool.color_g;+				c.blue = color_tool.color_b;+				c.alpha = color_tool.color_a;+				color_selection.rgba = c;+			});++			set_button = new Button.with_label (_("Set"));+			box.add (set_button);++			set_button.clicked.connect (() => {+				Gdk.RGBA c = color_selection.rgba; 				color_tool.color_r = c.red; 				color_tool.color_g = c.green; 				color_tool.color_b = c.blue;-				color_tool.color_a = c.alpha; +				color_tool.color_a = c.alpha; 				color_tool.color_updated (); 			});-			-			add (color_selection);+ 			show_all (); 		}	 	}diff --git a/graphics/tools_and_buttons.svg b/graphics/tools_and_buttons.svgindex 0502304..ac16369 100644--- a/graphics/tools_and_buttons.svg+++ b/graphics/tools_and_buttons.svg@@ -936,9 +936,9 @@      borderopacity="1.0"      inkscape:pageopacity="0.0"      inkscape:pageshadow="2"-     inkscape:zoom="16"-     inkscape:cx="185.17278"-     inkscape:cy="366.19714"+     inkscape:zoom="1"+     inkscape:cx="460.33402"+     inkscape:cy="449.0395"      inkscape:current-layer="layer1"      inkscape:document-units="px"      showgrid="false"@@ -3093,23 +3093,185 @@        id="rect4482"        style="color:#000000;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.04827586;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />     <rect-       style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#858585;stroke-width:1.34000000000000008;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#858585;stroke-width:1.34000003;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"        id="rect3433"        width="14.986238"        height="14.986238"-       x="183.13188"+       x="193.13188"        y="389.00687"        inkscape:export-filename="/home/johan/birdfont/icons/high_contrast_background.png"        inkscape:export-xdpi="319"        inkscape:export-ydpi="319" />     <path        style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.34000003;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"-       d="m 183.81938,389.69437 13.48624,0 -13.48624,13.48623 z"+       d="m 193.81938,389.69437 13.48624,0 -13.48624,13.48623 z"        id="rect3435"        inkscape:connector-curvature="0"        sodipodi:nodetypes="cccc"        inkscape:export-filename="/home/johan/birdfont/icons/high_contrast_background.png"        inkscape:export-xdpi="319"        inkscape:export-ydpi="319" />+    <path+       style="fill:#00000a;fill-opacity:1;stroke:#858585;stroke-width:0.69903648px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+       d="m 223.91149,389.47369 c 0.0571,1.36858 0.38308,13.67855 0.38308,13.67855"+       id="path4307"+       inkscape:connector-curvature="0"+       sodipodi:nodetypes="cc"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546631"+       inkscape:transform-center-y="0.28066926"+       transform="matrix(1.796619,0,0,1.796619,-62.377166,-308.46074)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546659"+       inkscape:transform-center-y="0.28066687"+       transform="matrix(1.796619,0,0,1.796619,-62.664184,-317.55835)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0-9"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546672"+       inkscape:transform-center-y="0.28066751"+       transform="matrix(1.796619,0,0,1.796619,-62.777838,-322.06492)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       style="fill:#00000a;fill-opacity:1;stroke:#858585;stroke-width:0.69903648px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+       d="m 233.55831,389.32321 c 0.0571,1.36858 0.38307,13.67855 0.38307,13.67855"+       id="path4307-8"+       inkscape:connector-curvature="0"+       sodipodi:nodetypes="cc"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-2"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546588"+       inkscape:transform-center-y="0.28067361"+       transform="matrix(1.796619,0,0,1.796619,-52.73035,-308.61121)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0-9-2"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546627"+       inkscape:transform-center-y="0.28066584"+       transform="matrix(1.796619,0,0,1.796619,-53.131022,-322.21541)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0-3"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546663"+       inkscape:transform-center-y="0.2806727"+       transform="matrix(1.796619,0,0,1.796619,-62.524506,-313.13661)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       style="fill:#00000a;fill-opacity:1;stroke:#858585;stroke-width:0.69903648px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+       d="m 228.94349,389.27638 c 0.0571,1.36858 0.38307,13.67854 0.38307,13.67854"+       id="path4307-6"+       inkscape:connector-curvature="0"+       sodipodi:nodetypes="cc"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-8"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546634"+       inkscape:transform-center-y="0.28066574"+       transform="matrix(1.796619,0,0,1.796619,-57.345167,-308.65806)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0-90"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546662"+       inkscape:transform-center-y="0.28067208"+       transform="matrix(1.796619,0,0,1.796619,-57.632185,-315.76406)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />+    <path+       sodipodi:type="arc"+       style="color:#000000;fill:#858585;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"+       id="path3435-0-9-3"+       sodipodi:cx="159.59375"+       sodipodi:cy="396.15607"+       sodipodi:rx="0.8125"+       sodipodi:ry="0.8125"+       d="m 160.40625,396.15607 a 0.8125,0.8125 0 1 1 -1.625,0 0.8125,0.8125 0 1 1 1.625,0 z"+       inkscape:transform-center-x="-4.1546675"+       inkscape:transform-center-y="0.28067399"+       transform="matrix(1.796619,0,0,1.796619,-57.745839,-322.26223)"+       inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />   </g> </svg>

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112