[squeak-dev] [ENH] InheritanceButtonInBrowser

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Sun Dec 18 21:04:21 UTC 2022


Hi Pete,

thanks for the patch! :-)

Regarding the optics: The inheritance button now looks very beautiful to me in the themes Community (dark) and Monokai (dark). For the other themes, my personal impression is that for some states, the button now has a very garish color (esp. the bright red and green). Maybe you could desaturize the colors a bit for these themes?

Regarding the implementation:
* You can rewrite all the "(UserInterfaceTheme current get: #inheritanceButtonColorHasOverride for: #CodeHolder)" to just "self userInterfaceTheme inheritanceButtonColorHasOverride" for simplicity. :)
* I don't think we need all these *withFontSize: selectors. Mainly, they introduce a lot of duplication, making it harder to apply any further changes to the themes. I did not understand why you need this convenience. You can simply evaluate "UserInterfaceTheme cleanUpAndReset" after accepting a change in any of the methods, and the prior scale factor should be kept. (We will also need to remember to add a postscript to the patch that automatically evaluates this script after the changes are loaded. This is also described in the "Contributing to Squeak" help under Advanced.)
* Otherwise, everything looks great to me. :-)

Regarding the patch format: I had some problems with downloading the attachment from archive, but this is likely not your fault, no idea what is going on here ... Also, when I tried to install the changeset in my image, I got a syntax error for a missing quote in preamble. Probably you removed that by accident. No biggie. :-)

Please keep your ideas coming, I'm looking forward to your next patch!

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2022-12-09T14:31:49-08:00, ppadilcdx at gmail.com wrote:

