diff --git a/context.go b/context.go index 0933e74..c4a12fb 100644 --- a/context.go +++ b/context.go @@ -31,6 +31,8 @@ type context struct { trashFrame bool autopos image.Point + finalCmds command.Buffer + dockedWindowFocus int floatWindowFocus int scrollwheelFocus int @@ -48,6 +50,7 @@ func contextAllCommands(ctx *context) { }) } } + ctx.cmds = append(ctx.cmds, ctx.finalCmds.Commands...) return } @@ -114,6 +117,7 @@ func contextBegin(ctx *context, layout *panel) { w.widgets.reset() w.cmds.Reset() } + ctx.finalCmds.Reset() ctx.DockedWindows.Walk(func(w *Window) *Window { w.usingSub = false w.curNode = w.rootNode diff --git a/nucular.go b/nucular.go index 4c38851..35a245d 100644 --- a/nucular.go +++ b/nucular.go @@ -714,7 +714,7 @@ func (win *Window) move(delta image.Point, pos image.Point) { return } if canDock, bounds := win.ctx.DockedWindows.Dock(nil, pos, win.ctx.Windows[0].Bounds, win.ctx.Style.Scaling); canDock { - win.cmds.FillRect(bounds, 0, color.RGBA{0x0, 0x0, 0x50, 0x50}) + win.ctx.finalCmds.FillRect(bounds, 0, color.RGBA{0x0, 0x0, 0x50, 0x50}) } win.Bounds.X = win.Bounds.X + delta.X win.Bounds.X = clampInt(0, win.Bounds.X, win.ctx.Windows[0].Bounds.X+win.ctx.Windows[0].Bounds.W-FontHeight(win.ctx.Style.Font)) @@ -1440,7 +1440,7 @@ func (win *Window) TreePushCustom(type_ TreeType, name string, initial_open bool styleButton = &style.Tab.TabButton } doButton(win, label.S(symbolType), sym, styleButton, in, false) - + out = &win.cmds if !widget_state { out = nil