Made the stripey sunken background optional
This commit is contained in:
		
							parent
							
								
									0f9a33fc57
								
							
						
					
					
						commit
						b2b2a80a06
					
				@ -43,7 +43,7 @@ func (element *ProgressBar) draw () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	artist.FillRectangle (
 | 
						artist.FillRectangle (
 | 
				
			||||||
		element.core,
 | 
							element.core,
 | 
				
			||||||
		theme.SunkenPattern(),
 | 
							theme.SunkenPattern(false),
 | 
				
			||||||
		bounds)
 | 
							bounds)
 | 
				
			||||||
	meterBounds := image.Rect (
 | 
						meterBounds := image.Rect (
 | 
				
			||||||
		bounds.Min.X + 2, bounds.Min.Y + 2,
 | 
							bounds.Min.X + 2, bounds.Min.Y + 2,
 | 
				
			||||||
 | 
				
			|||||||
@ -43,7 +43,7 @@ func (element *AnalogClock) draw () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	artist.FillRectangle (
 | 
						artist.FillRectangle (
 | 
				
			||||||
		element,
 | 
							element,
 | 
				
			||||||
		theme.SunkenPattern(),
 | 
							theme.SunkenPattern(false),
 | 
				
			||||||
		bounds)
 | 
							bounds)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for hour := 0; hour < 12; hour ++ {
 | 
						for hour := 0; hour < 12; hour ++ {
 | 
				
			||||||
 | 
				
			|||||||
@ -32,7 +32,17 @@ var sunkenPattern = artist.NewMultiBordered (
 | 
				
			|||||||
			artist.NewUniform(hex(0x97a09cFF)),
 | 
								artist.NewUniform(hex(0x97a09cFF)),
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	// artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) },
 | 
						artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var texturedSunkenPattern = artist.NewMultiBordered (
 | 
				
			||||||
 | 
						artist.Stroke { Weight: 1, Pattern: strokePattern },
 | 
				
			||||||
 | 
						artist.Stroke {
 | 
				
			||||||
 | 
							Weight: 1,
 | 
				
			||||||
 | 
							Pattern: artist.Beveled {
 | 
				
			||||||
 | 
								artist.NewUniform(hex(0x3b534eFF)),
 | 
				
			||||||
 | 
								artist.NewUniform(hex(0x97a09cFF)),
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	artist.Stroke { Pattern: artist.Striped {
 | 
						artist.Stroke { Pattern: artist.Striped {
 | 
				
			||||||
		First: artist.Stroke {
 | 
							First: artist.Stroke {
 | 
				
			||||||
			Weight: 2,
 | 
								Weight: 2,
 | 
				
			||||||
@ -73,7 +83,16 @@ var deadPattern = artist.NewMultiBordered (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func AccentPattern () (artist.Pattern) { return accentPattern }
 | 
					func AccentPattern () (artist.Pattern) { return accentPattern }
 | 
				
			||||||
func BackgroundPattern () (artist.Pattern) { return backgroundPattern }
 | 
					func BackgroundPattern () (artist.Pattern) { return backgroundPattern }
 | 
				
			||||||
func SunkenPattern () (artist.Pattern) { return sunkenPattern }
 | 
					func DeadPattern () (artist.Pattern) { return deadPattern }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func SunkenPattern (textured bool) (artist.Pattern) {
 | 
				
			||||||
 | 
						if textured {
 | 
				
			||||||
 | 
							return texturedSunkenPattern
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							return sunkenPattern
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func RaisedPattern (selected bool) (artist.Pattern) {
 | 
					func RaisedPattern (selected bool) (artist.Pattern) {
 | 
				
			||||||
	if selected {
 | 
						if selected {
 | 
				
			||||||
		return selectedRaisedPattern
 | 
							return selectedRaisedPattern
 | 
				
			||||||
@ -81,7 +100,7 @@ func RaisedPattern (selected bool) (artist.Pattern) {
 | 
				
			|||||||
		return raisedPattern
 | 
							return raisedPattern
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
func DeadPattern () (artist.Pattern) { return deadPattern }
 | 
					
 | 
				
			||||||
func ForegroundPattern (enabled bool) (artist.Pattern) {
 | 
					func ForegroundPattern (enabled bool) (artist.Pattern) {
 | 
				
			||||||
	if enabled {
 | 
						if enabled {
 | 
				
			||||||
		return foregroundPattern
 | 
							return foregroundPattern
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user