The Trunk: Morphic-mt.1398.mcz

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

The Trunk: Morphic-mt.1398.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1398.mcz

==================== Summary ====================

Name: Morphic-mt.1398
Author: mt
Time: 21 February 2018, 8:16:34.893099 am
UUID: be36db5d-0096-234f-ac7c-7ae5ad6644fa
Ancestors: Morphic-mt.1397

Adds more documentation about system-window concepts: activate/passivate, look focused/unfocused, and being the "key" window on screen.

=============== Diff against Morphic-mt.1397 ===============

Item was changed:
  ----- Method: SystemWindow>>activate (in category 'focus') -----
  activate
+ "An active window delegate user input events as usual to its contents such as buttons or lists. There is a preference to ensure that all windows stay active regardless of being focused or not. Also take a look at #passivate, #lookFocused, and #beKeyWindow."
+
- "Bring the receiver to the top.  If I am modal, bring along my modal owning window and my model child as well."
-
  self isActive ifTrue: [self lookFocused. ^ self].
  self topRendererOrSelf owner ifNil: [^ self "avoid spurious activate when drop in trash"].
 
  self isActive: true.
 
  "Special handling for expanded windows."
  self isCollapsed ifFalse: [
  model modelWakeUpIn: self.
  self positionSubmorphs].
 
  self submorphsDo: [:each | each unlock].
 
  self lookFocused.!

Item was changed:
  ----- Method: SystemWindow>>beKeyWindow (in category 'top window') -----
  beKeyWindow
+ "Let me be the most important window on the screen. I am at the top and I can have a shadow to get more attention by the user. I am the window that is responsible for window keyboard shortcuts. Also see #isKeyWindow, #activate, and #lookFocused."
- "Let me be the most important window on the screen. I am at the top and I can have a shadow to get more attention by the user. I am the window that is responsible for window keyboard shortcuts."
 
  | oldKeyWindow |
  self isKeyWindow ifTrue: [^ self].
 
  oldKeyWindow := TopWindow.
  TopWindow := self.
 
  self
  unlockWindowDecorations; "here, because all windows might be active anyway"
  activate; "if not already active, activate now"
  comeToFront. "key windows are on top"
 
  "Change appearance to get noticed."
  self hasDropShadow: Preferences menuAppearance3d.
  (self valueOfProperty: #borderWidthWhenActive)
  ifNotNil: [:bw | self acquireBorderWidth: bw].
 
  oldKeyWindow ifNotNil: [:wnd |
  wnd passivateIfNeeded.
 
  "Change appearance to not look prettier than the new key window."
  wnd hasDropShadow: false.
  (wnd valueOfProperty: #borderWidthWhenInactive)
  ifNotNil: [:bw | wnd acquireBorderWidth: bw]].
 
  "Synchronize focus look with position of current hand because any call could have made this window the new key window."
  self updateFocusLookAtHand.!

Item was changed:
  ----- Method: SystemWindow>>isKeyWindow (in category 'top window') -----
  isKeyWindow
+ "The key window is the window with the user's main attention. It usually has a shadow or other visual hints to separate it from other windows. Usually, the key window is at the top of the screen. On large screens, however, many windows may appear at the top. Also see #beKeyWindow, #activate, and #lookFocused."
- "The key window is the window with the user's main attention. It usually has a shadow or other visual hints to separate it from other windows. Usually, the key window is at the top of the screen. On large screens, however, many windows may appear at the top."
 
  ^ self == self class keyWindow!

Item was changed:
  ----- Method: SystemWindow>>lookFocused (in category 'focus') -----
  lookFocused
+ "Some elements of windows change visually depending on the user input focus. This is property is orthogonal to being active or passive. Active windows can either look focused or unfocused. Passive windows will always look unfocused. Also see #lookUnfocused, #activate, #passivate, and #beKeyWindow."
 
- "Optimize performance."
  self isLookingFocused ifTrue: [^ self].
  self isLookingFocused: true.
 
  label ifNotNil: [ label color: (self userInterfaceTheme focusedLabelColor ifNil: [Color black]) ].
 
  (self isKeyWindow or: [self class windowTitleActiveOnFirstClick])
  ifTrue: [self undimWindowButtons].
 
  self paneColorToUse in: [ : col |
  self
  setStripeColorsFrom: col ;
  adoptPaneColor: col].!

Item was changed:
  ----- Method: SystemWindow>>lookUnfocused (in category 'focus') -----
  lookUnfocused
+ "See #lookFocused, #activate, and #passivate."
 
- "Optimize performance."
  self isLookingFocused ifFalse: [^ self].
  self isLookingFocused: false.
 
  label ifNotNil: [ label color: (self userInterfaceTheme unfocusedLabelColor ifNil: [Color darkGray]) ].
  self dimWindowButtons.
  self paneColorToUseWhenNotActive in: [ : col |
  self
  setStripeColorsFrom: col ;
  adoptPaneColor: col ]!

Item was changed:
  ----- Method: SystemWindow>>passivate (in category 'focus') -----
  passivate
+ "A passive window's contents do not handle user input events until being activated, for example, by a single extra mouse click. There is a preference to configure whether windows can be passive at all. Also see #activate and #lookUnfocused."
- "Reconfigure my focus according to preferences."
 
  self isActive ifFalse: [^ self].
  self isActive: false.
 
  self isCollapsed ifFalse: [model modelSleep].
 
  self submorphsDo: [:each | each lock].
 
  self activeHand keyboardFocus ifNotNil: [:morph |
  morph containingWindow == self
  ifTrue: [self activeHand releaseKeyboardFocus]].
 
  self lookUnfocused.!