[gnome-boxes] EditableEntry Temporarily disable weight property



commit 5eae50b7fa160c6b2922102d23b5ec3a8d7b6771
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Aug 24 16:07:42 2012 +0200

    EditableEntry Temporarily disable weight property
    
    This causes a critical error when creating the param spec
    as 0 is not a valid enum for Pango.Weight. There is
    unfortunately no way atm to specify a different default
    in vala, so we just disable this (unused) property.

 src/editable-entry.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/editable-entry.vala b/src/editable-entry.vala
index 31689b8..1093634 100644
--- a/src/editable-entry.vala
+++ b/src/editable-entry.vala
@@ -52,6 +52,10 @@ private class Boxes.EditableEntry: Alignment {
     }
 
     private Pango.Weight _weight = Pango.Weight.NORMAL;
+	/* This is disabled for now since its impossible to
+	   declare a default for the paramspec, and the number that
+	   valac picks (0) is invalid for the Pango.Weight enum.
+
     public Pango.Weight weight {
         get { return _weight; }
         set {
@@ -63,7 +67,8 @@ private class Boxes.EditableEntry: Alignment {
 
             update_fonts ();
         }
-    }
+	}
+	*/
     public bool weight_set { get; set; }
 
     private double _scale = 1.0;
@@ -95,7 +100,7 @@ private class Boxes.EditableEntry: Alignment {
         entry.override_font (null);
         var desc = entry.get_style_context ().get_font (entry.get_state_flags ());
         if (weight_set)
-            desc.set_weight (weight);
+            desc.set_weight (_weight);
         if (scale_set)
             desc.set_size ((int)(scale * desc.get_size ()));
         entry.override_font (desc);
@@ -109,7 +114,7 @@ private class Boxes.EditableEntry: Alignment {
         if (scale_set)
             attrs.insert (Pango.attr_scale_new (scale));
         if (weight_set)
-            attrs.insert (Pango.attr_weight_new (weight));
+            attrs.insert (Pango.attr_weight_new (_weight));
 
         label.set_attributes (attrs);
         (button.get_child () as Label).set_attributes (attrs);



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