[Newbies] Browser button decoration colors

P Padilcdx ppadilcdx at gmail.com
Sat Dec 3 21:00:47 UTC 2022


I changed the system browser inheritance button decoration colors as the button label is yellow and with the colors I couldn’t read the button label, which was annoying (my OCD showing).  Not sure if this is of any use to others but here is the code (also not sure how to share this…apologies…I’m a newbie to smalltalk).

CodeHolder >> inheritanceButtonColor
	"Check to see if the currently-viewed method has a super send or an override, and if so, change screen feedback, unless the #decorateBrowserButtons says not to."

	| flags aColor cm defaultButtonColor |
	defaultButtonColor := (UserInterfaceTheme current get: #color for: #PluggableButtonMorph) ifNil: [Color gray: 0.91].
	cm := currentCompiledMethod.
	((cm isKindOf: CompiledMethod) and: [Preferences decorateBrowserButtons])
		ifFalse: [^ defaultButtonColor].

	"This table duplicates the old logic, but adds two new colors for the cases where there is a superclass definition, but this method doesn't call it."

	flags := 0.
	self isThisAnOverride ifTrue: [ flags := flags bitOr: 4 ].
	cm sendsToSuper ifTrue: [ flags := flags bitOr: 2 ].
	self isThereAnOverride ifTrue: [ flags := flags bitOr: 1 ].
	aColor := {
		defaultButtonColor.
		Color tan muchDarker.
		Color green muchDarker.
		Color blue muchDarker.
		Color red muchDarker.	"has super but doesn't call it"
		(Color r: 0.74 g: 0.523 b: 0.573).	"has sub; has super but doesn't call it"
		Color green muchDarker.
		Color blue muchDarker.
	} at: flags + 1.

	^aColor 


More information about the Beginners mailing list