summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
Diffstat (limited to 'find.go')
-rw-r--r--find.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/find.go b/find.go
index 30344de..87ce832 100644
--- a/find.go
+++ b/find.go
@@ -5,6 +5,7 @@ package main
import (
"github.com/awesome-gocui/gocui"
+ log "go.wit.com/log"
"go.wit.com/widget"
)
@@ -57,6 +58,44 @@ func (tk *guiWidget) findByXYreal(w int, h int) []*guiWidget {
return widgets
}
+func (tk *guiWidget) setFullSize() rectType {
+ r := tk.getFullSize()
+
+ /*
+ r.w0 = tk.gocuiSize.w0
+ r.w1 = tk.gocuiSize.w1
+ r.h0 = tk.gocuiSize.h0
+ r.h1 = tk.gocuiSize.h1
+ */
+ var changed bool
+ if tk.gocuiSize.w0 != r.w0 {
+ tk.gocuiSize.w0 = r.w0
+ changed = true
+ }
+ if tk.gocuiSize.w1 != r.w1 {
+ tk.gocuiSize.w1 = r.w1
+ changed = true
+ }
+ if tk.gocuiSize.h0 != r.h0 {
+ tk.gocuiSize.h0 = r.h0
+ changed = true
+ }
+ if tk.gocuiSize.h1 != r.h1 {
+ tk.gocuiSize.h1 = r.h1
+ changed = true
+ }
+ if changed {
+ if tk.node.WidgetType == widget.Window {
+ log.Info("REDRAW WINDOW IN setFullSize()")
+ tk.gocuiSize.w1 = r.w1 + 2
+ tk.gocuiSize.h1 = r.h1 + 1
+ tk.Hide()
+ tk.drawView()
+ }
+ }
+ return r
+}
+
// this checks a widget to see if it is under (W,H), then checks the widget's children
// anything that matches is passed back as an array of widgets
func (tk *guiWidget) getFullSize() rectType {