mirror of https://github.com/jroimartin/gocui.git
Added Support to toggle View Frames
This commit is contained in:
parent
553b48c903
commit
8d584203d4
3
gui.go
3
gui.go
|
@ -253,9 +253,12 @@ func (g *Gui) Flush() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, v := range g.views {
|
for _, v := range g.views {
|
||||||
|
if v.Frame == true {
|
||||||
if err := g.drawFrame(v); err != nil {
|
if err := g.drawFrame(v); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := g.draw(v); err != nil {
|
if err := g.draw(v); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
4
view.go
4
view.go
|
@ -32,6 +32,9 @@ type View struct {
|
||||||
// If Highlight is true, Sel{Bg,Fg}Colors will be used
|
// If Highlight is true, Sel{Bg,Fg}Colors will be used
|
||||||
// for the line under the cursor position.
|
// for the line under the cursor position.
|
||||||
Highlight bool
|
Highlight bool
|
||||||
|
|
||||||
|
// If Frame is true, a border will be drawn around the view
|
||||||
|
Frame bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// newView returns a new View object.
|
// newView returns a new View object.
|
||||||
|
@ -42,6 +45,7 @@ func newView(name string, x0, y0, x1, y1 int) *View {
|
||||||
y0: y0,
|
y0: y0,
|
||||||
x1: x1,
|
x1: x1,
|
||||||
y1: y1,
|
y1: y1,
|
||||||
|
Frame: true,
|
||||||
}
|
}
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue