summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--click.go2
-rw-r--r--keybindings.go6
-rw-r--r--main.go2
-rw-r--r--place.go2
-rw-r--r--size.go6
-rw-r--r--structs.go8
-rw-r--r--view.go12
7 files changed, 28 insertions, 10 deletions
diff --git a/click.go b/click.go
index fa46749..f95f122 100644
--- a/click.go
+++ b/click.go
@@ -124,7 +124,7 @@ func (w *guiWidget) doWidgetClick() {
w.placeWidgets(3, 2)
w.showWidgets()
- w.hideFake()
+ hideFake()
showDebug = true
w.dumpTree("after")
diff --git a/keybindings.go b/keybindings.go
index b513424..f798fdb 100644
--- a/keybindings.go
+++ b/keybindings.go
@@ -50,13 +50,11 @@ func addDebugKeys(g *gocui.Gui) {
func(g *gocui.Gui, v *gocui.View) error {
fakeStartWidth = me.FakeW
fakeStartHeight = me.TabH + me.FramePadH
- var w *guiWidget
- w = me.treeRoot.TK.(*guiWidget)
if showDebug {
- w.showFake()
+ showFake()
showDebug = false
} else {
- w.hideFake()
+ hideFake()
showDebug = true
}
return nil
diff --git a/main.go b/main.go
index ab6d902..6de0402 100644
--- a/main.go
+++ b/main.go
@@ -19,6 +19,8 @@ func init() {
// init the config struct default values
Set(&me, "default")
+ // Set(&me, "dense")
+
me.myTree = tree.New()
me.myTree.PluginName = "gocui"
me.myTree.ActionFromChannel = action
diff --git a/place.go b/place.go
index 48d7b3a..c0cf1b9 100644
--- a/place.go
+++ b/place.go
@@ -77,7 +77,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
tk.dumpTree("start place")
newW := startW + me.GroupPadW
- newH := startH + 3 // normal hight of the group label
+ newH := startH + 1 // normal hight of the group label
var maxW int = 0
// now move all the children aka: run place() on them
for _, child := range tk.children {
diff --git a/size.go b/size.go
index d04a8e8..1feab7a 100644
--- a/size.go
+++ b/size.go
@@ -43,7 +43,7 @@ func (tk *guiWidget) Size() (int, int) {
maxW = sizeW
}
}
- return maxW, maxH
+ return maxW + me.GroupPadW, maxH
}
if tk.isFake {
return 0, 0
@@ -75,7 +75,7 @@ func (w *guiWidget) sizeGrid() (int, int) {
for _, h := range w.heights {
totalH += h
}
- return totalW, totalH
+ return totalW + me.GridPadW, totalH
}
func (tk *guiWidget) sizeBox() (int, int) {
@@ -99,5 +99,5 @@ func (tk *guiWidget) sizeBox() (int, int) {
}
}
}
- return maxW, maxH
+ return maxW + me.BoxPadW, maxH
}
diff --git a/structs.go b/structs.go
index 85ac890..2b1e4ca 100644
--- a/structs.go
+++ b/structs.go
@@ -76,7 +76,13 @@ type config struct {
TabPadW int `default:"4" dense:"0"`
// additional amount of space to indent on a group
- GroupPadW int `default:"6" dense:"2"`
+ GroupPadW int `default:"4" dense:"1"`
+
+ // additional amount of space to indent on a group
+ BoxPadW int `default:"2" dense:"1"`
+
+ // additional amount of space to indent on a group
+ GridPadW int `default:"2" dense:"1"`
// the raw beginning of each window (or tab)
RawW int `default:"1"`
diff --git a/view.go b/view.go
index 138e2df..4da4ada 100644
--- a/view.go
+++ b/view.go
@@ -184,6 +184,18 @@ func (w *guiWidget) hideWidgets() {
}
}
+func hideFake() {
+ var w *guiWidget
+ w = me.treeRoot.TK.(*guiWidget)
+ w.hideFake()
+}
+
+func showFake() {
+ var w *guiWidget
+ w = me.treeRoot.TK.(*guiWidget)
+ w.showFake()
+}
+
func (w *guiWidget) hideFake() {
if w.isFake {
w.hideView()