[Pkg] The Trunk: PreferenceBrowser-mt.82.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 4 10:35:41 UTC 2018


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

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

Name: PreferenceBrowser-mt.82
Author: mt
Time: 4 April 2018, 12:35:28.855182 pm
UUID: ad916872-7020-fb43-893e-281a1b14a77d
Ancestors: PreferenceBrowser-tpr.81

Some improvements for the preference wizard:

1) Show checkmarks to indicate what is selected and what not.
2) Add prefs for bigger fonts and cursors.
3) Do not show autogenerated DEMO themes in the list of UI themes to avoid visual glitches.
4) Add pref for #alternativeBrowseIt to last (tool) page.

Well, the code still needs clean-up. At the moment, the only good thing is that the whole code mess is in the single class PreferenceWizardMorph. :-)

=============== Diff against PreferenceBrowser-tpr.81 ===============

Item was changed:
  Morph subclass: #PreferenceWizardMorph
+ 	instanceVariableNames: 'previewWorld titleMorph buttonRowMorph controlMorph startButton previousButton nextButton pages currentPageIndex pagesLabel skipButton isFullScreen lowPerformanceMorph checkmark'
- 	instanceVariableNames: 'previewWorld titleMorph buttonRowMorph controlMorph startButton previousButton nextButton pages currentPageIndex pagesLabel skipButton isFullScreen lowPerformanceMorph'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'PreferenceBrowser'!

Item was added:
+ ----- Method: PreferenceWizardMorph>>changed: (in category 'updating') -----
+ changed: aspect
+ 
+ 	super changed: aspect.
+ 
+ 	(aspect beginsWith: #state)
+ 		ifTrue: [super changed: ('label', (aspect allButFirst: 5)) asSymbol].!

Item was added:
+ ----- Method: PreferenceWizardMorph>>checkmark (in category 'initialization') -----
+ checkmark
+ 
+ 	^ checkmark ifNil: [checkmark := (((ToolIcons iconNamed: #checkmark) dyed: Color white) scaledToSize: 20 at 20) asMorph]!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createCheckbox:for:help: (in category 'initialization') -----
  createCheckbox: label for: selector help: terms
  
  	| box lbl btn |
  	
  	btn := self createButton
+ 		layoutInset: 0;
  		label: ' ';
+ 		onColor: (self defaultColor adjustBrightness: 0.3) offColor: (self defaultColor adjustBrightness: 0.3);
- 		onColor: Color white offColor: (self defaultColor adjustBrightness: 0.3);
  		vResizing: #rigid;
  		hResizing: #rigid;
  		action: ('toggle', selector) asSymbol;
  		getStateSelector: ('state', selector) asSymbol;
+ 		getLabelSelector: ('label', 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>>doesNotUnderstand: (in category 'buttons') -----
+ doesNotUnderstand: msg
+ 
+ 	(msg selector numArgs = 0 and: [msg selector beginsWith: 'label'])
+ 		ifTrue: [^ (self perform: ('state', (msg selector allButFirst: 5)) asSymbol)
+ 			ifTrue: [self checkmark]
+ 			ifFalse: [' '] ].
+ 		
+ 	^ super doesNotUnderstand: msg!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage01Themes (in category 'initialization') -----
  initializePage01Themes
  
  	| currentPage |
  	currentPage := pages add: self createPage.
  	currentPage addMorphBack: (self createLabel: 'Choose a theme:' color: Color white).
+ 	((UserInterfaceTheme allThemes
+ 		reject: [:uit | uit name beginsWith: 'Demo'])
+ 		sorted: [:a :b | a name <= b name])
+ 			do: [:ea |
+ 			currentPage addMorphBack: (self createButton
+ 				label: ea name;
+ 				hResizing: #spaceFill;
+ 				action: #chooseTheme:;
+ 				arguments: {ea})].
- 	(UserInterfaceTheme allThemes sorted: [:a :b | a name <= b name]) do: [:ea |
- 		currentPage addMorphBack: (self createButton
- 			label: ea name;
- 			hResizing: #spaceFill;
- 			action: #chooseTheme:;
- 			arguments: {ea})].
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was added:
+ ----- Method: PreferenceWizardMorph>>initializePage02bVisualsMore (in category 'initialization') -----
+ initializePage02bVisualsMore
+ 
+ 	| currentPage |
+ 	currentPage := pages add: self createPage.
+ 	currentPage addMorphBack: (self createLabel: 'Choose more visual settings' color: Color white).
+ 	
+ 	currentPage addAllMorphsBack: {
+ 		self createCheckbox: 'Bigger Fonts' translated for: #UseBiggerFonts help: 'For high-DPI displays, bigger fonts can improve readability.'.
+ 		self createCheckbox: 'Bigger Cursors' translated for: #UseBiggerCursors help: #(bigger cursor).
+ 		}.
+ 		
+ 	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: 'Browse class hierarchy' translated for: #AlternativeBrowseIt help: 'Whether to spawn a hierarchy browser or full system browser on browse-it commands.' translated.
  		}.
  		
  	currentPage addMorphBack: self createVerticalSpacer.
  !

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePages (in category 'initialization') -----
  initializePages
  
  	pages := OrderedCollection new.
  	currentPageIndex := 0.
  
  	self
  		initializePage01Themes;
  		initializePage02Visuals;
+ 		initializePage02bVisualsMore;
  		initializePage03Interaction;
  		initializePage04InteractionMore;
  		initializePage05Tools.!

Item was added:
+ ----- Method: PreferenceWizardMorph>>stateAlternativeBrowseIt (in category 'buttons') -----
+ stateAlternativeBrowseIt
+ 
+ 	^ Preferences valueOfFlag: #alternativeBrowseIt ifAbsent: [false]!

Item was added:
+ ----- Method: PreferenceWizardMorph>>stateUseBiggerCursors (in category 'buttons') -----
+ stateUseBiggerCursors
+ 
+ 	^ Cursor useBiggerCursors!

Item was added:
+ ----- Method: PreferenceWizardMorph>>stateUseBiggerFonts (in category 'buttons') -----
+ stateUseBiggerFonts
+ 
+ 	^ UserInterfaceTheme current name beginsWith: 'Demo'!

Item was changed:
+ ----- Method: PreferenceWizardMorph>>stepTime (in category 'stepping and presenter') -----
- ----- Method: PreferenceWizardMorph>>stepTime (in category 'testing') -----
  stepTime
  	^ 1000!

Item was added:
+ ----- Method: PreferenceWizardMorph>>toggleAlternativeBrowseIt (in category 'buttons') -----
+ toggleAlternativeBrowseIt
+ 
+ 	Preferences toggle: #alternativeBrowseIt.
+ 	self changed: #stateAlternativeBrowseIt.!

Item was added:
+ ----- Method: PreferenceWizardMorph>>toggleUseBiggerCursors (in category 'buttons') -----
+ toggleUseBiggerCursors
+ 
+ 	Cursor useBiggerCursors: self stateUseBiggerCursors not.
+ 	Cursor currentCursor: Cursor currentCursor.
+ 	
+ 	self changed: #stateUseBiggerCursors.!

Item was added:
+ ----- Method: PreferenceWizardMorph>>toggleUseBiggerFonts (in category 'buttons') -----
+ toggleUseBiggerFonts
+ 
+ 	[
+ 		self stateUseBiggerFonts
+ 			ifFalse: [Preferences setDemoFonts]
+ 			ifTrue: [Preferences restoreDefaultFonts].
+ 	] valueSupplyingAnswer: true.
+ 		
+ 	self changed: #stateUseBiggerFonts.!



More information about the Packages mailing list