The Trunk: Morphic-ct.1556.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-ct.1556.mcz

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

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

Name: Morphic-ct.1556
Author: ct
Time: 1 October 2019, 4:14:07.036339 pm
UUID: b353603d-f85b-6f45-b660-2f137d99eb5d
Ancestors: Morphic-ul.1552

Complements System-ct.1106 and reworks ProjectViewMorph preview sizes.

Fixes a bug since a few commits, where ProjectViewMorphs without windows have the full size of their model's world. Extract #initialExtent, use a modern value, and set it respecting scaleFactor. Simplify #on: paths. Simplify #openOn: and use RealEstateAgent for convenience.

=============== Diff against Morphic-ul.1552 ===============

Item was changed:
  ----- Method: MorphicProject>>previewImageForm (in category 'display') -----
  previewImageForm
 
+ ^ self world imageForm scaledToSize: self viewSize!
- ^ self world imageForm!

Item was changed:
  ----- Method: ProjectViewMorph class>>newProjectViewInAWindowFor: (in category 'project window creation') -----
  newProjectViewInAWindowFor: aProject
  "Return an instance of me on a new Morphic project (in a SystemWindow)."
 
  | window proj |
  proj := self on: aProject.
  window := (SystemWindow labelled: aProject name) model: aProject.
+ window extent: proj extent.
  window
  addMorph: proj
  frame: (0@0 corner: 1.0@1.0).
  proj borderWidth: 0.
  ^ window
  !

Item was changed:
  ----- Method: ProjectViewMorph class>>openOn: (in category 'instance creation') -----
  openOn: aProject
  "Open a ProjectViewMorph for the project in question"
+ ProjectViewOpenNotification signal ifFalse: [^ self].
+
+ (Preferences projectViewsInWindows
+ ifTrue: [ (self newProjectViewInAWindowFor: aProject) ]
+ ifFalse: [ (self on: aProject) ])
+ openAsTool.!
- ProjectViewOpenNotification signal ifTrue: [
- Preferences projectViewsInWindows ifTrue: [
- (self newProjectViewInAWindowFor: aProject) openInWorld
- ] ifFalse: [
- (self on: aProject) openInWorld "but where??"
- ].
- ].
- !

Item was added:
+ ----- Method: ProjectViewMorph>>initialExtent (in category 'geometry') -----
+ initialExtent
+
+ ^ 300 @ 200!

Item was changed:
  ----- Method: ProjectViewMorph>>initialize (in category 'initialization') -----
  initialize
  "Initialize the receiver."
 
  super initialize.
+ self extent: self initialExtent * RealEstateAgent scaleFactor.
  "currentBorderColor := Color gray."
  self addProjectNameMorphFiller.
  self enableDragNDrop: true.
  self isOpaque: true.
  !

Item was changed:
  ----- Method: ProjectViewMorph>>on: (in category 'events') -----
  on: aProject
 
  project := aProject.
  self addProjectNameMorphFiller.
  lastProjectThumbnail := nil.
+ project viewSize ifNil: [project viewSize: self extent].
  project thumbnail: project previewImageForm.
+ self extent: project thumbnail extent.!
- project thumbnail
- ifNil: [self extent: 100@80] "more like screen dimensions?"
- ifNotNil: [self extent: project thumbnail extent].!