3 Commits

2 changed files with 4 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ func (this *containerBox) Remove (child tomo.Object) {
if index < 0 { return } if index < 0 { return }
box.setParent(nil) box.setParent(nil)
this.children = slices.Delete(this.children, index, index) this.children = slices.Delete(this.children, index, index + 1)
this.invalidateLayout() this.invalidateLayout()
this.invalidateMinimum() this.invalidateMinimum()
} }

View File

@@ -70,7 +70,7 @@ func (this *windowLink) NotifyMinimumSizeChange () {
func (this *Backend) NewWindow (kind tomo.WindowKind, bounds image.Rectangle) (tomo.Window, error) { func (this *Backend) NewWindow (kind tomo.WindowKind, bounds image.Rectangle) (tomo.Window, error) {
this.assert() this.assert()
window, err := this.newWindow(bounds, false) window, err := this.newWindow(bounds, kind == tomo.WindowKindMenu)
if err != nil { return nil, err } if err != nil { return nil, err }
window.setKind(kind) window.setKind(kind)
return window, nil return window, nil
@@ -244,7 +244,7 @@ func (this *window) NewChild (kind tomo.WindowKind, bounds image.Rectangle) (tom
leader := this.leader leader := this.leader
child, err := this.backend.newWindow ( child, err := this.backend.newWindow (
bounds.Add(this.metrics.innerBounds.Min), false) bounds.Add(this.metrics.innerBounds.Min), kind == tomo.WindowKindMenu)
if err != nil { return nil, err } if err != nil { return nil, err }
child.leader = leader child.leader = leader
@@ -473,7 +473,7 @@ func windowKindToType (kind tomo.WindowKind) string {
case tomo.WindowKindNormal: return "NORMAL" case tomo.WindowKindNormal: return "NORMAL"
case tomo.WindowKindPlain: return "DOCK" case tomo.WindowKindPlain: return "DOCK"
case tomo.WindowKindUtility: return "UTILITY" case tomo.WindowKindUtility: return "UTILITY"
case tomo.WindowKindToolbar: return "TOOLBAR" case tomo.WindowKindToolbar: return "MENU"
case tomo.WindowKindMenu: return "POPUP_MENU" case tomo.WindowKindMenu: return "POPUP_MENU"
case tomo.WindowKindModal: return "NORMAL" case tomo.WindowKindModal: return "NORMAL"
default: return strings.ReplaceAll(strings.ToUpper(string(kind)), " ", "_") default: return strings.ReplaceAll(strings.ToUpper(string(kind)), " ", "_")