- private void command_KeyPress(object o, KeyPressEventArgs e) {
- if (e.Event.Key == Gdk.Key.Escape)
- CommandlineHide();
- }
+ public void CommandlineShow() {
+ commandline.Show();
+ commandline.GrabFocus();
+ }
+
+ public void CommandlineHide() {
+ commandline.Hide();
+ wt.WebView.GrabFocus();
+ }
+
+ private void command_Activate(object o, EventArgs e) {
+ string[] args = Regex.Split(commandline.Text, @"\s+");
+ switch(args[0]) {
+ case "close":
+ wt.CloseTab();
+ break;
+ case "open":
+ if (args.Length < 2) return;
+ wt.OpenUri(args[1]);
+ break;
+ case "tabopen":
+ if (args.Length < 2) return;
+ wt.OpenUriTab(args[1]);
+ wt.Tabs.CurrentPage = wt.Tabs.NPages - 1;
+ break;
+ case "n":
+ wt.Tabs.NextPage();
+ break;
+ case "p":
+ wt.Tabs.PrevPage();
+ break;
+ case "q":
+ wt.Quit();
+ break;
+ }
+ CommandlineHide();
+ }
+
+ private void command_KeyPress(object o, KeyPressEventArgs e) {
+ if (e.Event.Key == Gdk.Key.Escape)
+ CommandlineHide();
+ }