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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 30 15:26:23 UTC 2021


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

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

Name: PreferenceBrowser-mt.123
Author: mt
Time: 30 December 2021, 4:26:23.253748 pm
UUID: 480d1495-ecbb-f545-9811-4010e2b67eb8
Ancestors: PreferenceBrowser-mt.122

Complements Graphics-mt.455

The preference wizard now begins with asking the user about the preferred scale factor.

=============== Diff against PreferenceBrowser-mt.122 ===============

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

Item was added:
+ ----- Method: PreferenceWizardMorph>>changedRadio (in category 'updating') -----
+ changedRadio
+ 
+ 	self dependents
+ 		select: [:dep | dep respondsTo: #getLabelSelector]
+ 		thenDo: [:button |
+ 			button update: button getStateSelector.
+ 			button update: button getLabelSelector].!

Item was changed:
  ----- Method: PreferenceWizardMorph>>checkmark (in category 'initialization') -----
  checkmark
  
+ 	^ checkmark ifNil: [checkmark := (((ToolIcons iconNamed: #checkmark) dyed: Color white) scaledToSize: (TextStyle defaultFont height * 1.25) asPoint) asMorph]!
- 	^ checkmark ifNil: [checkmark := (((ToolIcons iconNamed: #checkmark) dyed: Color white) scaledToSize: 20 at 20) asMorph]!

Item was added:
+ ----- Method: PreferenceWizardMorph>>chooseScaleFactor: (in category 'actions - radio') -----
+ chooseScaleFactor: inPercent
+ 
+ 	Display relativeUiScaleFactor: inPercent / 100.
+ 	self changedRadio.
+ 	Project current world
+ 		noDisplayDuring: [self updateFromChangedScaleFactor].!

Item was changed:
+ ----- Method: PreferenceWizardMorph>>chooseTheme: (in category 'actions - radio') -----
- ----- Method: PreferenceWizardMorph>>chooseTheme: (in category 'support') -----
  chooseTheme: aTheme
  
+ 	aTheme applyScaled.
- 	aTheme apply.
  
  	"The theme does not theme this fake world."
+ 	previewWorld fillStyle: self world fillStyle.
+ 	
+ 	self changedRadio.!
- 	previewWorld fillStyle: self world fillStyle.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createButton (in category 'initialization - building') -----
  createButton
  
  	^ PluggableButtonMorphPlus new
  		setProperty: #noUserInterfaceTheme toValue: true;
  		offColor: (self defaultColor adjustBrightness: 0.2);
  		feedbackColor: (self defaultColor adjustBrightness: 0.4);
  		model: self;
+ 		font: (UserInterfaceTheme current get: #wizardButtonFont);
- 		font: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 12);
  		textColor: self defaultTextColor;
  		borderColor: self defaultTextColor;
  		instVarNamed: #borderColor put: self defaultTextColor; "HACK!!"
+ 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
- 		borderWidth: 2;
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]);
  		vResizing: #shrinkWrap;
  		hResizing: #shrinkWrap;
+ 		layoutInset: self defaultButtonMargins;
- 		layoutInset: (20 at 10 corner: 20 at 10);
  		yourself!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createCheckbox:for:help: (in category 'initialization - building') -----
  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);
  		vResizing: #rigid;
  		hResizing: #rigid;
  		action: ('toggle', selector) asSymbol;
  		getStateSelector: ('state', selector) asSymbol;
  		getLabelSelector: ('label', selector) asSymbol;
+ 		extent: (TextStyle defaultFont height * 1.75) asPoint.
- 		extent: 25 at 25.
  
  	lbl := self createLabel: label color: self defaultTextColor.
  	lbl hResizing: #spaceFill.
  	
  	box := Morph new
+ 		setProperty: #isCheckbox toValue: true;
  		color: Color transparent;
  		changeTableLayout;
  		listDirection: #leftToRight;
  		cellPositioning: #topLeft;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
  		rubberBandCells: true;
+ 		cellGap: (TextStyle defaultFont widthOf: $x);
- 		cellGap: 10;
  		yourself.
  		
  	box addAllMorphs: {btn. lbl}.
  	self
  		setBalloonText: (terms isString ifTrue: [terms] ifFalse: [self findHelpStringFor: terms])
  		for: box.
  	^ box!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createLabel: (in category 'initialization - building') -----
  createLabel: aString
  
+ 	^ self createLabel: aString color: (self defaultTextColor adjustBrightness: -0.15)!
- 	^ self createLabel: aString color: (self defaultTextColor adjustBrightness: -0.1)!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createLabel:color: (in category 'initialization - building') -----
  createLabel: aString color: aColor
  
+ 	| lbl |
+ 	lbl := TextMorph new hResizing: #spaceFill; vResizing: #shrinkWrap.
+ 	lbl newContents:aString.
+ 	lbl text
+ 		addAttribute: (TextColor color: aColor);
+ 		addAttribute: (TextFontReference toFont: ((UserInterfaceTheme current get: #wizardStandardFont))).
+ 	lbl margins: self defaultTextMargins.
+ 	lbl lock.
+ 	^ lbl!
- 	^ self createLabel: aString color: aColor pointSize: 12!

Item was removed:
- ----- Method: PreferenceWizardMorph>>createLabel:color:pointSize: (in category 'initialization - building') -----
- createLabel: aString color: aColor pointSize: size
- 
- 	| lbl |
- 	lbl := TextMorph new hResizing: #spaceFill; vResizing: #shrinkWrap.
- 	lbl newContents:aString.
- 	lbl text
- 		addAttribute: (TextColor color: aColor);
- 		addAttribute: (TextFontReference toFont: ((StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: size))).
- 	lbl lock.
- 	^ lbl!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createPage (in category 'initialization - building') -----
  createPage
  
  	^ Morph new
  		color: Color transparent;
  		hResizing: #spaceFill;
  		vResizing: #spaceFill;
  		changeTableLayout;
  		listDirection: #topToBottom;
  		cellPositioning: #topLeft;
+ 		layoutInset: (self layoutInset asPoint corner: self cellGap at 0);
+ 		cellGap: self cellGap;
- 		layoutInset: (20 at 20 corner: 10 at 0);
- 		cellGap: 10;
  		yourself!

Item was added:
+ ----- Method: PreferenceWizardMorph>>createRadioButton:for:argument: (in category 'initialization - building') -----
+ createRadioButton: label for: selector argument: object
+ 
+ 	^ self createRadioButton: label for: selector argument: object help: #()!

Item was added:
+ ----- Method: PreferenceWizardMorph>>createRadioButton:for:argument:help: (in category 'initialization - building') -----
+ createRadioButton: label for: selector argument: object help: terms
+ 
+ 	| box lbl btn suffix |
+ 	suffix := ((object respondsTo: #name)
+ 		ifTrue: [object name]
+ 		ifFalse: [object asString]) asLegalSelector.
+ 
+ 	btn := self createButton
+ 		layoutInset: 0;
+ 		label: ' ';
+ 		onColor: (self defaultColor adjustBrightness: 0.3) offColor: (self defaultColor adjustBrightness: 0.3);
+ 		vResizing: #rigid;
+ 		hResizing: #rigid;
+ 		actionSelector: ('choose', selector, ':') asSymbol;
+ 		arguments: {object};
+ 		getStateSelector: ('state', selector, suffix) asSymbol;
+ 		getLabelSelector: ('radio', selector, suffix) asSymbol;
+ 		extent: (TextStyle defaultFont height * 1.75) asPoint.
+ 		
+ 	lbl := self createLabel: label color: self defaultTextColor.
+ 	lbl hResizing: #spaceFill.
+ 	
+ 	box := Morph new
+ 		setProperty: #isRadioButton toValue: true;
+ 		color: Color transparent;
+ 		changeTableLayout;
+ 		listDirection: #leftToRight;
+ 		cellPositioning: #topLeft;
+ 		hResizing: #spaceFill;
+ 		vResizing: #shrinkWrap;
+ 		rubberBandCells: true;
+ 		cellGap: (TextStyle defaultFont widthOf: $x);
+ 		yourself.
+ 		
+ 	box addAllMorphs: {btn. lbl}.
+ 	self
+ 		setBalloonText: (terms isString ifTrue: [terms] ifFalse: [self findHelpStringFor: terms])
+ 		for: box.
+ 	^ box!

Item was changed:
  ----- Method: PreferenceWizardMorph>>createScrollPane (in category 'initialization - building') -----
  createScrollPane
  
  	| pane |
  	pane := ScrollPane new
  		setProperty: #noUserInterfaceTheme toValue: true;
  		hScrollBarPolicy: #never;
  		vScrollBarPolicy: #whenNeeded;
  		borderWidth: 0;
  		color: Color transparent;
+ 		scrollBarThickness: self layoutInset;
- 		scrollBarThickness: 20;
  		yourself.
  		
  	pane
  		hResizing: #spaceFill;
  		vResizing: #spaceFill.
  	
  	pane scroller changeTableLayout.
  	pane scroller addMorph: (Morph new
  		changeTableLayout;
  		color: Color transparent;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
+ 		cellGap: self cellGap;
+ 		layoutInset: (0 at 0 corner: self cellGap at 0);
- 		cellGap: 10;
- 		layoutInset: (0 at 0 corner: 10 at 0);
  		yourself).
  	
  	pane vScrollBar
  		setProperty: #noUserInterfaceTheme toValue: true;
  		sliderColor: Color white.
  	(pane vScrollBar instVarNamed: #slider) 
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]);
+ 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated.
- 		borderWidth: 2.
  	(pane vScrollBar instVarNamed: #pagingArea) 
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]).	
  			
  	^ pane!

Item was added:
+ ----- Method: PreferenceWizardMorph>>defaultButtonMargins (in category 'initialization') -----
+ defaultButtonMargins
+ 
+ 	| w h |
+ 	w := (self defaultFont widthOf: $x) * 2.
+ 	h := self defaultFont height // 2.
+ 	^ w at h corner: w at h!

Item was added:
+ ----- Method: PreferenceWizardMorph>>defaultExtent (in category 'initialization') -----
+ defaultExtent
+ 
+ 	^ 1024 at 768!

Item was added:
+ ----- Method: PreferenceWizardMorph>>defaultFont (in category 'initialization') -----
+ defaultFont
+ 
+ 	^ UserInterfaceTheme current get: #wizardStandardFont!

Item was added:
+ ----- Method: PreferenceWizardMorph>>defaultTextMargins (in category 'initialization') -----
+ defaultTextMargins
+ 
+ 	| w h |
+ 	w := self defaultFont widthOf: $x.
+ 	h := self defaultFont height.
+ 	^ 0@(h//8) corner: w@(h//4)!

Item was changed:
  ----- Method: PreferenceWizardMorph>>doesNotUnderstand: (in category 'actions - 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: [' '] ].
+ 
+ 	(msg selector numArgs = 0 and: [msg selector beginsWith: 'radio'])
+ 		ifTrue: [^ (self perform: ('state', (msg selector allButFirst: 5)) asSymbol)
+ 			ifTrue: [self radiomark]
+ 			ifFalse: [' '] ].
+ 
+ 	(msg selector numArgs = 0 and: [msg selector beginsWith: 'stateTheme'])
+ 		ifTrue: [^ self stateTheme: (msg selector allButFirst: 10)].
+ 
+ 	(msg selector numArgs = 0 and: [msg selector beginsWith: 'stateScaleFactor'])
+ 		ifTrue: [^ self stateScaleFactor: (msg selector allButFirst: 16)].
  		
  	^ super doesNotUnderstand: msg!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  	
  	isFullScreen := false.
  
  	self hasLowPerformance
  		ifTrue: [self color: self defaultColor]
  		ifFalse: [self color: (self defaultColor alpha: 0.75)].
  		
  	self setProperty: #indicateKeyboardFocus toValue: #never.
  	
  	self
  		changeProportionalLayout;
+ 		layoutInset: (self defaultFont widthOf: $x) * 2;
+ 		cellGap: (self defaultFont widthOf: $x);
- 		layoutInset: 20;
- 		cellGap: 10;
  		cellPositioning: #center;
  		disableLayout: true;
  		morphicLayerNumber: self class dialogLayer + 1.
  				
  	self addKeyboardCaptureFilter: self.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializeButtons (in category 'initialization - playfield') -----
  initializeButtons
  
  	buttonRowMorph := Morph new
  		color: Color transparent;
  		changeTableLayout;
  		listDirection: #leftToRight;
+ 		cellGap: self cellGap;
+ 		layoutInset: (0 at self layoutInset corner: 0 at 0);
- 		cellGap: 10;
- 		layoutInset: (0 at 20 corner: 0 at 0);
  		vResizing: #shrinkWrap;
  		hResizing: #spaceFill;
  		yourself.
  		
  	buttonRowMorph addAllMorphs: {
  		previousButton := self createButton action: #previous; label: 'Previous' translated.
+ 		pagesLabel := (self createLabel: '0 / 0') hResizing: #shrinkWrap; margins: (self layoutInset at 0 corner: self layoutInset at 0); fullBounds; yourself.
- 		pagesLabel := (self createLabel: '0 / 0') hResizing: #shrinkWrap; margins: (20 at 0 corner: 20 at 0); fullBounds; yourself.
  		nextButton := self createButton action: #next; label: 'Next' translated.
  		self createHorizontalSpacer.
+ 		doneButton := self createButton action: #accept; label: 'Done' translated}.
- 		self createButton action: #accept; label: 'Done' translated}.
  	
+ 	(previousButton width max: nextButton width) in: [:w |
+ 		previousButton hResizing: #rigid; width: w.
+ 		nextButton hResizing: #rigid; width: w].
+ 	
  	buttonRowMorph fullBounds.
  	buttonRowMorph layoutFrame: (LayoutFrame fractions: (0 @ 1 corner: 1 @ 1) offsets: (0@ buttonRowMorph height negated corner: 0 @ 0)).!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializeControlMorph (in category 'initialization - playfield') -----
  initializeControlMorph
  
  	controlMorph := Morph new
  		color: Color transparent;
  		changeTableLayout;
  		listDirection: #topToBottom;
  		hResizing: #spaceFill;
  		vResizing: #spaceFill;
+ 		layoutInset: (0 at 0 corner: self cellGap at 0);
+ 		layoutFrame: (LayoutFrame fractions: (0.0 @ 0 corner: 0.35 @ 1.0) offsets: (0@ titleMorph height corner: 0 @ buttonRowMorph height negated));
- 		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).!

Item was added:
+ ----- Method: PreferenceWizardMorph>>initializePage00ScaleFactor (in category 'initialization - pages') -----
+ initializePage00ScaleFactor
+ 
+ 	| currentPage pane helper |
+ 	currentPage := pages add: self createPage.
+ 	pane := self createScrollPane.
+ 	
+ 	currentPage addMorphBack: (self createLabel: 'Choose a scale factor' translated color: Color white).
+ 	currentPage addMorphBack: pane.
+ 	
+ 	helper := MenuMorph new.
+ 	TheWorldMainDockingBar instance scaleFactorsOn: helper.
+ 	
+ 	helper items allButLast do: [:item |
+ 		pane scroller firstSubmorph addMorphBack: (self
+ 			createRadioButton: item contents
+ 			for: #ScaleFactor
+ 			argument: item arguments first * 100)].
+ 
+ 	Display platformScaleFactorKnown ifFalse: [
+ 		currentPage addMorphBack: (self createLabel: 'Note that the recommended scale factor for your platform and display is unknown. Please adjust manually.' translated color: Color banana)].!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage01Themes (in category 'initialization - pages') -----
  initializePage01Themes
  
  	| currentPage pane |
  	currentPage := pages add: self createPage.
  	pane := self createScrollPane.
  	
+ 	currentPage addMorphBack: (self createLabel: 'Choose a theme' color: Color white).
- 	currentPage addMorphBack: (self createLabel: 'Choose a theme:' color: Color white).
  	currentPage addMorphBack: pane.
  	
  	((UserInterfaceTheme allThemes
+ 		select: [:uit | uit isGenuine])
- 		reject: [:uit | uit name beginsWith: 'Demo'])
  		sorted: [:a :b | a name <= b name])
  			do: [:ea |
+ 			pane scroller firstSubmorph addMorphBack: (self
+ 				createRadioButton: ea name
+ 				for: #Theme
+ 				argument: ea)].
- 			pane scroller firstSubmorph addMorphBack: (self createButton
- 				label: ea name;
- 				hResizing: #spaceFill;
- 				action: #chooseTheme:;
- 				arguments: {ea})].
  
+ 	currentPage addMorphBack: (self createLabel: 'Note that "Colorful windows" show colors that fit the current theme. See next page.' translated color: Color banana)!
- !

Item was removed:
- ----- Method: PreferenceWizardMorph>>initializePage02bVisualsMore (in category 'initialization - pages') -----
- initializePage02bVisualsMore
- 
- 	| currentPage pane |
- 	currentPage := pages add: self createPage.
- 	pane := self createScrollPane.
- 	
- 	currentPage addMorphBack: (self createLabel: 'Choose more visual settings' color: Color white).
- 	currentPage addMorphBack: pane.
- 	
- 	pane scroller firstSubmorph 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).
- 		}.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePage99ExtraPackages (in category 'initialization - pages') -----
  initializePage99ExtraPackages
  	"Let the user install extra packages."
  
  	| currentPage packagesList installButton |
  	currentPage := self createPage.
  	currentPage
  		cellPositioning: #topCenter;
- 		layoutInset: (150 at 40 corner: 150 at 20);
  		addMorphBack: self createHorizontalSpacer;
  		addMorphBack: ((self createLabel: 'Do you want to install extra packages?' color: Color white)
  			hResizing: #shrinkWrap;
  			yourself);
+ 		addMorphBack: ((self createLabel: 'Note that the installation process requires a network connection with Internet access and might take several minutes.' color: (Color gray: 0.9))
- 		addMorphBack: ((self createLabel: 'Note that the installation process requires an internet connection and may take several minutes.' color: (Color gray: 0.9))
  			hResizing: #rigid;
  			vResizing: #shrinkWrap;
+ 			width: (self defaultFont widthOf: $x) * 55;
- 			width: 450;
  			yourself).
  	
  	currentPage submorphs last text addAttribute: TextAlignment centered.
  	currentPage submorphs last layoutChanged.
  	
+ 	currentPage addMorphBack: (self createVerticalSpace height: self layoutInset).
- 	currentPage addMorphBack: (self createVerticalSpace height: 20).
  	
  	packagesList := self createScrollPane.
  	packagesList
+ 		width: (self defaultFont widthOf: $x) * 40;
- 		width: 350;
  		hResizing: #rigid;
  		vResizing: #spaceFill.
  
  	packagesList scroller firstSubmorph addAllMorphsBack: {
  		self createCheckbox: 'Latest system updates' translated for: #InstallLatestUpdates help: 'Install the latest patches for ' translated, SystemVersion current version.
  		self createCheckbox: 'Refactoring support in code browsers' translated for: #InstallRefactoringTools help: 'Refactoring is a process of re-writing or re-organizing text or code. The purpose of a refactor is to make the code or text more understandable and readable while exactly preserving its meaning and behavior.' translated.
  		self createCheckbox: 'Autocomplete in code editors' translated for: #InstallAutoComplete help: 'Package that provides interactive, context-sensitive auto-completion for Squeak.' translated.
  		self createCheckbox: 'Git support and browser' translated for: #InstallGitInfrastructure help: 'From the Git Browser, you can create new commits, synchronize with remote repositories (fetch, pull, push), manage and merge branches, switch between them, and compare different versions.' translated.
  		self createCheckbox: 'Foreign function interface (FFI)' translated for: #InstallFFI help: 'FFI, the Squeak Foreign Function Interface, is used to call functions located in shared libraries that are not part of the Squeak VM nor its plugins' translated.
  		self createCheckbox: 'Access OS functions' translated for: #InstallOSProcess help: 'OSProcess provides access to operating system functions, including pipes and child process creation.' translated.
  	}.
  		
  	currentPage addMorphBack: packagesList.
  
  	currentPage addMorphBack: ((self createLabel: 'Find more on www.squeak.org/projects' color: (Color gray: 0.9))
  		hResizing: #shrinkWrap; yourself).
  	
  	installButton := (self createButton action: #installExtraPackages).
  	currentPage addMorphBack: installButton.
  	currentPage addMorphBack: (self createButton action: #showSqueak; label: 'No, maybe later.' translated).
  	
  	self setProperty: #checkInternet toValue: true.
  	self checkInternetOn: installButton.
  	
  	^ currentPage!

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

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializePreviewWorld (in category 'initialization - playfield') -----
  initializePreviewWorld
  
  	Preferences enable: #systemWindowEmbedOK.
  
  	previewWorld := PasteUpMorph new
  		hResizing: #spaceFill;
  		vResizing: #spaceFill;
  		viewBox: (0 at 0 corner: 500 at 500);
+ 		layoutFrame: (LayoutFrame fractions: (0.35 @ 0 corner: 1.0 @ 1.0) offsets: (0@ titleMorph height corner: 0 @ buttonRowMorph height negated));
- 		layoutFrame: (LayoutFrame fractions: (0.3 @ 0 corner: 1.0 @ 1.0) offsets: (0@ titleMorph height corner: 0 @ buttonRowMorph height negated));
  		fillStyle: Project current world fillStyle;
+ 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
- 		borderWidth: 2;
  		borderColor: Color white;
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]);
  		yourself.
  	
  	self
  		addOrReplaceBrowser;
  		addOrReplaceSenders;
  		addOrReplaceWorkspace;
  		updateWindowBounds.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>initializeWelcome (in category 'initialization') -----
  initializeWelcome
  
  	titleMorph := ('Welcome to Squeak' translated asText
  		addAttribute: (TextColor color: self defaultTextColor);
+ 		addAttribute: (TextFontReference toFont: (UserInterfaceTheme current get: #wizardTitleFont));
- 		addAttribute: (TextFontReference toFont: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 20));
  		yourself) asMorph lock.
+ 	titleMorph margins: (self cellGap @ 0 corner: self cellGap @ self cellGap).
- 	titleMorph margins: (10 at 0 corner: 10 at 10).
  	titleMorph layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0) offsets: (0@ 0 corner: 0 @ titleMorph height)).
  
  	startButton := (self createButton action: #showPlayfield; label: 'Configure' translated).
  	skipButton := (self createButton action: #showSqueak; label: 'Skip' translated).
  	
  	(startButton width max: skipButton width) in: [:w |
  		startButton hResizing: #rigid; width: w.
  		skipButton hResizing: #rigid; width: w.
  		
  		startButton layoutFrame: (LayoutFrame fractions: (0.5 @ 0.6 corner: 0.5 @ 0.6) offsets: (2*w negated @ 0 corner: 0 @ 0)).
  		skipButton layoutFrame: (LayoutFrame fractions: (0.5 @ 0.6 corner: 0.5 @ 0.6) offsets: (0@ 0 corner: 2*w @ 0))].
  	
  	lowPerformanceMorph := TextMorph new lock.
  	
  	self addAllMorphs: {titleMorph. startButton. skipButton. lowPerformanceMorph}.!

Item was added:
+ ----- Method: PreferenceWizardMorph>>radiomark (in category 'initialization') -----
+ radiomark
+ 
+ 	^ radiomark ifNil: [radiomark := Morph new color: Color white; extent: (TextStyle defaultFont height * 0.8) asPoint]!

Item was changed:
  ----- Method: PreferenceWizardMorph>>setBalloonText:for: (in category 'support') -----
  setBalloonText: string for: morph
  
+ 	string ifEmpty: [^morph balloonText: nil].
+ 
  	morph
  		balloonColor: ((self defaultColor alpha: self color alpha) adjustBrightness: 0.2);
  		balloonText: (string asText
+ 			addAttribute: (TextFontReference toFont: (UserInterfaceTheme current get: #wizardHelpFont));
- 			addAttribute: (TextFontReference toFont: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9));
  			addAttribute: (TextColor color: Color banana)).!

Item was changed:
  ----- Method: PreferenceWizardMorph>>showPlayfield (in category 'actions') -----
  showPlayfield
  
  	previewWorld ifNil: [self initializePlayfield].
  
  	startButton hide.
  	skipButton hide.
  	lowPerformanceMorph hide.
  	isFullScreen := true.
  	self step.
  	
  	titleMorph layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0) offsets: (0@ 0 corner: 0 @ titleMorph height)).
  	
  	self refreshWorld.
- 	500 milliSeconds wait.
  
  	controlMorph show.
  	previewWorld show.
  	buttonRowMorph show.
  
  	self next.
  	self refreshWorld.
  	
  	!

Item was added:
+ ----- Method: PreferenceWizardMorph>>stateScaleFactor: (in category 'actions - radio') -----
+ stateScaleFactor: key
+ 
+ 	^ (Display relativeUiScaleFactor * 100) rounded asString asLegalSelector = key!

Item was added:
+ ----- Method: PreferenceWizardMorph>>stateTheme: (in category 'actions - radio') -----
+ stateTheme: key
+ 
+ 	^ UserInterfaceTheme current name asLegalSelector = key!

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

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

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

Item was added:
+ ----- Method: PreferenceWizardMorph>>updateFromChangedScaleFactor (in category 'display scale') -----
+ updateFromChangedScaleFactor
+ 
+ 	previewWorld delete.
+ 	previewWorld := nil.
+ 	DisplayScreen displayIsFullScreen ifFalse: [
+ 		DisplayScreen setNewScreenSize: (self defaultExtent * RealEstateAgent scaleFactor) rounded].
+ 
+ 	checkmark := nil.
+ 	radiomark := nil.
+ 	
+ 	self
+ 		layoutInset: (self defaultFont widthOf: $x) * 2;
+ 		cellGap: (self defaultFont widthOf: $x).
+ 		
+ 	titleMorph
+ 		font: (UserInterfaceTheme current get: #wizardTitleFont);
+ 		margins: (self cellGap @ 0 corner: self cellGap @ self cellGap).
+ 	titleMorph layoutFrame
+ 		bottomOffset: titleMorph height.
+ 	
+ 	self updateLowPerformanceLabel: lowPerformanceMorph contents.
+ 	
+ 	"buttons"
+ 	{startButton. skipButton. previousButton. nextButton. doneButton},
+ 		(pages gather: [:page | page allMorphs select: [:ea | ea isButton]])
+ 			do: [:button |
+ 				((button owner hasProperty: #isRadioButton)
+ 					or: [button owner hasProperty: #isCheckbox])
+ 						ifTrue: [
+ 							button
+ 								"layoutInset: 0;"
+ 								extent: (TextStyle defaultFont height * 1.75) asPoint;
+ 								update: button getLabelSelector.
+ 							button owner cellGap: (TextStyle defaultFont widthOf: $x)]
+ 						ifFalse: [
+ 							button
+ 								layoutInset: self defaultButtonMargins].
+ 				button
+ 					borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
+ 					font: (UserInterfaceTheme current get: #wizardButtonFont);
+ 					updateMinimumExtent "Font might not change but PPI did."].
+ 		
+ 	self fullBounds.
+ 		
+ 	(startButton minimumWidth max: skipButton minimumWidth) in: [:w |
+ 		startButton hResizing: #rigid; width: w.
+ 		skipButton hResizing: #rigid; width: w.
+ 		startButton layoutFrame leftOffset: 2*w negated.
+ 		skipButton layoutFrame rightOffset: 2*w].
+ 
+ 	(previousButton minimumWidth max: nextButton minimumWidth) in: [:w |
+ 		previousButton hResizing: #rigid; width: w.
+ 		nextButton hResizing: #rigid; width: w].
+ 	pagesLabel
+ 		margins: (self layoutInset at 0 corner: self layoutInset at 0);
+ 		font: (UserInterfaceTheme current get: #wizardStandardFont).
+ 	buttonRowMorph
+ 		cellGap: self cellGap;
+ 		layoutInset: (0 at self layoutInset corner: 0 at 0).
+ 	buttonRowMorph layoutFrame
+ 		topOffset: buttonRowMorph fullBounds height negated.
+ 	
+ 	"labels"
+ 	{controlMorph firstSubmorph}, (pages gather: [:page | page allMorphs select: [:ea | ea isTextMorph]])
+ 		do: [:label |
+ 			label
+ 				font: (UserInterfaceTheme current get: #wizardStandardFont);
+ 				margins: self defaultTextMargins
+ 			"No need for #releaseParagraph because window resizing will happen anyway."].
+ 	
+ 	"controlMorph"
+ 	controlMorph layoutInset: (0 at 0 corner: self cellGap at 0).
+ 	controlMorph layoutFrame
+ 		topOffset: titleMorph height;
+ 		bottomOffset: buttonRowMorph height negated.
+ 	
+ 	"scroll panes in pages"
+ 	pages do: [:page | | scrollPane |
+ 		page
+ 			layoutInset: (self layoutInset asPoint corner: self cellGap at 0);
+ 			cellGap: self cellGap.
+ 		scrollPane := page submorphs second.
+ 		scrollPane scrollBarThickness: self layoutInset.
+ 		scrollPane scroller firstSubmorph
+ 			cellGap: self cellGap;
+ 			layoutInset: (0 at 0 corner: self cellGap at 0).
+ 		(scrollPane vScrollBar instVarNamed: #slider)
+ 			borderWidth: (2 * RealEstateAgent scaleFactor) truncated].
+ 	
+ 	"previewWorld"
+ 	self initializePreviewWorld.
+ 	self addMorph: previewWorld.
+ 	self step.
+ "	previewWorld borderWidth: (2 * RealEstateAgent scaleFactor) truncated.
+ 	previewWorld layoutFrame
+ 		topOffset: titleMorph height;
+ 		bottomOffset: buttonRowMorph height negated.
+ "	!

Item was changed:
  ----- Method: PreferenceWizardMorph>>updateLowPerformanceLabel: (in category 'layout') -----
  updateLowPerformanceLabel: string
  
  	lowPerformanceMorph contentsAsIs: (string asText
  		addAttribute: (TextColor color: (Color gray: 0.7));
+ 		addAttribute: (TextFontReference toFont: (UserInterfaceTheme current get: #wizardHelpFont))).
- 		addAttribute: (TextFontReference toFont: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9))).
  		
+ 	lowPerformanceMorph layoutFrame: (LayoutFrame fractions: (1 @ 1 corner: 1 @ 1) offsets: (lowPerformanceMorph fullBounds width negated @ lowPerformanceMorph fullBounds height negated corner: self layoutInset @ self layoutInset "Into margins")).
- 	lowPerformanceMorph layoutFrame: (LayoutFrame fractions: (1 @ 1 corner: 1 @ 1) offsets: (lowPerformanceMorph fullBounds width negated @ lowPerformanceMorph fullBounds height negated corner: 20 @ 20 "Into margins")).
  	
  	self layoutChanged.!

Item was changed:
  ----- Method: PreferenceWizardMorph>>updatePageLabel (in category 'layout') -----
  updatePageLabel
  
  	pagesLabel contentsAsIs: (('{1} / {2}' format: {currentPageIndex. pages size}) asText
  		addAttribute: (TextColor color: (Color gray: 0.8));
+ 		addAttribute: (TextFontReference toFont: (UserInterfaceTheme current get: #wizardStandardFont))).!
- 		addAttribute: (TextFontReference toFont: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 12))).!

Item was changed:
  ----- Method: PreferenceWizardMorph>>updateWindowBounds (in category 'layout') -----
  updateWindowBounds
  
+ 	| area extentToUse pointsToUse |
- 	| windows offset margin extentToUse pointsToUse |
  	isFullScreen == false ifTrue: [^ self].
  	previewWorld ifNil: [^ self].
  	
  	self fullBounds.
  
+ 	area := previewWorld layoutBounds insetBy: self layoutInset.
+ 	extentToUse := area extent * (0.8 @ 0.45).
- 	margin := 20 at 20.
- 	extentToUse := (previewWorld extent - (margin * 2)) // 3 * (1.8 @ 1.5).
  	pointsToUse := {
+ 		area topLeft.
+ 		area rightCenter.
+ 		area bottomCenter}.
- 		previewWorld center - (previewWorld extent // (5.5 @ 4.5)).
- 		previewWorld center + (previewWorld width // 5.5 @ 0).
- 		previewWorld center + (0 @ (previewWorld width // 5))}.
  
+ 	previewWorld submorphs reversed withIndexDo: [:window :i |
+ 		window
- 	windows := previewWorld submorphs.
- 	offset := 50 at 50.
- 	
- 	windows reversed withIndexDo: [:ea :i |
- 		ea
  			extent: extentToUse;
+ 			center: (pointsToUse atWrap: i);
+ 			bounds: (window bounds translatedToBeWithin: area)].!
- 			center: (pointsToUse atWrap: i).
- 		offset := offset + (50 at 50)].!

Item was changed:
  ----- Method: PreferenceWizardProgressMorph>>createProgressBar (in category 'as yet unclassified') -----
  createProgressBar
  	
  	^ SystemProgressBarMorph new 
+ 		extent: ((self defaultFont widthOf: $x) * 35) @ ((self defaultFont widthOf: $x) * 2);
- 		extent: 500 at 20;
  		color: Color transparent;
  		barColor: Color white;
  		borderColor: Color white;
+ 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
- 		borderWidth: 2;
  		yourself
  		!

Item was added:
+ ----- Method: PreferenceWizardProgressMorph>>defaultFont (in category 'as yet unclassified') -----
+ defaultFont
+ 
+ 	^ UserInterfaceTheme current get: #wizardStandardFont!

Item was changed:
  ----- Method: PreferenceWizardProgressMorph>>setDefaultParameters (in category 'as yet unclassified') -----
  setDefaultParameters
  	"change the receiver's appareance parameters"
  
  	self
  		color: Color transparent;
  		borderWidth: 0;
+ 		font: self defaultFont;
- 		font: (StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 12);
  		textColor: Color white.!



More information about the Squeak-dev mailing list