The Trunk: Morphic-mt.1231.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.1231.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1231.mcz

==================== Summary ====================

Name: Morphic-mt.1231
Author: mt
Time: 5 August 2016, 8:51:01.425358 am
UUID: 82f5a015-c062-9d4d-b6cd-fec7ca11a239
Ancestors: Morphic-cmm.1230

Fix use of theme properties #disabledTextColor in menus and #frameAdornmentWidth in text fields.

=============== Diff against Morphic-cmm.1230 ===============

Item was changed:
  ----- Method: MenuItemMorph class>>themeProperties (in category 'preferences') -----
  themeProperties
 
  ^ super themeProperties, {
  { #font. 'Fonts'. 'Font for menu items.' }.
  { #textColor. 'Colors'. 'Color for the menu item''s labels.' }.
+ { #disabledTextColor. 'Colors'. 'Color to use for disabled menu item labels.' }.
  { #selectionColor. 'Colors'. 'Color used for items when hovering or selecting them.' }.
  { #selectionTextColor. 'Colors'. 'Color used for label when hovering or selecting them.' }.
  { #subMenuMarker. 'Forms'. 'The form to be used to indicate a submenu.' }.
  }!

Item was changed:
  ----- Method: MenuItemMorph>>isEnabled: (in category 'accessing') -----
+ isEnabled: aBoolean
+
+ | colorToUse |
- isEnabled: aBoolean
  isEnabled = aBoolean ifTrue: [^ self].
  isEnabled := aBoolean.
+
+ colorToUse := isEnabled
+ ifTrue: [self userInterfaceTheme textColor ifNil: [Color black]]
+ ifFalse: [self userInterfaceTheme disabledTextColor ifNil: [Color gray]].
+
+ self color: colorToUse.!
- self color:
- (self userInterfaceTheme perform:
- (aBoolean
- ifTrue: [#textColor]
- ifFalse: [#disabledTextColor]))!

Item was changed:
  ----- Method: PluggableTextMorph class>>themeProperties (in category 'preferences') -----
  themeProperties
 
  ^ super themeProperties, {
  { #font. 'Fonts'. 'Font for text if not styled.' }.
  { #textColor. 'Colors'. 'Color for text if not styled.' }.
  { #caretColor. 'Colors'. 'The color of the text cursor.' }.
  { #selectionColor. 'Colors'. 'The color of the text selection.' }.
  { #unfocusedSelectionModifier. 'Colors'. 'How to derive the text selection color if not focused.' }.
 
  { #adornmentReadOnly. 'Color'. 'How to indicate read-only contents.' }.
  { #adornmentRefuse. 'Color'. 'How to indicate that the model refuses to accept.' }.
  { #adornmentConflict. 'Color'. 'How to indicate that there are editing conflicts.' }.
  { #adornmentDiff. 'Color'. 'How to indicate that the model wants diff feedback.' }.
  { #adornmentNormalEdit. 'Color'. 'How to indicate that there are unaccepted edits.' }.
  { #adornmentDiffEdit. 'Color'. 'How to indicate that there are unaccepted edits in a diff view.' }.
 
  { #wrapBorderColorModifier. 'Color'. 'How to indicate a specific wrap border.' }.
+ { #frameAdornmentWidth. 'Geometry'. 'Width of simple frame adornments.' }.
  }!

Item was changed:
  ----- Method: PluggableTextMorph>>drawFrameAdornment:on: (in category 'drawing') -----
  drawFrameAdornment: aColor on: aCanvas
  "Indicate edit status for the text editor"
  self class simpleFrameAdornments
  ifTrue:
  [ aCanvas
  frameRectangle: self innerBounds
+ width: (self valueOfProperty: #frameAdornmentWidth ifAbsent: [1])
- width: (self userInterfaceTheme frameAdornmentWidth ifNil: [1])
  color: aColor.
  aCanvas
  frameRectangle: (self innerBounds insetBy: 1)
+ width: (self valueOfProperty: #frameAdornmentWidth ifAbsent: [1])
- width: (self userInterfaceTheme frameAdornmentWidth ifNil: [1])
  color: (aColor alpha: aColor alpha / 3.0) ]
  ifFalse:
  [ | form |
  "Class-side adornment cache is currently using pre-multiplied alpha, so we need to use rule 34 which works for < 32bpp, too."
  form := self class adornmentWithColor: aColor.
  aCanvas
  image: form
  at: self innerBounds topRight - (form width @ 0)
  sourceRect: form boundingBox
  rule: 34 ]!

Item was changed:
  ----- Method: PluggableTextMorph>>setDefaultParameters (in category 'initialization') -----
  setDefaultParameters
 
  super setDefaultParameters.
 
  self
  font: (self userInterfaceTheme font ifNil: [TextStyle defaultFont]);
  setTextColor: (self userInterfaceTheme textColor ifNil: [Color black]).
 
  self wrapBorderColor: ((self userInterfaceTheme wrapBorderColorModifier ifNil: [ [:c | c muchLighter alpha: 0.3] ])
  value: self borderColor).
 
  self
  setProperty: #adornmentReadOnly
  toValue: (self userInterfaceTheme adornmentReadOnly ifNil: [Color black]);
  setProperty: #adornmentRefuse
  toValue: (self userInterfaceTheme adornmentRefuse ifNil: [Color tan]);
  setProperty: #adornmentConflict
  toValue: (self userInterfaceTheme adornmentConflict ifNil: [Color red]);
  setProperty: #adornmentDiff
  toValue: (self userInterfaceTheme adornmentDiff ifNil: [Color green]);
  setProperty: #adornmentNormalEdit
  toValue: (self userInterfaceTheme adornmentNormalEdit ifNil: [Color orange]);
  setProperty: #adornmentDiffEdit
  toValue: (self userInterfaceTheme adornmentDiffEdit ifNil: [Color yellow]).
+
+ self
+ setProperty: #frameAdornmentWidth
+ toValue: (self userInterfaceTheme frameAdornmentWidth ifNil: [1]).
 
  textMorph
  caretColor: (self userInterfaceTheme caretColor ifNil: [Color red]);
  selectionColor: (self userInterfaceTheme selectionColor ifNil: [TranslucentColor r: 0.0 g: 0.0 b: 0.8 alpha: 0.2]);
  unfocusedSelectionColor: ((self userInterfaceTheme unfocusedSelectionModifier ifNil: [ [:c | Color gray: 0.9] ])
  value: textMorph selectionColor).!