[squeak-dev] The Trunk: System-mt.1385.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Jan 20 17:48:04 UTC 2023
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1385.mcz
==================== Summary ====================
Name: System-mt.1385
Author: mt
Time: 20 January 2023, 6:48:03.083382 pm
UUID: 2f1ecd2b-9f63-cd4b-93da-cea7c860b02c
Ancestors: System-mt.1384
Restores "remember window extent" feature as it was present for debugger windows until the recent debugger clean-up.
Expand this feature to all kinds of tool windows. Scope it via model class and window title. See implementors of #initialExtentKey.
The new preference #rememberWindowExtent is disabled by default.
The cache of saved window extent is cleared during #cleanUp: and preference toggling.
Big thanks to Christoph (ct) for the idea and first implementation draft.
=============== Diff against System-mt.1384 ===============
Item was changed:
+ ----- Method: Model>>defaultWindowColor (in category '*System-Preferences') -----
- ----- Method: Model>>defaultWindowColor (in category '*System-preferences') -----
defaultWindowColor
^ self uniformWindowColor!
Item was added:
+ ----- Method: Model>>initialExtentKey (in category '*System-Support-user interface') -----
+ initialExtentKey
+
+ ^ { self class name . self windowTitle hash }!
Item was changed:
+ ----- Method: Model>>uniformWindowColor (in category '*System-Preferences') -----
- ----- Method: Model>>uniformWindowColor (in category '*System-preferences') -----
uniformWindowColor
^ self userInterfaceTheme uniformWindowColor ifNil: [Color veryVeryLightGray]!
Item was changed:
+ ----- Method: Model>>windowColorToUse (in category '*System-Preferences') -----
- ----- Method: Model>>windowColorToUse (in category '*System-preferences') -----
windowColorToUse
^ Color colorFrom: (self class useColorfulWindows
ifTrue: [self userInterfaceTheme customWindowColor ifNil: [self defaultWindowColor]]
ifFalse: [self uniformWindowColor])!
Item was changed:
Object subclass: #RealEstateAgent
instanceVariableNames: ''
+ classVariableNames: 'PlaceWindowsAtPointer RememberWindowExtent ReverseStaggerOffset SavedExtents ScaleFactor StaggerOffset StaggerOrigin StandardSize StandardWindowOrigins WindowScaleFactor'
- classVariableNames: 'PlaceWindowsAtPointer ReverseStaggerOffset ScaleFactor StaggerOffset StaggerOrigin StandardSize StandardWindowOrigins WindowScaleFactor'
poolDictionaries: ''
category: 'System-Support'!
!RealEstateAgent commentStamp: '<historical>' prior: 0!
Responsible for real-estate management on the screen, which is to say, controlling where new windows appear, with what sizes, etc. 5/20/96 sw!
Item was added:
+ ----- Method: RealEstateAgent class>>cleanUp: (in category 'class initialization') -----
+ cleanUp: aggressive
+
+ aggressive ifTrue: [SavedExtents := nil].!
Item was added:
+ ----- Method: RealEstateAgent class>>rememberExtentFor: (in category 'framing') -----
+ rememberExtentFor: aModel
+
+ self rememberWindowExtent ifFalse: [^ self].
+ (aModel respondsTo: #initialExtentKey) ifFalse: [^ self].
+
+ aModel containingWindow ifNotNil: [:window |
+ self
+ savedExtentAt: aModel initialExtentKey
+ put: (window extent / self scaleFactor) rounded].!
Item was added:
+ ----- Method: RealEstateAgent class>>rememberWindowExtent (in category 'preferences') -----
+ rememberWindowExtent
+ <preference: 'Remember window extent'
+ category: #windows
+ description: 'When enabled, the extent of every window is saved on close and reused for similar windows.'
+ type: #Boolean>
+ ^ RememberWindowExtent ifNil: [false]!
Item was added:
+ ----- Method: RealEstateAgent class>>rememberWindowExtent: (in category 'preferences') -----
+ rememberWindowExtent: aBooleanOrNil
+
+ (RememberWindowExtent := aBooleanOrNil) == false
+ ifTrue: [SavedExtents := nil].!
Item was added:
+ ----- Method: RealEstateAgent class>>savedExtentAt: (in category 'framing') -----
+ savedExtentAt: aKey
+
+ ^ SavedExtents ifNotNil: [SavedExtents at: aKey ifAbsent: nil]!
Item was added:
+ ----- Method: RealEstateAgent class>>savedExtentAt:put: (in category 'framing') -----
+ savedExtentAt: aKey put: aPoint
+
+ SavedExtents ifNil: [SavedExtents := Dictionary new].
+ ^ SavedExtents at: aKey put: aPoint!
Item was added:
+ ----- Method: RealEstateAgent class>>savedExtentFor: (in category 'framing') -----
+ savedExtentFor: aModel
+
+ self rememberWindowExtent ifFalse: [^ nil].
+ (aModel respondsTo: #initialExtentKey) ifFalse: [^ nil].
+ ^ self savedExtentAt: aModel initialExtentKey!
More information about the Squeak-dev
mailing list
|