diff options
| -rw-r--r-- | help.go | 4 | ||||
| -rw-r--r-- | init.go | 5 | ||||
| -rw-r--r-- | libnotify.go | 2 | ||||
| -rw-r--r-- | structs.go | 2 |
4 files changed, 10 insertions, 3 deletions
@@ -91,12 +91,12 @@ func showHelp() error { } else { if me.notify.clock.tk == nil { makeClock(me.notify.clock.wId) - me.notify.clock.tk.MoveToOffset(maxX-10, 1) + me.notify.clock.tk.MoveToOffset(maxX-me.notify.clock.offsetW, 1) me.notify.clock.tk.Hide() me.notify.clock.tk.Show() } if me.notify.clock.tk != nil { - me.notify.clock.tk.MoveToOffset(maxX-10, 1) + me.notify.clock.tk.MoveToOffset(maxX-me.notify.clock.offsetW, 1) me.notify.clock.tk.Hide() me.notify.clock.tk.Show() } @@ -149,7 +149,12 @@ func initPlugin() { me.dropdown.wId = -77 me.textbox.wId = -55 me.stdout.wId = -4 + + // the clock widget id and offset me.notify.clock.wId = -5 + me.notify.clock.offsetW = 13 + me.notify.clock.offsetH = 1 + me.notify.menu.wId = -5 Set(&me.dropdown, "default") diff --git a/libnotify.go b/libnotify.go index 19be3c0..fc5e897 100644 --- a/libnotify.go +++ b/libnotify.go @@ -89,7 +89,7 @@ func libNotifyUpdate() { w, h := me.baseGui.Size() if me.winchW != w || me.winchH != h { log.Info("handle SIGWINCH!", w, h) - me.notify.clock.tk.MoveToOffset(w-15, 1) + me.notify.clock.tk.MoveToOffset(w-me.notify.clock.offsetW, me.notify.clock.offsetH) me.notify.clock.tk.Hide() me.notify.clock.tk.Show() me.winchW = w @@ -140,6 +140,8 @@ type internalTK struct { callerTK *guiWidget // which widget called the dropdown menu wId int // the widget id to use active bool // is the internal widget currently in use? + offsetW int // width offset + offsetH int // height offset } // the desktop libnotify menu |
