Add default size configuration
[WebThing.git] / WebThing.cs
index 5e2000b..8bc589a 100644 (file)
@@ -65,6 +65,21 @@ namespace bytex64.WebThing {
             // based on the executable name, which I don't like.
             _Window.SetWmclass("webthing", "WebThing");  
             _Window.Role = "browser";
+            {
+                int w, h;
+
+                if (Config.Options.ContainsKey("Width"))
+                    w = Convert.ToInt32(Config.Options["Width"]);
+                else
+                    w = 640;
+
+                if (Config.Options.ContainsKey("Height"))
+                    h = Convert.ToInt32(Config.Options["Height"]);
+                else
+                    h = 480;
+
+                _Window.DefaultSize = new Gdk.Size(w, h);
+            }
             _Window.Destroyed += delegate { Quit(); };
 
             // Initialize WidgetGrid