commit:59c54a6d56a8e161b527c980e2cb468bcf54f371
author:Chip Black
committer:Chip Black
date:Fri Jun 5 02:05:51 2009 -0500
parents:0b2e5f8fffd9ed781a1ddab279dbd6fec5c7695a
Hide tabs by default, add code to Vimish to show/hide tabs
diff --git a/WebThing.cs b/WebThing.cs
line changes: +1/-0
index 7855ae3..5e4ca34
--- a/WebThing.cs
+++ b/WebThing.cs
@@ -90,6 +90,7 @@ namespace bytex64.WebThing {
             _Window.Add(WidgetGrid);
 
             _Tabs = new Gtk.Notebook();
+            _Tabs.ShowBorder = false;
             _Tabs.SwitchPage += Tabs_SwitchPage;
             WidgetGrid.Attach(_Tabs, 1, 2, 1, 2);
 

diff --git a/plugins/Vimish.cs b/plugins/Vimish.cs
line changes: +31/-0
index 8de862a..0b699d8
--- a/plugins/Vimish.cs
+++ b/plugins/Vimish.cs
@@ -10,6 +10,7 @@ public class Vimish : WebThingPlugin {
 
     public override void Init(WebThing wt) {
         this.wt = wt;
+        wt.Tabs.ShowTabs = false;
 
         wt.Window.KeyPressEvent += Window_KeyPress;
 
@@ -30,9 +31,15 @@ public class Vimish : WebThingPlugin {
         case Gdk.Key.o:
             CommandStart("open ");
             break;
+        case Gdk.Key.O:
+            CommandStart("open " + wt.WebView.MainFrame.Uri);
+            break;
         case Gdk.Key.t:
             CommandStart("tabopen ");
             break;
+        case Gdk.Key.T:
+            CommandStart("tabopen " + wt.WebView.MainFrame.Uri);
+            break;
         case Gdk.Key.colon:
             CommandlineShow();
             break;
@@ -115,10 +122,34 @@ public class Vimish : WebThingPlugin {
         case "q":
             wt.Quit();
             break;
+        case "set":
+            if (args.Length == 2)
+                SetVar(args[1], "");
+            else
+                SetVar(args[1], args[2]);
+            break;
         }
         CommandlineHide();
     }
 
+    public void SetVar(string key, string val) {
+        switch(key) {
+        case "showtabs":
+            wt.Tabs.ShowTabs = true;
+            break;
+        case "hidetabs":
+            wt.Tabs.ShowTabs = false;
+            break;
+        default:
+            Error("No variable {0}", key);
+            break;
+        }
+    }
+
+    private void Error(string format, params object[] values) {
+        Console.WriteLine(format, values);
+    }
+
     private void command_KeyPress(object o, KeyPressEventArgs e) {
         if (e.Event.Key == Gdk.Key.Escape)
             CommandlineHide();