Compare commits

...

2 Commits

Author SHA1 Message Date
9dc929f545 Update window.go 2024-05-26 15:20:25 -04:00
0f9c27c19a Fix ContainerBox's SetTexture methods 2024-05-26 15:20:11 -04:00
2 changed files with 13 additions and 7 deletions

View File

@ -36,9 +36,15 @@ func (this *containerBox) SetColor (c color.Color) {
this.invalidateTransparentChildren()
}
func (this *containerBox) SetTexture (texture canvas.Texture) {
func (this *containerBox) SetTextureTile (texture canvas.Texture) {
if this.texture == texture { return }
this.box.SetTexture(texture)
this.box.SetTextureTile(texture)
this.invalidateTransparentChildren()
}
func (this *containerBox) SetTextureCenter (texture canvas.Texture) {
if this.texture == texture { return }
this.box.SetTextureTile(texture)
this.invalidateTransparentChildren()
}

View File

@ -267,10 +267,10 @@ func (window *window) Paste (callback func (data.Data, error), accept ...data.Mi
}
func (window *window) SetVisible (visible bool) {
if this.visible == visible { return }
if window.visible == visible { return }
window.visible = visible
if this.visible {
if window.visible {
window.xWindow.Map()
if window.shy { window.grabInput() }
} else {
@ -280,7 +280,7 @@ func (window *window) SetVisible (visible bool) {
}
func (window *window) Visible () bool {
return this.visible
return window.visible
}
func (window *window) Close () {
@ -293,7 +293,7 @@ func (window *window) Close () {
// we are a modal dialog, so unlock the parent
window.modalParent.hasModal = false
}
window.Hide()
window.SetVisible(false)
window.SetRoot(nil)
delete(window.backend.windows, window.xWindow.Id)
window.xWindow.Destroy()
@ -377,7 +377,7 @@ func (window *window) pushRegion (region image.Rectangle) {
return
}
subCanvas := window.xCanvas.Clip(region)
subCanvas := window.xCanvas.SubCanvas(region)
if subCanvas == nil {
return
}