// 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
wtv.WebView.Open(uri);
return true;
}
+
+ public void Scroll(double x, double y) {
+ ScrolledWindow.Hadjustment.Value += x;
+ if (ScrolledWindow.Hadjustment.Value > ScrolledWindow.Hadjustment.Upper - ScrolledWindow.Hadjustment.PageSize)
+ ScrolledWindow.Hadjustment.Value = ScrolledWindow.Hadjustment.Upper - ScrolledWindow.Hadjustment.PageSize;
+ ScrolledWindow.Vadjustment.Value += y;
+ if (ScrolledWindow.Vadjustment.Value > ScrolledWindow.Vadjustment.Upper - ScrolledWindow.Vadjustment.PageSize)
+ ScrolledWindow.Vadjustment.Value = ScrolledWindow.Vadjustment.Upper - ScrolledWindow.Vadjustment.PageSize;
+ }
+
+ public void Bump(int x, int y) {
+ Scroll(x * ScrolledWindow.Hadjustment.StepIncrement, y * ScrolledWindow.Vadjustment.StepIncrement);
+ }
}
}