The Trunk: Morphic-mt.1621.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.1621.mcz

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

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

Name: Morphic-mt.1621
Author: mt
Time: 14 February 2020, 3:26:18.528667 pm
UUID: 91109cc7-fdb9-df40-97c8-4c1041902725
Ancestors: Morphic-mt.1620

Fixes demo mode / high-dpi scaling bugs in check boxes and radio buttons.

(Note that #scaleIconToDisplay is the best we have at the moment. The overhead in regular (low dpi, no demo mode) images is minimal.)

=============== Diff against Morphic-mt.1620 ===============

Item was changed:
  ----- Method: MenuItemMorph>>contents:withMarkers:inverse: (in category 'accessing') -----
  contents: aString withMarkers: aBool inverse: inverse
  "Set the menu item entry. If aBool is true, parse aString for embedded markers."
 
  | markerIndex marker |
  self contentString: nil. "get rid of old"
  aBool ifFalse: [^super contents: aString].
  self removeAllMorphs. "get rid of old markers if updating"
  self hasIcon ifTrue: [ self icon: nil ].
  (aString notEmpty and: [aString first = $<])
  ifFalse: [^super contents: aString].
  markerIndex := aString indexOf: $>.
  markerIndex = 0 ifTrue: [^super contents: aString].
  marker := (aString copyFrom: 1 to: markerIndex) asLowercase.
  (#('<on>' '<off>' '<yes>' '<no>') includes: marker)
  ifFalse: [^super contents: aString].
  self contentString: aString. "remember actual string"
  marker := (marker = '<on>' or: [marker = '<yes>']) ~= inverse
  ifTrue: [self onImage]
  ifFalse: [self offImage].
  super contents:  (aString copyFrom: markerIndex + 1 to: aString size).
  "And set the marker"
+ marker := ImageMorph new image: marker scaleIconToDisplay.
- marker := ImageMorph new image: marker.
  marker position: self left @ (self top + 2).
  self addMorphFront: marker!

Item was changed:
  ----- Method: ThreePhaseButtonMorph class>>checkBox (in category 'instance creation') -----
  checkBox
  "Answer a button pre-initialized with checkbox images."
  | f |
  ^self new
+ onImage: (f := (MenuIcons checkBoxOn dyed: Color red) scaleIconToDisplay);
+ pressedImage: (MenuIcons checkBoxPressed dyed: Color black) scaleIconToDisplay;
+ offImage: (MenuIcons checkBoxOff dyed: Color black) scaleIconToDisplay;
- onImage: (f := MenuIcons checkBoxOn dyed: Color red);
- pressedImage: (MenuIcons checkBoxPressed dyed: Color black);
- offImage: (MenuIcons checkBoxOff dyed: Color black);
  extent: f extent + (2@0);
  setDefaultParameters;
  yourself
  !

Item was changed:
  ----- Method: ThreePhaseButtonMorph class>>radioButton (in category 'instance creation') -----
  radioButton
  "Answer a button pre-initialized with radiobutton images."
  | f |
  ^self new
+ onImage: (f := (MenuIcons radioButtonOn dyed: Color black) scaleIconToDisplay);
+ pressedImage: (MenuIcons radioButtonPressed dyed: Color black) scaleIconToDisplay;
+ offImage: (MenuIcons radioButtonOff dyed: Color black) scaleIconToDisplay;
- onImage: (f := MenuIcons radioButtonOn dyed: Color black);
- pressedImage: (MenuIcons radioButtonPressed dyed: Color black);
- offImage: (MenuIcons radioButtonOff dyed: Color black);
  extent: f extent + (2@0);
  setDefaultParameters;
  yourself
  !