The Inbox: Morphic-ct.1556.mcz

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

The Inbox: Morphic-ct.1556.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/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].!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1556.mcz

Christoph Thiede
I forgot to mention that this commit depends on System-mt<a href="tel:&#43;491102">.1102.

Mit freundlichen Grüßen

Christoph Thiede

Hasso-Plattner-Institut für Softwaresystemtechnik GmbH, Potsdam
Amtsgericht Potsdam, HRB 12184
Geschäftsführung: Prof. Dr. Christoph Meinel




On Tue, Oct 1, 2019 at 4:14 PM +0200, "[hidden email]" <[hidden email]> wrote:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/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].!




Carpe Squeak!