|
|
|
@@ -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)), " ", "_")
|
|
|
|
|