trying to fix padding
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
d58eee556c
commit
cbc579e93a
2
click.go
2
click.go
|
@ -124,7 +124,7 @@ func (w *guiWidget) doWidgetClick() {
|
|||
w.placeWidgets(3, 2)
|
||||
w.showWidgets()
|
||||
|
||||
w.hideFake()
|
||||
hideFake()
|
||||
showDebug = true
|
||||
|
||||
w.dumpTree("after")
|
||||
|
|
|
@ -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
|
||||
|
|
2
main.go
2
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
|
||||
|
|
2
place.go
2
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 {
|
||||
|
|
6
size.go
6
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
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
|
|
12
view.go
12
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()
|
||||
|
|
Loading…
Reference in New Issue