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.placeWidgets(3, 2)
|
||||||
w.showWidgets()
|
w.showWidgets()
|
||||||
|
|
||||||
w.hideFake()
|
hideFake()
|
||||||
showDebug = true
|
showDebug = true
|
||||||
|
|
||||||
w.dumpTree("after")
|
w.dumpTree("after")
|
||||||
|
|
|
@ -50,13 +50,11 @@ func addDebugKeys(g *gocui.Gui) {
|
||||||
func(g *gocui.Gui, v *gocui.View) error {
|
func(g *gocui.Gui, v *gocui.View) error {
|
||||||
fakeStartWidth = me.FakeW
|
fakeStartWidth = me.FakeW
|
||||||
fakeStartHeight = me.TabH + me.FramePadH
|
fakeStartHeight = me.TabH + me.FramePadH
|
||||||
var w *guiWidget
|
|
||||||
w = me.treeRoot.TK.(*guiWidget)
|
|
||||||
if showDebug {
|
if showDebug {
|
||||||
w.showFake()
|
showFake()
|
||||||
showDebug = false
|
showDebug = false
|
||||||
} else {
|
} else {
|
||||||
w.hideFake()
|
hideFake()
|
||||||
showDebug = true
|
showDebug = true
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
2
main.go
2
main.go
|
@ -19,6 +19,8 @@ func init() {
|
||||||
// init the config struct default values
|
// init the config struct default values
|
||||||
Set(&me, "default")
|
Set(&me, "default")
|
||||||
|
|
||||||
|
// Set(&me, "dense")
|
||||||
|
|
||||||
me.myTree = tree.New()
|
me.myTree = tree.New()
|
||||||
me.myTree.PluginName = "gocui"
|
me.myTree.PluginName = "gocui"
|
||||||
me.myTree.ActionFromChannel = action
|
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")
|
tk.dumpTree("start place")
|
||||||
|
|
||||||
newW := startW + me.GroupPadW
|
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
|
var maxW int = 0
|
||||||
// now move all the children aka: run place() on them
|
// now move all the children aka: run place() on them
|
||||||
for _, child := range tk.children {
|
for _, child := range tk.children {
|
||||||
|
|
6
size.go
6
size.go
|
@ -43,7 +43,7 @@ func (tk *guiWidget) Size() (int, int) {
|
||||||
maxW = sizeW
|
maxW = sizeW
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return maxW, maxH
|
return maxW + me.GroupPadW, maxH
|
||||||
}
|
}
|
||||||
if tk.isFake {
|
if tk.isFake {
|
||||||
return 0, 0
|
return 0, 0
|
||||||
|
@ -75,7 +75,7 @@ func (w *guiWidget) sizeGrid() (int, int) {
|
||||||
for _, h := range w.heights {
|
for _, h := range w.heights {
|
||||||
totalH += h
|
totalH += h
|
||||||
}
|
}
|
||||||
return totalW, totalH
|
return totalW + me.GridPadW, totalH
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tk *guiWidget) sizeBox() (int, int) {
|
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"`
|
TabPadW int `default:"4" dense:"0"`
|
||||||
|
|
||||||
// additional amount of space to indent on a group
|
// 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)
|
// the raw beginning of each window (or tab)
|
||||||
RawW int `default:"1"`
|
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() {
|
func (w *guiWidget) hideFake() {
|
||||||
if w.isFake {
|
if w.isFake {
|
||||||
w.hideView()
|
w.hideView()
|
||||||
|
|
Loading…
Reference in New Issue