Christoph Thiede uploaded a new version of PreferenceBrowser to project The Trunk:
http://source.squeak.org/trunk/PreferenceBrowser-ct.142.mcz
==================== Summary ====================
Name: PreferenceBrowser-ct.142
Author: ct
Time: 6 April 2022, 9:17:51.223385 pm
UUID: d97280ad-347c-b844-ad1c-f3d2004d4cc0
Ancestors: PreferenceBrowser-ct.141
Adds Preference >> #open to display a preference in a new preference browser.
=============== Diff against PreferenceBrowser-ct.141 ===============
Item was added:
+ ----- Method: Preference>>open (in category '*PreferenceBrowser') -----
+ open
+
+ ^ PreferenceBrowser open
+ selectedCategory: self categoryList first;
+ selectedPreference: self;
+ yourself!
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1961.mcz
==================== Summary ====================
Name: Morphic-ct.1961
Author: ct
Time: 6 April 2022, 8:16:10.262385 pm
UUID: a733d275-2b98-5d4c-837c-9eb9c90912ab
Ancestors: Morphic-ct.1960
Tweaks default keyboard focus in dialog windows. Makes sure that for "fill in the blank" dialogs, users can type into the text field even it is not hovered initially. For system windows, avoid focusing a locked morph and beautifies the morph search by using a chained sort function.
=============== Diff against Morphic-ct.1960 ===============
Item was added:
+ ----- Method: DialogWindow>>defaultFocusMorph (in category 'accessing') -----
+ defaultFocusMorph
+
+ (preferredPosition isMorph and: [preferredPosition wantsKeyboardFocus]) ifTrue: [^ preferredPosition].
+
+ ^ nil!
Item was changed:
----- Method: DialogWindow>>getUserResponse (in category 'running') -----
getUserResponse
| hand world |
self message ifEmpty: [messageMorph delete]. "Do not waste space."
self paneMorph submorphs
ifEmpty: ["Do not waste space and avoid strange button-row wraps."
self paneMorph delete.
self buttonRowMorph wrapDirection: #none].
hand := self currentHand.
world := self currentWorld.
self fullBounds.
self morphicLayerNumber: self class dialogLayer.
self moveToPreferredPosition.
self openInWorld: world.
hand showTemporaryCursor: nil. "Since we are out of context, reset the cursor."
hand keyboardFocus in: [:priorKeyboardFocus |
hand mouseFocus in: [:priorMouseFocus |
self exclusive ifTrue: [hand newMouseFocus: self].
+ hand newKeyboardFocus: self defaultFocusMorph.
- hand newKeyboardFocus: self.
[[self isInWorld] whileTrue: [world doOneSubCycle]]
ifCurtailed: [self cancelDialog].
hand newKeyboardFocus: priorKeyboardFocus.
self flag: #discuss. "Since 2016 we are having this *ping pong* between (a) restoring the prior mouse focus and (b) just clearing it globally. The former solution makes more sense while the latter fixes issues with some modal dialogs. We have to investigate this further."
hand releaseMouseFocus.
"hand newMouseFocus: priorMouseFocus."]].
^ result!
Item was added:
+ ----- Method: FillInTheBlankMorph>>defaultFocusMorph (in category 'accessing') -----
+ defaultFocusMorph
+
+ ^ self textPane!
Item was changed:
----- Method: SystemWindow>>defaultFocusMorph (in category 'focus') -----
defaultFocusMorph
| predicate |
predicate := (self hasProperty: #defaultFocusMorph)
+ ifFalse: [ [:morph | morph isLocked not and: [morph wantsKeyboardFocus]] ]
- ifFalse: [ [:morph | morph wantsKeyboardFocus] ]
ifTrue: [ | anObject |
anObject := (self valueOfProperty: #defaultFocusMorph) value.
anObject isMorph ifTrue: [^ anObject].
[:morph | morph knownName = anObject] ].
+
-
self
allMorphsBreadthFirstDo: [:morph | (predicate value: morph) ifTrue: [^ morph]]
+ sorted: #top ascending, #left ascending.
+
- sorted: [:a :b | a top < b top or: [a top = b top and: [a left <= b left]]].
-
^ nil!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.507.mcz
==================== Summary ====================
Name: Graphics-mt.507
Author: mt
Time: 6 April 2022, 11:57:44.501029 am
UUID: 98abf5e0-883f-9f42-9e3d-6cb2191866ff
Ancestors: Graphics-mt.506
Activate #primitiveScreenScaleFactor bc. most recent OSVM reports NaN for unknown factor, not 1.0. Still report 1.0 for unknown cases to make #platformScaleFactor robust, see #platformScaleFactorKnown.
=============== Diff against Graphics-mt.506 ===============
Item was changed:
----- Method: DisplayScreen class>>actualScreenScaleFactor (in category 'snapshots') -----
actualScreenScaleFactor
+ <primitive: #primitiveScreenScaleFactor>
- "<primitive: #primitiveScreenScaleFactor>"
- "Once the primitive is ready, you can simply uncomment it. The system is prepared for changes from 'nil' to actual factors and back."
+ ^ Float nan "Unknown scale factor"!
- ^ nil "unknown -- do not default to 1.0 here"!
Item was changed:
----- Method: DisplayScreen>>platformScaleFactor (in category 'scale factor') -----
platformScaleFactor
+ "Answers the platform's (and thus monitor's) current scale factor as last reported via VM primitive. See #checkForNewScreenScaleFactor. For robustness, always report a sensible value. However, you should check via #platformScaleFactorKnown whether this value is reliable."
- "Answers the platform's (and thus monitor's) current scale factor as last reported via VM primitive. See #checkForNewScreenScaleFactor."
^ PlatformScaleFactor ifNil: [1.0 "Primitive not ready."]!
Item was changed:
----- Method: DisplayScreen>>platformScaleFactor: (in category 'scale factor') -----
platformScaleFactor: aFloatOrNil
"Report a new scale factor from the platform to the image. This can happen if you move Squeak's window between monitors with different pixels-per-inch. On some platforms, you can also set a scale factor independent of monitor PPI. Note that the user might have scaled the image regardless of the previous platform scale factor."
| old new |
+ (aFloatOrNil isNil or: [aFloatOrNil isNaN]) ifTrue: [
- aFloatOrNil ifNil: [
"Ignore. Primitive not ready (anymore)."
PlatformScaleFactor := nil.
^ self].
PlatformScaleFactor ifNil: [
"First time. Ignore. Assume that the user scaled manually until now."
+ "self assert: [aFloatOrNil notNil]."
+ "self assert: [aFloatOrNil isNaN not]."
PlatformScaleFactor := aFloatOrNil.
^ self].
(old := self platformScaleFactor) = (new := aFloatOrNil) ifTrue: [^ self].
PlatformScaleFactor := new.
self uiScaleFactor: self uiScaleFactor * (new/old).!