> 'From Squeak6.1alpha of 7 December 2022 [latest update: #22301] on 9 December 2022 at 2:10:59 pm'!
> "Change Set:        InheritanceButtonInBrowser
> Date:            9 December 2022
> Author:            Pete
> 
> Changes to the themes and CodeHolder to use the themes' colors on the Inheritance button. Updated colors in the theme so that the button text looks reasonable. The color changes are in the themes' addToolColors: method.
> 
> Added methods to the themes to start with a different font size (a parameter to the new methods).  Mainly a convinience for me to allow me to test with larger font settings as the default ones are microscopic in my display.
> 
> Regards 
> Pete!
> 
> 
> !CodeHolder methodsFor: 'toolbuilder' stamp: 'PAP 12/8/2022 18:53'!
> 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.
>         (UserInterfaceTheme current get: #inheritanceButtonColorHasOverride for: #CodeHolder).
>         (UserInterfaceTheme current get: #inheritanceButtonColorSendsSuper for: #CodeHolder).
>         (UserInterfaceTheme current get: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder).
>         (UserInterfaceTheme current get: #inheritanceButtonColorIsOverride for: #CodeHolder).    "has super but doesn't call it"
>         (UserInterfaceTheme current get: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder).    "has sub; has super but doesn't call it"
>         (UserInterfaceTheme current get: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder).
>         (UserInterfaceTheme current get: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder).
>     } at: flags + 1.
> 
>     ^aColor! !
> 
> 
> !CommunityTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:44'!
> addDarkFonts: aUserInterfaceTheme withFontSize: size
>     "Set-up fonts."
>     aUserInterfaceTheme
>         set: #balloonHelpFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 7.5 emphasized: TextEmphasis italic emphasisCode);
>         set: #standardButtonFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardCodeFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode);
>         set: #haloLabelFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 10.5);
>         set: #standardListFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardSystemFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #windowTitleFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: (size/1.3) emphasized: TextEmphasis bold emphasisCode)! !
> 
> !CommunityTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:28'!
> addDarkToolColors: theme
>     "Tool-specific colors."
>     
>     theme 
>         set: #failureColor for: #TestRunner to: self dbYellow;
>         set: #errorColor for: #TestRunner to: self dbRed;
>         set: #passColor for: #TestRunner to: self dbGreen.
>         
>     "Browser."
>     theme
>         set: #noClassCommentColor for: #Browser to: self dbRed;
>         set: #deprecatedMessageAttributes for: #CodeHolder to: { TextEmphasis struckOut. TextColor color: self dbGray }.
>         
>     "CodeHolder"
>     theme
>         set: #inheritanceButtonColorDefault for: #CodeHolder to: self dbBackground;
>         set: #inheritanceButtonColorHasOverride for: #CodeHolder to: Color tan muchDarker;
>         set: #inheritanceButtonColorIsOverride for: #CodeHolder to: Color red  muchDarker;
>         set: #inheritanceButtonColorSendsSuper for: #CodeHolder to: Color green muchDarker;
>         set: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder to: Color green muchDarker;
>         set: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder to: Color blue muchDarker;
>         set: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder to: Color orange muchDarker.
>         ! !
> 
> !CommunityTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:49'!
> createDarkWithFontSize: size
>     "self createDark apply."
>     | name |
>     name := 'Community (dark)'.
>     ^ (self named: name) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: name.
>         "General morph stuff."
>         theme
>             set: #borderColor for: #ScrollPane to: (Color transparent) ;
>             set: #keyboardFocusColor for: #Morph to: (self dbSelection adjustSaturation: -0.3 brightness: 0.10);
>             set: #keyboardFocusWidth for: #Morph to: 1;
>             set: #softShadowColor for: #Morph to: (self dbSelection muchLighter alpha: 0.025);
>             set: #softShadowOffset for: #Morph to: (10 at 8 corner: 10 at 12);
>             set: #hardShadowColor for: #Morph to: (self dbSelection muchLighter alpha: 0.02);
>             set: #hardShadowOffset for: #Morph to: 1 at 1.
>         
>         self
>             addDarkFonts: theme withFontSize: size;
>             addDarkWindowColors: theme;
>             addDarkSyntaxHighlighting: theme;
>             addDarkScrollables: theme;
>             addDarkButtons: theme;
>             addDarkDialogs: theme;
>             addDarkMenusAndDockingBars: theme;
>             addDarkToolColors: theme.
>         theme]! !
> 
> 
> !MonokaiTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:05'!
> addDarkFonts: theme withFontSize: size
> 
>     "Set-up fonts."
>     theme
>         set: #balloonHelpFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: (size/2));
>         set: #standardButtonFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardCodeFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode);
>         set: #haloLabelFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 10.5);
>         set: #standardListFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardSystemFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #windowTitleFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: (size/1.5)).! !
> 
> !MonokaiTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 12:03'!
> addDarkToolColors: theme
>     "Tool-specific colors."
>     
>     theme 
>         set: #failureColor for: #TestRunner to: self yellow;
>         set: #errorColor for: #TestRunner to: self red;
>         set: #passColor for: #TestRunner to: self green;
>         
>         set: #failureTextColor for: #TestRunner to: self backgroundColor;
>         set: #errorTextColor for: #TestRunner to: self backgroundColor;
>         set: #passTextColor for: #TestRunner to: self backgroundColor.
>         
>     theme
>         set: #ignoredOperationAttributes for: #MCOperationsBrowser to: {TextColor color: self grayLight}.
>         
>     "Browser."
>     theme
>         set: #noClassCommentColor for: #Browser to: self red;
>         set: #deprecatedMessageAttributes for: #CodeHolder to: { TextEmphasis struckOut. TextColor color: self grayLight }.
>         
>     "CodeHolder"
>     theme
>         set: #inheritanceButtonColorDefault for: #CodeHolder to: self backgroundColor ;
>         set: #inheritanceButtonColorHasOverride for: #CodeHolder to: (Color r: 0.6 g: 0.6 b: 0.3);
>         set: #inheritanceButtonColorIsOverride for: #CodeHolder to: Color red muchDarker;
>         set: #inheritanceButtonColorSendsSuper for: #CodeHolder to: Color green muchDarker;
>         set: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder to: Color green muchDarker;
>         set: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder to: Color blue muchDarker;
>         set: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder to: Color orange muchDarker.
>         ! !
> 
> !MonokaiTheme class methodsFor: 'instance creation' stamp: 'mt 8/16/2016 13:24'!
> addDarkWindowColors: theme
>     "self createDark apply."
>     theme
>         set: #uniformWindowColor for: #Model to:( self invisibleColor adjustBrightness: 0.16) "lighter twice";
>         
>         set: #unfocusedWindowColorModifier for: #SystemWindow to: [ [:color | color adjustBrightness: -0.16 "darker twice"] ];
>         set: #unfocusedLabelColor for: #SystemWindow to: [
>             Model useColorfulWindows
>                 ifTrue: [(Color r: 0.285 g: 0.282 b: 0.242) "invisible color"]
>                 ifFalse: [(Color r: 0.972 g: 0.972 b: 0.948) "foreground color"] ];
>         set: #focusedLabelColor for: #SystemWindow to: [
>             Model useColorfulWindows
>                 ifTrue: [(Color r: 0.152 g: 0.156 b: 0.133) "background color"]
>                 ifFalse: [(Color r: 0.901 g: 0.858 b: 0.455) "yellow"] ];
> 
>         set: #customWindowColor for: #Browser to: self green duller;
>         set: #customWindowColor for: #ChangeList to: self blue duller;
>         set: #customWindowColor for: #ChangeSorter to: self blue duller;
>         set: #customWindowColor for: #ChatNotes to: self magenta duller;
>         set: #customWindowColor for: #ClassCommentVersionsBrowser to: self violet duller;
>         set: #customWindowColor for: #Debugger to: self red duller;
>         set: #customWindowColor for: #DualChangeSorter to: self blue duller;
>         set: #customWindowColor for: #FileContentsBrowser to: self yellow duller;
>         set: #customWindowColor for: #FileList to: self yellow duller;
>         set: #customWindowColor for: #InstanceBrowser to: self cyan duller;
>         set: #customWindowColor for: #Lexicon to: self cyan duller;
>         set: #customWindowColor for: #MCTool to: self violet duller;
>         set: #customWindowColor for: #MessageNames to: self green duller;
>         set: #customWindowColor for: #MessageSet to: self cyan duller;
>         set: #customWindowColor for: #PackagePaneBrowser to: self green duller;
>         set: #customWindowColor for: #PluggableFileList to: self yellow duller;
>         set: #customWindowColor for: #PreferenceBrowser to: self cyan duller;
>         set: #customWindowColor for: #SMLoader to: self orange duller;
>         set: #customWindowColor for: #SMLoaderPlus to: self orange duller;
>         set: #customWindowColor for: #SMReleaseBrowser to: self orange duller;
>         set: #customWindowColor for: #ScriptingDomain to: self yellow duller;
>         set: #customWindowColor for: #SelectorBrowser to: self cyan duller;
>         set: #customWindowColor for: #StringHolder to: self yellow duller;
>         set: #customWindowColor for: #TestRunner to: self orange duller;
>         set: #customWindowColor for: #TranscriptStream to: self orange duller;
>         set: #customWindowColor for: #VersionsBrowser to: self violet duller.! !
> 
> !MonokaiTheme class methodsFor: 'instance creation' stamp: 'PAP 12/8/2022 14:37'!
> createDark
>     "self createDark apply."
>     | themeName |
>     themeName := 'Monokai (dark)'.
>     ^ (self named: themeName) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: themeName.
>         
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: self yellow;
>             set: #keyboardFocusWidth for: #Morph to: 1.
> 
>         theme set: #background for: #SystemWindow to: self backgroundColor.
> 
>         self
>             addDarkFonts: theme;
>             addDarkWindowColors: theme;
>             addDarkSyntaxHighlighting: theme;
>             addDarkScrollables: theme;
>             addDarkButtons: theme;
>             addDarkDialogs: theme;
>             addDarkMenusAndDockingBars: theme;
>             addDarkToolColors: theme.
> 
>         theme]! !
> 
> !MonokaiTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:46'!
> createDarkWithFontSize: size
>     "self createDark apply."
>     | themeName |
>     themeName := 'Monokai (dark)'.
>     ^ (self named: themeName) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: themeName.
>         
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: self yellow;
>             set: #keyboardFocusWidth for: #Morph to: 1.
> 
>         theme set: #background for: #SystemWindow to: self backgroundColor.
> 
>         self
>             addDarkFonts: theme withFontSize: size;
>             addDarkWindowColors: theme;
>             addDarkSyntaxHighlighting: theme;
>             addDarkScrollables: theme;
>             addDarkButtons: theme;
>             addDarkDialogs: theme;
>             addDarkMenusAndDockingBars: theme;
>             addDarkToolColors: theme.
> 
>         theme]! !
> 
> 
> !SolarizedTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:59'!
> addDarkFonts: theme withFontSize: size
> 
>     "Set-up fonts."
>     theme
>         set: #balloonHelpFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: (size/2));
>         set: #standardButtonFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #standardCodeFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode);
>         set: #haloLabelFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #standardListFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #standardSystemFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size);
>         set: #windowTitleFont to: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: (size/1.5)).! !
> 
> !SolarizedTheme class methodsFor: 'instance creation' stamp: 'PAP 12/8/2022 18:30'!
> addDarkToolColors: theme
>     "Tool-specific colors."
>     
>     theme 
>         set: #failureColor for: #TestRunner to: self yellow;
>         set: #errorColor for: #TestRunner to: self red;
>         set: #passColor for: #TestRunner to: self green;
>         
>         set: #failureTextColor for: #TestRunner to: self darkBackground;
>         set: #errorTextColor for: #TestRunner to: self darkBackground;
>         set: #passTextColor for: #TestRunner to: self darkBackground.
>         
>     theme
>         set: #ignoredOperationAttributes for: #MCOperationsBrowser to: {TextColor color: self darkContentSecondary}.
>     
>     "Browser."
>     theme
>         set: #noClassCommentColor for: #Browser to: self red;
>         set: #deprecatedMessageAttributes for: #CodeHolder to: { TextEmphasis struckOut. TextColor color: self darkContentSecondary }.
>         
>     "CodeHolder"
>     theme
>         set: #inheritanceButtonColorDefault for: #CodeHolder to: self darkBackground;
>         set: #inheritanceButtonColorHasOverride for: #CodeHolder to: Color tan;
>         set: #inheritanceButtonColorIsOverride for: #CodeHolder to: Color red;
>         set: #inheritanceButtonColorSendsSuper for: #CodeHolder to: Color green;
>         set: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder to: Color green darker;
>         set: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder to: Color blue;
>         set: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder to: Color orange.! !
> 
> !SolarizedTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:58'!
> addLightFonts: theme withFontSize: size
> 
>     "Set-up fonts."
>     theme
>         set: #balloonHelpFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: (size/2));
>         set: #standardButtonFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #standardCodeFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode);
>         set: #haloLabelFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #standardListFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #standardSystemFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: size);
>         set: #windowTitleFont to: (StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: (size/1.5) emphasized: TextEmphasis bold emphasisCode).! !
> 
> !SolarizedTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 12:00'!
> createDarkWithFontSize: size
>     "doIt: [self createDark apply.]"
> 
>     | themeName |
>     themeName := 'Solarized (dark)'.
>     ^ (self named: themeName) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: themeName.
> 
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: self darkContentSecondary;
>             set: #keyboardFocusWidth for: #Morph to: 1.
> 
>         theme set: #background for: #MorphicProject to: self darkBackgroundForm.
> 
>         self
>             addDarkFonts: theme withFontSize: size;
>             addDarkWindowColors: theme;
>             addDarkSyntaxHighlighting: theme;
>             addDarkScrollables: theme;
>             addDarkButtons: theme;
>             addDarkDialogs: theme;
>             addDarkMenusAndDockingBars: theme;
>             addDarkToolColors: theme.
> 
>         theme]! !
> 
> !SolarizedTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 12:00'!
> createLightWithFontSize: size
>     "You have to create dark first.
>     doIt: [self createDark. self createLight apply.]"
> 
>     | themeName |
>     themeName := 'Solarized (light)'.
>     ^ (self named: themeName) in: [:theme |
>         theme merge: (self named: 'Solarized (dark)') overwrite: true.
>         theme name: themeName.
> 
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: self lightContentSecondary;
>             set: #keyboardFocusWidth for: #Morph to: 1.
>         theme set: #background for: #MorphicProject to: self lightBackgroundForm.
> 
>         self
>             addLightFonts: theme withFontSize: size;
>             addLightWindowColors: theme;
>             addLightSyntaxHighlighting: theme;
>             addLightScrollables: theme;
>             addLightButtons: theme;
>             addLightDialogs: theme;
>             addLightMenusAndDockingBars: theme;
>             addLightToolColors: theme.
> 
>         theme]! !
> 
> 
> !SqueakTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:10'!
> addFonts: theme withFontSize: size
> 
>     theme
>         set: #standardSystemFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #standardFixedFont to: (TTCFont familyName: #BitstreamVeraSansMonoForSqueak pointSize: size);
> 
>         set: #standardCodeFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #standardListFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #standardButtonFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size emphasized: TextEmphasis bold emphasisCode);
> 
>         set: #windowTitleFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: (size/1.25) emphasized: TextEmphasis bold emphasisCode);
>         set: #balloonHelpFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: (size/2));
>         set: #haloLabelFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: 10.5);
> 
>         set: #wizardStandardFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #wizardButtonFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #wizardHelpFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: size);
>         set: #wizardTitleFont to: (StrikeFont familyName: #BitstreamVeraSansForSqueak pointSize: (size/1.5)).! !
> 
> !SqueakTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:19'!
> addToolColors: theme
>     "Tool-specific colors."
>     
>     "SUnit's TestRunner."
>     theme 
>         set: #failureColor for: #TestRunner to: Color yellow;
>         set: #errorColor for: #TestRunner to: Color red;
>         set: #passColor for: #TestRunner to: Color green;
>         
>         derive: #failureTextColor for: #TestRunner from: #PluggableTextMorph at: #textColor;
>         derive: #errorTextColor for: #TestRunner from: #PluggableTextMorph at: #textColor;
>         derive: #passTextColor for: #TestRunner from: #PluggableTextMorph at: #textColor.
>         
>     "Monticello Tools."
>     theme
>         set: #revertedOperationAttributes for: #MCOperationsBrowser to: {TextEmphasis struckOut};
>         set: #ignoredOperationAttributes for: #MCOperationsBrowser to: {TextColor color: Color gray}.
>         "set: #rejectedOperationAttributes for: #MCOperationsBrowser to: {TextEmphasis struckOut};
>         set: #acceptedOperationAttributes for: #MCOperationsBrowser to: {TextEmphasis underlined};
>         set: #conflictingOperationAttributes for: #MCOperationsBrowser to: {TextEmphasis bold}."
>         
>     "Halos."
>     theme
>         derive: #borderColor for: #HaloMorph from: #MenuItemMorph at: #selectionColor do: [:c | c alpha: 0.8];
>         derive: #borderColor for: #SelectionMorph from: #MenuItemMorph at: #selectionColor do: [:c | c twiceDarker alpha: 0.75];
>         derive: #color for: #SelectionMorph from: #MenuItemMorph at: #selectionColor do: [:c | c alpha: 0.08].
>     
>     "Code-browsing tools."
>     theme
>         set: #noClassCommentColor for: #Browser to: Color red;
>         set: #deprecatedMessageAttributes for: #CodeHolder to: { TextEmphasis struckOut. TextColor gray }.
> 
>     "Objects Tool."
>     theme
>         derive: #borderWidth for: #ObjectsTool from: #MenuMorph;
>         derive: #borderColor for: #ObjectsTool from: #MenuMorph;
>         derive: #borderStyle for: #ObjectsTool from: #MenuMorph;
>         derive: #color for: #ObjectsTool from: #MenuMorph;
>         derive: #textColor for: #ObjectsTool from: #MenuItemMorph;
>         derive: #selectionTextColor for: #ObjectsTool from: #MenuItemMorph.
>     
>     "CodeHolder"
>     theme
>         set: #inheritanceButtonColorDefault for: #CodeHolder to: (Color gray: 0.9);
>         set: #inheritanceButtonColorHasOverride for: #CodeHolder to: Color tan;
>         set: #inheritanceButtonColorIsOverride for: #CodeHolder to: Color red;
>         set: #inheritanceButtonColorSendsSuper for: #CodeHolder to: Color green;
>         set: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder to: Color green darker;
>         set: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder to: (Color r: 0.3 g:0.3 b: 1.0);
>         set: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder to: Color orange.
> ! !
> 
> !SqueakTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:24'!
> createDullerWithFontSize: size
>     "self createDuller apply"
>     
>     | name |
>     name := 'Squeak (duller)'.
>     ^ (self named:name) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: name.
>         self
>             addFonts: theme withFontSize: size; 
>             addDullerWindowColors: theme;
>             addDullerScrollables: theme;
>             addDullerDialogs: theme;
>             addDullerMenusAndDockingBars: theme;
>             addDullerButtons: theme;
>             addDullerToolColors: theme.
>             
>         theme set: #color for: #TextAction to: Color ocean.
>         
>         theme]! !
> 
> !SqueakTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:57'!
> createWithFontSize: size
>     "This is the default theme for Squeak.
>     
>     self create apply. "
>     
>     ^ (self named: 'Squeak') in: [:theme |        
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: (TranslucentColor r: 0.3 g: 0.5 b: 0.5 alpha: 0.5);
>             set: #keyboardFocusWidth for: #Morph to: 2;
>             set: #softShadowColor for: #Morph to: (Color black alpha: 0.01);
>             set: #softShadowOffset for: #Morph to: (10 at 8 corner: 10 at 12);
>             set: #hardShadowColor for: #Morph to: (Color black alpha: 0.5);
>             set: #hardShadowOffset for: #Morph to: 1 at 1.
>             
>         theme set: #background for: #MorphicProject to: self linenblue.
>             
>         self
>             addFonts: theme withFontSize: size;
>             addWindowColors: theme;
>             addSyntaxHighlighting: theme;
>             addMenusAndDockingBars: theme;
>             addDialogs: theme;
>             addButtons: theme;
>             addScrollables: theme;
>             addToolColors: theme;
>             addMVC: theme.
>         
>         theme]! !
> 
> 
> !TrimTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:09'!
> addFonts: theme withFontSize: size
> 
>     "Set-up fonts."
>     theme
>         set: #balloonHelpFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: (size/2));
>         set: #standardButtonFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardCodeFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardFlapFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode);
>         set: #haloLabelFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: 10.5);
>         set: #standardListFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardMenuFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #standardSystemFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size);
>         set: #windowTitleFont to: (StrikeFont familyName: 'BitstreamVeraSansForSqueak' pointSize: size).! !
> 
> !TrimTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 13:22'!
> addToolColors: theme
>     "Tool-specific colors."
>     
>     "SUnit's TestRunner."
>     theme 
>         set: #failureColor for: #TestRunner to: self yellow;
>         set: #errorColor for: #TestRunner to: self red;
>         set: #passColor for: #TestRunner to: self green.
>         
>     "Monticello Tools."
>     theme
>         set: #revertedOperationAttributes for: #MCOperationsBrowser to: {TextEmphasis struckOut};
>         set: #ignoredOperationAttributes for: #MCOperationsBrowser to: {TextColor color: self gray128}.
>         
>     "Browser."
>     theme
>         set: #noClassCommentColor for: #Browser to: self red;
>         set: #deprecatedMessageAttributes for: #CodeHolder to: { TextEmphasis struckOut. TextColor color: self gray128 }.
>         
>     theme
>         set: #inheritanceButtonColorDefault for: #CodeHolder to: self gray27;
>         set: #inheritanceButtonColorHasOverride for: #CodeHolder to:  (Color r: 0.533 g: 0.533 b: 0.333);
>         set: #inheritanceButtonColorIsOverride for: #CodeHolder to: self red;
>         set: #inheritanceButtonColorSendsSuper for: #CodeHolder to: self green;
>         set: #inheritanceButtonColorIsOverrideAndSendsSuper for: #CodeHolder to: self green;
>         set: #inheritanceButtonColorHasOverrideAndSendsSuper for: #CodeHolder to: self blue;
>         set: #inheritanceButtonColorHasOverrideIsOverride for: #CodeHolder to: self orange.
> ! !
> 
> !TrimTheme class methodsFor: 'instance creation' stamp: 'PAP 12/9/2022 11:56'!
> createWithFontSize: size
>     "doIt: [self create apply.]"
> 
>     | themeName |
>     themeName := 'Trim (dark)'.
>     ^ (self named: themeName) in: [:theme |
>         theme merge: (self named: 'Squeak') overwrite: true.
>         theme name: themeName.
> 
>         "General morph stuff."
>         theme
>             set: #keyboardFocusColor for: #Morph to: self blue;
>             set: #keyboardFocusWidth for: #Morph to: 1.
> 
>         theme set: #background for: #MorphicProject to: self backgroundForm.
> 
>         self addFonts: theme withFontSize: size.
>         self addWindowColors: theme.
>         self addSyntaxHighlighting: theme.
>         self addMenusAndDockingBars: theme.
>         self addDialogs: theme.
>         self addButtons: theme.
>         self addScrollables: theme.
>         self addToolColors: theme.
> 
>         theme]! !
> 
> SqueakTheme class removeSelector: #createwithFontSize:!
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221218/99936244/attachment-0001.html>


More information about the Squeak-dev mailing list