[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-dev
Subject:    [squeak-dev] The Trunk: PreferenceBrowser-mt.157.mcz
From:       commits () source ! squeak ! org
Date:       2023-08-31 8:56:04
Message-ID: 20230831085608.A076C583EBB () mail ! squeak ! org
[Download RAW message or body]

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

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

Name: PreferenceBrowser-mt.157
Author: mt
Time: 31 August 2023, 10:56:04.456282 am
UUID: 00d3c3db-cc9a-c14f-93ae-c97a4d555614
Ancestors: PreferenceBrowser-mt.156

Use #px for magic (pixel-based) numbers. Complements Graphics-mt.544

=============== Diff against PreferenceBrowser-mt.156 ===============

Item was changed:
  ----- Method: PreferenceBrowser>>initialExtent (in category 'user interface') -----
  initialExtent
  	"Scale here because the receiver is not built through a tool builder. See \
#buildPluggableWindow:."  
  	self flag: #workaround. "Avoid overflowing items for the current set of \
preferences (ct 6/16/2022 14:33). In the future, we want to improve the layouting of \
the PreferenceBrowser instead. See: \
https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-June/221107.html" + 	^ \
                705px @ 440px!
- 	^ (705 @ 440 * RealEstateAgent scaleFactor) rounded!

Item was changed:
  ----- Method: PreferenceBrowserMorph>>newSeparator (in category 'submorphs - \
buttons') -----  newSeparator
  	^ Morph new
  		color: Color transparent;
+ 		width: 5px;
- 		width: (5 * RealEstateAgent scaleFactor) truncated;
  		vResizing: #spaceFill;
  		yourself!

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);
  		textColor: self defaultTextColor;
  		borderColor: self defaultTextColor;
  		instVarNamed: #borderColor put: self defaultTextColor; "HACK!!"
+ 		borderWidth: 2px;
- 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]);
  		vResizing: #shrinkWrap;
  		hResizing: #shrinkWrap;
  		layoutInset: self defaultButtonMargins;
  		yourself!

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;
  		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@0 corner: self cellGap@0);
  		yourself).
  	
  	pane vScrollBar
  		setProperty: #noUserInterfaceTheme toValue: true;
  		sliderColor: Color white.
  	(pane vScrollBar instVarNamed: #slider) 
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]);
+ 		borderWidth: 2px.
- 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated.
  	(pane vScrollBar instVarNamed: #pagingArea) 
  		cornerStyle: (self hasLowPerformance ifTrue: [#square] ifFalse: [#rounded]).	
  			
  	^ pane!

Item was changed:
  ----- Method: PreferenceWizardMorph>>displayScaleChangedBy: (in category 'display \
scale') -----  displayScaleChangedBy: factor
  
  	isFullScreen == true ifTrue: [
  		self changedRadio.
  		previewWorld submorphsDo: [:ea |
  			ea isSystemWindow ifTrue: [ea displayScaleChangedBy: factor]].
  		self updateFromChangedScaleFactor.
  		^ self].
  	
  	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).
  		
  	self height: titleMorph height * 4.
  	
  	self updateLowPerformanceLabel: lowPerformanceMorph contents.
  	
  	{ startButton . skipButton } do: [:button |
  		button
  			layoutInset: self defaultButtonMargins;
+ 			borderWidth: 2px;
- 			borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
  			font: (UserInterfaceTheme current get: #wizardButtonFont);
  			updateMinimumExtent "Font might not change but PPI did."].
  		
  	(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].
  	
  	self width: self world width.
  	self center: self world center.!

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

Item was changed:
  ----- Method: PreferenceWizardMorph>>updateFromChangedScaleFactor (in category \
'display scale') -----  updateFromChangedScaleFactor
  
  	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).
  							button owner balloonText ifNotNil: [:text |
  								text addAttribute: (TextFontReference toFont: (UserInterfaceTheme current \
get: #wizardHelpFont))]]  ifFalse: [
  							button
  								layoutInset: self defaultButtonMargins].
  				button
+ 					borderWidth: 2px;
- 					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@0 corner: self layoutInset@0);
  		font: (UserInterfaceTheme current get: #wizardStandardFont).
  	buttonRowMorph
  		cellGap: self cellGap;
  		layoutInset: (0@self layoutInset corner: 0@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@0 corner: self cellGap@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@0);
  			cellGap: self cellGap.
  		scrollPane := page submorphs second.
  		scrollPane scrollBarThickness: self layoutInset.
  		scrollPane scroller firstSubmorph
  			cellGap: self cellGap;
  			layoutInset: (0@0 corner: self cellGap@0).
  		(scrollPane vScrollBar instVarNamed: #slider)
+ 			borderWidth: 2px].
- 			borderWidth: (2 * RealEstateAgent scaleFactor) truncated].
  	
  	"previewWorld"
  	previewWorld layoutFrame
  		topOffset: titleMorph height;
  		bottomOffset: buttonRowMorph height negated.
+ 	previewWorld borderWidth: 2px.
- 	previewWorld borderWidth: (2 * RealEstateAgent scaleFactor) truncated.
  	self bounds: self world bounds.
  	self updateWindowBounds.
  	self updatePageVisibility.!

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);  color: Color transparent;
  		barColor: Color white;
  		borderColor: Color white;
+ 		borderWidth: 2px;
- 		borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
  		yourself
  		!


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic