Minor Edits to UIMiniWindow
Allow for a double click on the Top Bar of a UIMiniWindow to function the same as pessing the minimize/maximize button.
This commit is contained in:
		
							parent
							
								
									9610106088
								
							
						
					
					
						commit
						a1f5a88fe7
					
				| 
						 | 
				
			
			@ -15,6 +15,17 @@ MiniWindow < UIMiniWindow
 | 
			
		|||
  $on:
 | 
			
		||||
    image-border-bottom: 2
 | 
			
		||||
 | 
			
		||||
  UIWidget
 | 
			
		||||
    id: miniwindowTopBar
 | 
			
		||||
    anchors.top: parent.top
 | 
			
		||||
    anchors.right: parent.right
 | 
			
		||||
    anchors.left: parent.left
 | 
			
		||||
    margin-right: 3
 | 
			
		||||
    margin-left: 3
 | 
			
		||||
    margin-top: 3
 | 
			
		||||
    size: 258 18
 | 
			
		||||
    phantom: true
 | 
			
		||||
 | 
			
		||||
  UIButton
 | 
			
		||||
    id: closeButton
 | 
			
		||||
    anchors.top: parent.top
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -81,6 +81,15 @@ function UIMiniWindow:setup()
 | 
			
		|||
        self:minimize()
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
    
 | 
			
		||||
  self:getChildById('miniwindowTopBar').onDoubleClick =
 | 
			
		||||
    function()
 | 
			
		||||
      if self:isOn() then
 | 
			
		||||
        self:maximize()
 | 
			
		||||
      else
 | 
			
		||||
        self:minimize()
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
  local oldParent = self:getParent()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue