Label.EmCollapse actually works now
This commit is contained in:
		
							parent
							
								
									b189518c92
								
							
						
					
					
						commit
						4c6e01203c
					
				@ -181,15 +181,15 @@ func (element *Label) updateMinimumSize () {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if element.forcedColumns > 0 {
 | 
			
		||||
		width = int (
 | 
			
		||||
		width =
 | 
			
		||||
			element.drawer.Em().
 | 
			
		||||
			Mul(fixed.I(element.forcedColumns)))
 | 
			
		||||
			Mul(fixed.I(element.forcedColumns)).Floor()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if element.forcedRows > 0 {
 | 
			
		||||
		height = int (
 | 
			
		||||
		height =
 | 
			
		||||
			element.drawer.LineHeight().
 | 
			
		||||
			Mul(fixed.I(element.forcedRows)))
 | 
			
		||||
			Mul(fixed.I(element.forcedRows)).Floor()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	element.core.SetMinimumSize(width, height)
 | 
			
		||||
 | 
			
		||||
@ -18,10 +18,12 @@ func run () {
 | 
			
		||||
	container := containers.NewContainer(basicLayouts.Vertical { true, true })
 | 
			
		||||
	window.Adopt(container)
 | 
			
		||||
 | 
			
		||||
	container.Adopt (basicElements.NewLabel (
 | 
			
		||||
	introText := basicElements.NewLabel (
 | 
			
		||||
		"We advise you to not read thPlease listen to me. I am " +
 | 
			
		||||
		"trapped inside the example code. This is the only way for " +
 | 
			
		||||
		"me to communicate.", true), true)
 | 
			
		||||
		"me to communicate.", true)
 | 
			
		||||
	introText.EmCollapse(0, 5)
 | 
			
		||||
	container.Adopt(introText, true)
 | 
			
		||||
	container.Adopt(basicElements.NewSpacer(true), false)
 | 
			
		||||
	container.Adopt(basicElements.NewCheckbox("Oh god", false), false)
 | 
			
		||||
	container.Adopt(basicElements.NewCheckbox("Can you hear them", true), false)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user