[squeak-dev] The Inbox: Morphic-ct.1556.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Oct 1 14:49:47 UTC 2019


I forgot to mention that this commit depends on System-mt.1102<tel:+491102>.

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, "commits at source.squeak.org" <commits at source.squeak.org<mailto:commits at source.squeak.org>> 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 at 0 corner: 1.0 at 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 at 80]            "more like screen dimensions?"
-               ifNotNil: [self extent: project thumbnail extent].!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191001/9fe4ec88/attachment.html>


More information about the Squeak-dev mailing list