Skip to content

Commit aa8fa57

Browse files
committed
debugui: refactoring
1 parent 19d0864 commit aa8fa57

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (c *Context) Window(title string, rect image.Rectangle, f func(layout Conta
7878

7979
func (c *Context) window(title string, bounds image.Rectangle, opt option, f func(layout ContainerLayout)) (err error) {
8080
id := c.idFromGlobalString(title)
81-
c.idScopeFromControlID(id, func() {
81+
c.idScopeFromGlobalString(title, func() {
8282
err = c.doWindow(title, bounds, opt, id, f)
8383
})
8484
return

id.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func (c *Context) IDScope(name string, f func()) {
3333
f()
3434
}
3535

36-
func (c *Context) idScopeFromControlID(controlID controlID, f func()) {
37-
c.idStack = append(c.idStack, controlID)
36+
func (c *Context) idScopeFromGlobalString(name string, f func()) {
37+
c.idStack = append(c.idStack, controlID(fmt.Sprintf("string:%q", name)))
3838
defer func() {
3939
c.idStack = slices.Delete(c.idStack, len(c.idStack)-1, len(c.idStack))
4040
}()

panel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (c *Context) Panel(name string, f func(layout ContainerLayout)) {
1414

1515
func (c *Context) panel(name string, opt option, f func(layout ContainerLayout)) (err error) {
1616
id := c.idFromGlobalString(name)
17-
c.idScopeFromControlID(id, func() {
17+
c.idScopeFromGlobalString(name, func() {
1818
err = c.doPanel(opt, id, f)
1919
})
2020
return

0 commit comments

Comments
 (0)