Skip to content

Commit

Permalink
Keep maximize window when world extent changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
EiichiroIto committed May 24, 2020
1 parent d45f2da commit 00d44cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/FromScratch/SpScratchApp.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ SpScratchApp class >> initialize [
Settings := nil
]

{ #category : #accessing }
SpScratchApp class >> keepMaximize [
^ self settings at: #keepMaximize ifAbsentPut: [ false ]
]

{ #category : #accessing }
SpScratchApp class >> keepMaximize: aBoolean [
self settings at: #keepMaximize put: aBoolean
]

{ #category : #accessing }
SpScratchApp class >> loadSettings [
| fr dict |
Expand All @@ -84,6 +94,8 @@ SpScratchApp class >> optionsFor: aSymbol [
ifTrue: [ ^ {true . false} ].
aSymbol = #dontClose
ifTrue: [ ^ {true . false} ].
aSymbol = #keepMaximize
ifTrue: [ ^ {true . false} ].
^ #()
]

Expand Down Expand Up @@ -319,6 +331,13 @@ SpScratchApp >> deserializeFrom: aString [
^ obj
]

{ #category : #'change reporting' }
SpScratchApp >> displayExtentChanged [
self class keepMaximize
ifFalse: [ ^ self ].
presenter window window fullscreen
]

{ #category : #'menu actions' }
SpScratchApp >> duplicateBlock: aBlockMorph [
| code obj |
Expand Down
3 changes: 2 additions & 1 deletion src/FromScratch/SpScratchFrame.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ SpScratchFrame >> initializeWindow: aWindow [
aboutText: application aboutAppString;
whenClosedDo: [ application windowClosing ].
application class stickyWindow
ifTrue: [ aWindow window beSticky ]
ifTrue: [ aWindow window beSticky ].
self updateDontCloseSetting
]

{ #category : #private }
Expand Down
9 changes: 9 additions & 0 deletions src/FromScratch/SpWindow.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #SpWindow }

{ #category : #'*FromScratch' }
SpWindow >> displayExtentChanged [
self model ifNil: [ ^ self ].
(self model application respondsTo: #displayExtentChanged)
ifFalse: [ ^ self ].
self model application displayExtentChanged
]

0 comments on commit 00d44cb

Please sign in to comment.