From b373eab346cc96c8c790d9713824a9208e435748 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 3 Mar 2025 22:21:39 -0600 Subject: [PATCH] set help window offset --- help.go | 7 ++++++- init.go | 3 +++ structs.go | 1 + treeAdd.go | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/help.go b/help.go index 36731b2..e6294e8 100644 --- a/help.go +++ b/help.go @@ -65,7 +65,12 @@ func showHelp() error { } } - help, err := g.SetView("help", maxX-(newW+me.FramePadW), 0, maxX-1, len(helpText)+me.FramePadH, 0) + a := maxX - (newW + me.FramePadW) + b := me.notify.help.offsetH + c := maxX - 1 + d := me.notify.help.offsetH + len(helpText) + me.FramePadH + + help, err := g.SetView("help", a, b, c, d, 0) if err != nil { if !errors.Is(err, gocui.ErrUnknownView) { return err diff --git a/init.go b/init.go index fa6c3f0..5153c12 100644 --- a/init.go +++ b/init.go @@ -193,6 +193,9 @@ func initPlugin() { me.notify.menu.wId = -6 me.notify.menu.offsetH = 0 + me.notify.help.wId = -7 + me.notify.help.offsetH = 3 + Set(&me.dropdown, "default") // s := fmt.Sprintln("fake default check =", me.FakeW, "dropdown.Id", me.dropdown.Id) // me.stdout.Write([]byte(s)) diff --git a/structs.go b/structs.go index 5d94d50..d3fce8e 100644 --- a/structs.go +++ b/structs.go @@ -151,6 +151,7 @@ type libnotify struct { clock internalTK // widget for the clock menu internalTK // libnotify menu icon window internalTK // the libnotify menu + help internalTK // the help menu } // this is the gocui way diff --git a/treeAdd.go b/treeAdd.go index 884b86c..6bb459b 100644 --- a/treeAdd.go +++ b/treeAdd.go @@ -59,6 +59,7 @@ func addWidget(n *tree.Node) { tk.labelN = "moreSTDOUT" n.State.ProgName = "moreSTDOUT" n.State.Label = "moreSTDOUT" + tk.isFake = true return case widget.Tab: // tk.color = &colorTab