Clone in a terminal:
Commit 810ba4e
Johan Mattsson - 2016-01-14T23:17:09+00:00
810ba4e8bcc20e91f74626a430cc27dc854caef8johan.mattsson.m@gmail.com

Case insensitive CSS styles

Changed files (5)

Diff

diff --git a/birdui/BoxLayout.vala b/birdui/BoxLayout.valaindex 32845bb..fe147ee 100644--- a/birdui/BoxLayout.vala+++ b/birdui/BoxLayout.vala@@ -56,6 +56,8 @@ class BoxLayout : Component { 			component.x = child_x; 			component.y = child_y; 			component.layout ();+			component.apply_padding ();+			 			child_x += component.padded_width; 			 			if (component.height > height) {diff --git a/birdui/Component.vala b/birdui/Component.valaindex 21854f7..878da2a 100644--- a/birdui/Component.vala+++ b/birdui/Component.vala@@ -224,8 +224,9 @@ class Component : GLib.Object { 		 		foreach (Component component in components) { 			component.layout ();-			width = component.width;-			height = component.height;+			component.apply_padding ();+			width = component.padded_width;+			height = component.padded_height; 		} 	} 	diff --git a/birdui/GtkWidget.vala b/birdui/GtkWidget.valaindex 9981c1d..3db70a1 100644--- a/birdui/GtkWidget.vala+++ b/birdui/GtkWidget.vala@@ -15,6 +15,7 @@ using Gtk; using Gdk; using Cairo;+using Math;  namespace Bird { @@ -44,6 +45,10 @@ class Widget : DrawingArea { 			component.draw (cairo_context); 			return true; 		});+		+		int width = (int) rint (component.padded_width);+		int height = (int) rint (component.padded_height);+		set_size_request (width, height); 	} 	 }diff --git a/dodo.py b/dodo.pyindex 460a246..13bac8e 100644--- a/dodo.py+++ b/dodo.py@@ -596,7 +596,7 @@ def make_birdui(target_binary, deps): 			$(pkg-config --libs gobject-2.0) \ 			$(pkg-config --libs xmlbird) \ 			$(pkg-config --libs """ + config.GEE + """) \-			-L ./build/bin -l svgbird \+			-L ./build/bin -l m -l svgbird \ 			-o build/bin/""" + target_binary      libbirdgems = Builder('birdui',diff --git a/libsvgbird/SvgStyle.vala b/libsvgbird/SvgStyle.valaindex a923ba8..77dbfb5 100644--- a/libsvgbird/SvgStyle.vala+++ b/libsvgbird/SvgStyle.vala@@ -37,7 +37,7 @@ public class SvgStyle : GLib.Object { 	}  	public string? get_css_property (string key) {-		return style.get (key);+		return style.get (key.down ()); 	}  	public SvgStyle copy () {@@ -176,8 +176,8 @@ public class SvgStyle : GLib.Object { 					continue; 				} 				-				k = pair[0].strip ();-				v = pair[1].strip ();+				k = pair[0].strip ().down ();+				v = pair[1].strip ().down (); 				 				if (k == "padding") { 					parse_padding_shorthand (v);

Contact

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