[glabels/vala] Make sure to display the correct child in a ColorButton.



commit 3633ac97f627ca5fdb69d9da61383f28b9135be4
Author: Jim Evins <evins snaught com>
Date:   Mon Oct 8 21:35:47 2012 -0400

    Make sure to display the correct child in a ColorButton.

 glabels/color_button.vala |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/glabels/color_button.vala b/glabels/color_button.vala
index 7377902..819cea4 100644
--- a/glabels/color_button.vala
+++ b/glabels/color_button.vala
@@ -96,6 +96,17 @@ namespace glabels
 
 			this.color_node = color_node;
 
+			if ( color_node.field_flag )
+			{
+				swatch.hide();
+				key_label.show();
+			}
+			else
+			{
+				swatch.show();
+				key_label.hide();
+			}
+
 			swatch.set_color( color_node.color );
 		}
 
@@ -104,9 +115,12 @@ namespace glabels
 		{
 			is_default_flag = false;
 
-			this.color_node.field_flag = false;
-			this.color_node.color      = color;
-			this.color_node.key        = null;
+			color_node.field_flag = false;
+			color_node.color      = color;
+			color_node.key        = null;
+
+			swatch.show();
+			key_label.hide();
 
 			swatch.set_color( color );
 		}
@@ -120,6 +134,9 @@ namespace glabels
 			color_node.color      = default_color;
 			color_node.key        = null;
 
+			swatch.show();
+			key_label.hide();
+
 			swatch.set_color( default_color );
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]