mirror of
				https://github.com/Maks1mS/bubbles.git
				synced 2025-11-04 15:41:21 +03:00 
			
		
		
		
	Add functional argument for setting the width of the progress bar
This commit is contained in:
		
				
					committed by
					
						
						Christian Rocha
					
				
			
			
				
	
			
			
			
						parent
						
							47b8d9c6a8
						
					
				
				
					commit
					5d6d8cb0fb
				
			@@ -60,6 +60,15 @@ func WithoutPercentage() Option {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// WithWidth sets the initial width of the progress bar. Note that you can also
 | 
				
			||||||
 | 
					// set the width via the Width property, which can come in handy if you're
 | 
				
			||||||
 | 
					// waiting for a tea.WindowSizeMsg.
 | 
				
			||||||
 | 
					func WithWidth(w int) Option {
 | 
				
			||||||
 | 
						return func(m *Model) {
 | 
				
			||||||
 | 
							m.Width = w
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Model stores values we'll use when rendering the progress bar.
 | 
					// Model stores values we'll use when rendering the progress bar.
 | 
				
			||||||
type Model struct {
 | 
					type Model struct {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user