[squeak-dev] The Trunk: PreferenceBrowser-mt.73.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Aug 13 11:07:14 UTC 2016


Marcel Taeumel uploaded a new version of PreferenceBrowser to project The Trunk:
http://source.squeak.org/trunk/PreferenceBrowser-mt.73.mcz

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

Name: PreferenceBrowser-mt.73
Author: mt
Time: 13 August 2016, 1:07:09.565735 pm
UUID: 95e77d64-3b9f-4745-9257-da98ac0eb40f
Ancestors: PreferenceBrowser-mt.72

Add balloon help to preference wizard. Reuse existing preference help texts as much as possible. Add custom ones where the negation of the preference made the existing help text look awkward.

=============== Diff against PreferenceBrowser-mt.72 ===============

Item was changed:
  ----- Method: PreferenceWizardMorph>>createCheckbox:for: (in category 'initialization') -----
  createCheckbox: label for: selector
  
+ 	^ self
+ 		createCheckbox: label
+ 		for: selector
+ 		help: #()!
- 	| box lbl btn |
- 	
- 	btn := self createButton
- 		label: ' ';
- 		onColor: Color white offColor: (self defaultColor adjustBrightness: 0.3);
- 		vResizing: #rigid;
- 		hResizing: #rigid;
- 		action: ('toggle', selector) asSymbol;
- 		getStateSelector: ('state', selector) asSymbol;
- 		extent: 25 at 25.
- 
- 	lbl := self createLabel: label color: self defaultTextColor.
- 	
- 	box := Morph new
- 		color: Color transparent;
- 		changeTableLayout;
- 		listDirection: #leftToRight;
- 		cellPositioning: #topLeft;
- 		hResizing: #spaceFill;
- 		vResizing: #shrinkWrap;
- 		cellInset: 10;
- 		yourself.
- 		
- 	box addAllMorphs: {btn. lbl}.
- 	^ box!

Item was added:
+ ----- Method: PreferenceWizardMorph>>createCheckbox:for:help: (in category 'initialization') -----
+ createCheckbox: label for: selector help: terms
+ 
+ 	| box lbl btn |
+ 	
+ 	btn := self createButton
+ 		label: ' ';
+ 		onColor: Color white offColor: (self defaultColor adjustBrightness: 0.3);
+ 		vResizing: #rigid;
+ 		hResizing: #rigid;
+ 		action: ('toggle', selector) asSymbol;
+ 		getStateSelector: ('state', selector) asSymbol;
+ 		extent: 25 at 25.
+ 
+ 	lbl := self createLabel: label color: self defaultTextColor.
+ 	
+ 	box := Morph new
+ 		color: Color transparent;
+ 		changeTableLayout;
+ 		listDirection: #leftToRight;
+ 		cellPositioning: #topLeft;
+ 		hResizing: #spaceFill;
+ 		vResizing: #shrinkWrap;
+ 		cellInset: 10;
+ 		yourself.
+ 		
+ 	box addAllMorphs: {btn. lbl}.
+ 	self
+ 		setBalloonText: (terms isString ifTrue: [terms] ifFalse: [self findHelpStringFor: terms])
+ 		for: box.
+ 	^ box!

Item was added:
+ ----- Method: PreferenceWizardMorph>>findHelpStringFor: (in category 'initialization') -----
+ findHelpStringFor: someTerms
+ 
+ 	someTerms ifEmpty: [^ ''].
+ 	
+ 	^ Preferences allPreferences
+ 		detect:[:pref | someTerms allSatisfy: [:term| pref name includesSubstring: term caseSensitive: false]]
+ 		ifFound: [:pref | (pref helpString lines joinSeparatedBy: ' ') withBlanksTrimmed]
+ 		ifNone: ['']!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializeControlMorph (in category 'initialization') -----
  initializeControlMorph
  
  	controlMorph := Morph new
  		color: Color transparent;
  		changeTableLayout;
  		listDirection: #topToBottom;
  		hResizing: #spaceFill;
  		vResizing: #spaceFill;
  		layoutInset: (0 at 0 corner: 10 at 0);
  		layoutFrame: (LayoutFrame fractions: (0.0 @ 0 corner: 0.3 @ 1.0) offsets: (0@ titleMorph height corner: 0 @ buttonRowMorph height negated));
  		yourself.
  	
