set global options in init
This commit is contained in:
parent
65cf744a86
commit
6d1dfed3db
4
help.go
4
help.go
|
@ -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()
|
||||
}
|
||||
|
|
5
init.go
5
init.go
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue