Clone in a terminal:
Commit 884166a
Johan Mattsson - 2016-01-15T21:31:20+00:00
884166a6e938d8017a966cca7a7cf8f152dee009johan.mattsson.m@gmail.com

Fix min-width and min-height properties

Changed files (2)

Diff

diff --git a/birdui/BoxLayout.vala b/birdui/BoxLayout.valaindex 46fa705..cb7f7eb 100644--- a/birdui/BoxLayout.vala+++ b/birdui/BoxLayout.vala@@ -33,16 +33,15 @@ class BoxLayout : Component { 	} 	 	void set_size_limits (Component component) {-		string? min_width = style.get_css_property ("min-width");+		string? min_width = component.style.get_css_property ("min-width"); 		if (min_width != null) { 			double w = SvgFile.parse_number (min_width);-			 			if (component.width < w) { 				component.width = w; 			} 		} -		string? min_height = style.get_css_property ("min-height");+		string? min_height = component.style.get_css_property ("min-height"); 		if (min_height != null) { 			double h = SvgFile.parse_number (min_height); 			@@ -51,7 +50,7 @@ class BoxLayout : Component { 			} 		} 		-		string? max_width = style.get_css_property ("max-width");+		string? max_width = component.style.get_css_property ("max-width"); 		if (max_width != null) { 			double w = SvgFile.parse_number (max_width); 			@@ -60,7 +59,7 @@ class BoxLayout : Component { 			} 		} -		string? max_height = style.get_css_property ("max-height");+		string? max_height = component.style.get_css_property ("max-height"); 		if (max_height != null) { 			double h = SvgFile.parse_number (max_height); 			@@ -81,7 +80,6 @@ class BoxLayout : Component { 			component.apply_padding (); 			set_size_limits (component); -			print (@"$(component), $(component.style)\n"); 			if (orientation == BoxOrientation.HORIZONTAL) { 				child_x += component.padded_width; 				diff --git a/birdui/Component.vala b/birdui/Component.valaindex 8b6f5b8..4561164 100644--- a/birdui/Component.vala+++ b/birdui/Component.vala@@ -112,8 +112,7 @@ class Component : GLib.Object { 	protected void add_component (Component component) { 		components.add (component); 		component.inherit_styles_sheet (defs);-		component.style = SvgStyle.parse (defs, style, component.component_tag);-		+		component.style = SvgStyle.parse (defs, style, component.component_tag);		 		component.set_overflow_property_from_css (); 		component.set_identification (); 	}@@ -162,6 +161,7 @@ class Component : GLib.Object { 			if (attribute_name == "file") { 				Component component = new Component (component_tag, defs); 				add_component (component);+				component.load_layout (attribute.get_content ()); 			} else { 				unused_attribute (attribute_name); 			}@@ -228,6 +228,7 @@ class Component : GLib.Object { 		XmlTree xml_parser = new XmlTree (xml_data); 		 		component_tag = xml_parser.get_root ();+		 		defs = new Defs (); 		parse (component_tag); 		@@ -279,7 +280,7 @@ class Component : GLib.Object { 	} 	 	public virtual string to_string () {-		return @"Component $(component_tag.get_name ())";+		return @"$(component_tag.get_name ())"; 	} 	 	public void print_tree () {

Contact

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