+ 	controlMorph addMorph: (self createLabel: 'Please take a few minutes and configure the look-and-feel of the environment. You can always adjust these settings later. You can see the effects of these settings in the live and editable windows to the right.' translated).!
- 	controlMorph addMorph: (self createLabel: 'Please take a few minutes and configure the look-and-feel of the environment. You can adjust these settings later if you like.\\You can try out the current settings in the right area.' withCRs).!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage02Visuals (in category 'initialization') -----
  initializePage02Visuals
  
  	| currentPage |
  	currentPage := pages add: self createPage.
  	currentPage addMorphBack: (self createLabel: 'Choose visual settings' color: Color white).
  	
  	
  	currentPage addAllMorphsBack: {
+ 		self createCheckbox: 'Colorful windows' translated for: #UseColorfulWindows help: #(color window).
+ 		self createCheckbox: 'Flat widget look' translated for: #Gradients help: 'Whether to use gradients or not.' translated.
- 		self createCheckbox: 'Colorful windows' translated for: #UseColorfulWindows.
- 		self createCheckbox: 'Flat widget look' translated for: #Gradients.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Rounded windows' translated for: #RoundedWindowLook help: #(round window).
+ 		self createCheckbox: 'Rounded buttons' translated for: #RoundedButtonLook help: #(round button).
- 		self createCheckbox: 'Rounded windows' translated for: #RoundedWindowLook.
- 		self createCheckbox: 'Rounded buttons' translated for: #RoundedButtonLook.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Soft shadows' translated for: #SoftShadows help: #(soft shadow).
+ 		self createCheckbox: 'Hard shadows' translated for: #HardShadows help: 'Whether to use a hard shadow for windows, menus, and dialogs.' translated.
- 		self createCheckbox: 'Soft shadows' translated for: #SoftShadows.
- 		self createCheckbox: 'Hard shadows' translated for: #HardShadows.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Fast drag and resize' translated for: #FastDrag help: #(fast drag).
+ 		self createCheckbox: 'Blinking text cursor' translated for: #BlinkingCursor help: #(blinking cursor).
+ 		self createCheckbox: 'Show keyboard focus' translated for: #ShowKeyboardFocus help: #(keyboard indicate).		
+ 		self createCheckbox: 'Simple edit indication' translated for: #SimpleFrameAdornments help: #(adornment simple).		
- 		self createCheckbox: 'Fast drag and resize' translated for: #FastDrag.
- 		self createCheckbox: 'Blinking text cursor' translated for: #BlinkingCursor.
- 		self createCheckbox: 'Show keyboard focus' translated for: #ShowKeyboardFocus.		
- 		self createCheckbox: 'Simple edit indication' translated for: #SimpleFrameAdornments.		
  		}.
  		
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage03Interaction (in category 'initialization') -----
  initializePage03Interaction
  
  	| currentPage |
  	currentPage := pages add: self createPage.
  	currentPage addMorphBack: (self createLabel: 'Choose interaction settings' color: Color white).
  	
  	
  	currentPage addAllMorphsBack: {
+ 		self createCheckbox: 'Swap mouse buttons' translated for: #SwapMouseButtons help: #(swap mouse).
+ 		self createCheckbox: 'Focus follows mouse' translated for: #FocusFollowsMouse help: #(mouse over keyboard).
+ 		self createCheckbox: 'Mouse wheel to focus' translated for: #SendMouseWheelToKeyboardFocus help: #(wheel keyboard).
- 		self createCheckbox: 'Swap mouse buttons' translated for: #SwapMouseButtons.
- 		self createCheckbox: 'Focus follows mouse' translated for: #FocusFollowsMouse.
- 		self createCheckbox: 'Mouse wheel to focus' translated for: #SendMouseWheelToKeyboardFocus.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Auto enclose brackets' translated for: #AutoEnclose help: #(auto enclose).
+ 		self createCheckbox: 'Auto indent lines' translated for: #AutoIndent help: #(auto indent).
+ 		self createCheckbox: 'Enclose text selections' translated for: #EncloseSelection help: #(enclose selection).
- 		self createCheckbox: 'Auto enclose brackets' translated for: #AutoEnclose.
- 		self createCheckbox: 'Auto indent lines' translated for: #AutoIndent.
- 		self createCheckbox: 'Enclose text selections' translated for: #EncloseSelection.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Arrows in scrollbar' translated for: #ScrollBarsWithoutArrowButtons help: 'Whether to show arrows for scrolling or not.' translated.
+ 		self createCheckbox: 'Menu in scrollbar' translated for: #ScrollBarsWithoutMenuButton help: 'Whether to show a menu button or not.' translated.
+ 		self createCheckbox: 'Scrollbars on the right' translated for: #ScrollBarsOnRight help: #(right scroll).
+ 		self createCheckbox: 'Retractable scrollbars' translated for: #UseRetractableScrollBars help: #(retractable).
+ 		self createCheckbox: 'Narrow scrollbars' translated for: #ScrollBarsNarrow help: #(narrow scroll).
- 		self createCheckbox: 'Arrows in scrollbar' translated for: #ScrollBarsWithoutArrowButtons.
- 		self createCheckbox: 'Menu in scrollbar' translated for: #ScrollBarsWithoutMenuButton.
- 		self createCheckbox: 'Scrollbars on the right' translated for: #ScrollBarsOnRight.
- 		self createCheckbox: 'Retractable scrollbars' translated for: #UseRetractableScrollBars.
- 		self createCheckbox: 'Narrow scrollbars' translated for: #ScrollBarsNarrow.
  		
  		}.
  		
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage04InteractionMore (in category 'initialization') -----
  initializePage04InteractionMore
  
  	| currentPage |
  	currentPage := pages add: self createPage.
  	currentPage addMorphBack: (self createLabel: 'Choose more interaction settings' color: Color white).
  	
  	
  	currentPage addAllMorphsBack: {
+ 		self createCheckbox: 'Windows raise on click' translated for: #WindowsRaiseOnClick help: #(window raise).
+ 		self createCheckbox: 'Windows always active' for: #WindowsAlwaysActive help: #(window content active).
+ 		self createCheckbox: 'Window buttons always active' translated for: #WindowButtonsAlwaysActive help: #(window control active).
- 		self createCheckbox: 'Windows raise on click' translated for: #WindowsRaiseOnClick.
- 		self createCheckbox: 'Windows always active' for: #WindowsAlwaysActive.
- 		self createCheckbox: 'Window buttons always active' translated for: #WindowButtonsAlwaysActive.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Smart horizontal splitters' translated for: #SmartHorizontalSplitters help: #(horizontal splitter).
+ 		self createCheckbox: 'Smart vertical splitters' translated for: #SmartVerticalSplitters help: #(vertical splitter).
- 		self createCheckbox: 'Smart horizontal splitters' translated for: #SmartHorizontalSplitters.
- 		self createCheckbox: 'Smart vertical splitters' translated for: #SmartVerticalSplitters.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Filterable lists and trees' translated for: #FilterableLists help: #(filterable).
+ 		self createCheckbox: 'Filters clear if unfocused' translated for: #ClearFilterAutomatically help: #(filter clear).
- 		self createCheckbox: 'Filterable lists and trees' translated for: #FilterableLists.
- 		self createCheckbox: 'Filters clear if unfocused' translated for: #ClearFilterAutomatically.
  		self createVerticalSpace.
+ 		self createCheckbox: 'Attach tools to mouse' translated for: #AttachToolsToMouse help: #(tools attach).		
- 		self createCheckbox: 'Attach tools to mouse' translated for: #AttachToolsToMouse.		
  		}.
  		
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage05Tools (in category 'initialization') -----
  initializePage05Tools
  
  	| currentPage |
  	currentPage := pages add: self createPage.
  	currentPage addMorphBack: (self createLabel: 'Choose other settings' color: Color white).
  	
  	
  	currentPage addAllMorphsBack: {
+ 		self createCheckbox: 'Trace messages browser' translated for: #TraceMessages help: #(trace message).
+ 		self createCheckbox: 'Reuse tool windows' translated for: #ReuseWindows help: #(window reuse).
+ 		self createCheckbox: 'Tool and menu icons' translated for: #ToolAndMenuIcons help: 'Whether to show icons in tools and menus.' translated.
- 		self createCheckbox: 'Trace messages browser' translated for: #TraceMessages.
- 		self createCheckbox: 'Reuse tool windows' translated for: #ReuseWindows.
- 		self createCheckbox: 'Tool and menu icons' translated for: #ToolAndMenuIcons.
  		}.
  		
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was added:
+ ----- Method: PreferenceWizardMorph>>setBalloonText:for: (in category 'initialization') -----
+ setBalloonText: string for: morph
+ 
+ 	morph
+ 		balloonColor: ((self defaultColor alpha: self color alpha) adjustBrightness: 0.2);
+ 		balloonText: (string asText
+ 			addAttribute: (TextFontReference toFont: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9));
+ 			addAttribute: (TextColor color: Color banana)).!



More information about the Squeak-dev mailing list