Enable screen resizing
This commit is contained in:
		
							parent
							
								
									b7f2276d18
								
							
						
					
					
						commit
						66695e069b
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								Main.go
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Main.go
									
										
									
									
									
								
							|  | @ -117,6 +117,7 @@ func drawMonth(m time.Month, x, y int) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func drawWall() { | func drawWall() { | ||||||
|  | 	wall.Clear() | ||||||
| 	w, h := wall.Size() | 	w, h := wall.Size() | ||||||
| 	if w < monthWidth + 2 * smallGap || h < monthHeight + 2 * smallGap + titleHeight { | 	if w < monthWidth + 2 * smallGap || h < monthHeight + 2 * smallGap + titleHeight { | ||||||
| 		wrappedText("Екран је премали за календар.", wall, defStyle) | 		wrappedText("Екран је премали за календар.", wall, defStyle) | ||||||
|  | @ -174,6 +175,7 @@ func main() { | ||||||
| 		// Process event | 		// Process event | ||||||
| 		switch ev := ev.(type) { | 		switch ev := ev.(type) { | ||||||
| 		case *tcell.EventResize: | 		case *tcell.EventResize: | ||||||
|  | 			drawWall() | ||||||
| 			wall.Sync() | 			wall.Sync() | ||||||
| 		case *tcell.EventKey: | 		case *tcell.EventKey: | ||||||
| 			if ev.Key() == tcell.KeyEscape || ev.Key() == tcell.KeyCtrlC || | 			if ev.Key() == tcell.KeyEscape || ev.Key() == tcell.KeyCtrlC || | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Petar Kapriš
						Petar Kapriš