[ease/text] Remove the master attribute list.



commit 8ebc8bdc9e29ead765be6b31229219862290ed86
Author: Nate Stedman <natesm gmail com>
Date:   Thu Jan 20 06:22:30 2011 -0500

    Remove the master attribute list.

 ease-core/ease-text.vala  |   15 ++++-----------
 ease-core/ease-theme.vala |    2 +-
 2 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/ease-core/ease-text.vala b/ease-core/ease-text.vala
index f09b2d5..b8426c7 100644
--- a/ease-core/ease-text.vala
+++ b/ease-core/ease-text.vala
@@ -16,7 +16,7 @@
 */
 
 /**
- * Controls a PangoLayout to render rich text to Cairo contexts and Ease
+ * Controls a set of PangoLayouts to render rich text to Cairo contexts and Ease
  * { link TextActors}. Replaces the previous use of ClutterText, which only
  * supported a single font, font size, font style, font weight, and color for a
  * { link TextElement}.
@@ -34,12 +34,6 @@ public class Ease.Text : GLib.Object
 	private Pango.Context context;
 	
 	/**
-	 * The master list of attributes. When this is altered, layouts will be
-	 * updated with attributes for their local lengths and indices.
-	 */
-	private Pango.AttrList attrs;
-	
-	/**
 	 * The width of the text layout.
 	 */
 	public int width { get; set; default = 640; }
@@ -79,9 +73,6 @@ public class Ease.Text : GLib.Object
 		
 		// set layout properties
 		layouts.first().layout.set_ellipsize(Pango.EllipsizeMode.END);
-		
-		// create attribute list
-		attrs = new Pango.AttrList();
 	}
 	
 	/**
@@ -252,6 +243,7 @@ public class Ease.Text : GLib.Object
 	public void clear_set(string text, Pango.FontDescription? font_description)
 	{
 		while (layouts.size > 1) layouts.remove_at(1);
+		
 		layouts.first().text = text;
 		if (font_description != null)
 		{
@@ -264,8 +256,9 @@ public class Ease.Text : GLib.Object
 	 *
 	 * @param attr The attribute to add.
 	 */
-	public void add_attr(Pango.Attribute attr)
+	public void add_attr(Pango.Attribute attr, int layout_index)
 	{
+		layouts.get(layout_index).attrs.insert(attr.copy());
 	}
 	
 	/**
diff --git a/ease-core/ease-theme.vala b/ease-core/ease-theme.vala
index f5ca1d1..91193ee 100644
--- a/ease-core/ease-theme.vala
+++ b/ease-core/ease-theme.vala
@@ -491,7 +491,7 @@ public class Ease.Theme : GLib.Object
 		
 		// create the text element
 		var text = new TextElement("", font);
-		text.text.add_attr(color_attr.copy());
+		text.text.add_attr(color_attr.copy(), 0);
 		
 		// set size properties
 		text.x = x;



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