From 8d584203d490c79a0a8a56d9237b2c4e1ecaa726 Mon Sep 17 00:00:00 2001 From: Ryan Sullivan Date: Fri, 17 Oct 2014 17:22:28 -0400 Subject: [PATCH] Added Support to toggle View Frames --- gui.go | 7 +++++-- view.go | 14 +++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gui.go b/gui.go index c0d2bf7..08ee368 100644 --- a/gui.go +++ b/gui.go @@ -253,9 +253,12 @@ func (g *Gui) Flush() error { return err } for _, v := range g.views { - if err := g.drawFrame(v); err != nil { - return err + if v.Frame == true { + if err := g.drawFrame(v); err != nil { + return err + } } + if err := g.draw(v); err != nil { return err } diff --git a/view.go b/view.go index db3c278..86bde72 100644 --- a/view.go +++ b/view.go @@ -32,16 +32,20 @@ type View struct { // If Highlight is true, Sel{Bg,Fg}Colors will be used // for the line under the cursor position. Highlight bool + + // If Frame is true, a border will be drawn around the view + Frame bool } // newView returns a new View object. func newView(name string, x0, y0, x1, y1 int) *View { v := &View{ - name: name, - x0: x0, - y0: y0, - x1: x1, - y1: y1, + name: name, + x0: x0, + y0: y0, + x1: x1, + y1: y1, + Frame: true, } return v }