GUI fields now trim leading and trailing whitespace:
This commit is contained in:
@@ -3,6 +3,8 @@ package imgui
|
||||
import (
|
||||
"time"
|
||||
|
||||
"mxl-player/internal/sdl"
|
||||
|
||||
cimgui "github.com/AllenDang/cimgui-go/imgui"
|
||||
)
|
||||
|
||||
@@ -17,9 +19,20 @@ func New() *Context {
|
||||
ctx := cimgui.CreateContext()
|
||||
cimgui.SetCurrentContext(ctx)
|
||||
io := cimgui.CurrentIO()
|
||||
cimgui.CurrentPlatformIO().SetClipboardHandler(sdlClipboardHandler{})
|
||||
return &Context{ctx: ctx, io: io}
|
||||
}
|
||||
|
||||
type sdlClipboardHandler struct{}
|
||||
|
||||
func (sdlClipboardHandler) GetClipboard() string {
|
||||
return sdl.GetClipboardText()
|
||||
}
|
||||
|
||||
func (sdlClipboardHandler) SetClipboard(text string) {
|
||||
sdl.SetClipboardText(text)
|
||||
}
|
||||
|
||||
func (c *Context) Destroy() {
|
||||
cimgui.DestroyContext()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user