[squeak-dev] The Trunk: Morphic-mt.1886.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Feb 10 13:54:57 UTC 2022


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

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

Name: Morphic-mt.1886
Author: mt
Time: 10 February 2022, 2:54:49.439689 pm
UUID: ad58f319-2312-604e-b912-bfbdf876c0a3
Ancestors: Morphic-mt.1885

Fixes issues around font/style/color configuration in dialog messages.

Extracts layout defaults for buttons, lists, and text fields to class-side method.

Complements PreferenceBrowser-mt.133.

=============== Diff against Morphic-mt.1885 ===============

Item was changed:
  ----- Method: DialogWindow>>setMessageParameters (in category 'initialization') -----
  setMessageParameters
  
  	| fontToUse colorToUse |
  	messageMorph ifNil: [^ self].
  
  	fontToUse := self userInterfaceTheme font ifNil: [TextStyle defaultFont].
  	colorToUse := self userInterfaceTheme textColor ifNil: [Color black].
  	
  	messageMorph
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
+ 		textColor: colorToUse;
+ 		textStyle: fontToUse asNewTextStyle. "Use style with other point sizes available"!
- 		textColor: colorToUse.
- 
- 	messageMorph contents
- 		addAttribute: (TextFontReference toFont: fontToUse)
- 		unless: [:attrs | attrs anySatisfy: [:each |
- 			"Do not overwrite existing font attributes."
- 			each class == TextFontChange or: [each class == TextFontReference]]].
- 	messageMorph contents
- 		addAttribute: (TextColor color: colorToUse)
- 		unless: [:attrs | attrs anySatisfy: [:each |
- 			"Do not overwrite existing color attributes"
- 			each class == TextColor or: [each mayActOnClick "usually colored, too"]]].!

Item was changed:
  ----- Method: LazyListMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  
  	self color: Color black.
- 	self cellInset: 3 at 0.
  
  	font := Preferences standardListFont.
  	
  	listItems := nil.
  	listIcons := nil.
  	listFilterOffsets := nil.
  	
  	selectedRow := nil.
  	selectedRows := PluggableSet integerSet.
  	preSelectedRow := nil.!

Item was added:
+ ----- Method: PluggableButtonMorph class>>labelMargins (in category 'defaults') -----
+ labelMargins
+ 
+ 	| inset |
+ 	inset := (4 * RealEstateAgent scaleFactor) truncated.
+ 	^ inset @ 0 corner: inset @ 0!

Item was changed:
  ----- Method: PluggableButtonMorph>>defaultLayoutInset (in category 'layout') -----
  defaultLayoutInset
  
+ 	^ self class labelMargins!
- 	| inset |
- 	inset := (4 * RealEstateAgent scaleFactor) truncated.
- 	^ inset @ 0 corner: inset @ 0!

Item was added:
+ ----- Method: PluggableListMorph class>>listMargins (in category 'defaults') -----
+ listMargins
+ 
+ 	^(3 * RealEstateAgent scaleFactor) truncated @0 corner: 0 at 0!

Item was changed:
  ----- Method: PluggableListMorph>>createListMorph (in category 'initialization') -----
  createListMorph
  
  	^ self listMorphClass new
  		listSource: self;
+ 		cellInset: self class listMargins;
  		hResizing: #spaceFill;
  		vResizing: #shrinkWrap;
  		cellPositioning: #leftCenter;
  		setProperty: #indicateKeyboardFocus toValue: #never;
  		yourself.!

Item was added:
+ ----- Method: PluggableTextMorph class>>textMargins (in category 'defaults') -----
+ textMargins
+ 
+ 	^ (3 * RealEstateAgent scaleFactor) truncated @0 corner: 0 at 0!

Item was changed:
  ----- Method: PluggableTextMorph>>initializeTextMorph (in category 'initialization') -----
  initializeTextMorph
  
  	textMorph := self textMorphClass new
+ 		margins: self class textMargins;
- 		margins: (3 at 0 corner: 0 at 0);
  		setEditView: self;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		setProperty: #indicateKeyboardFocus toValue: #never;
  		yourself.
  		
  	LegacyShortcutsFilter legacyShortcutsEnabled
  		ifTrue: [textMorph addKeyboardCaptureFilter: LegacyShortcutsFilter].!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>themesAndWindowColorsOn: (in category 'submenu - extras') -----
  themesAndWindowColorsOn: menu
  	| themes |
  	menu addItem:[:item|
  		item
  			contents: 'Fonts' translated;
  			subMenuUpdater: Preferences
  			selector: #fontConfigurationMenu:;
  			icon: MenuIcons smallFontsIcon].
  	menu addLine.
  	menu addItem:[:item|
  		item
  			contents: (Model useColorfulWindows ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Colorful Windows' translated;
  			target: self;
  			selector: #toggleColorfulWindows].
  	menu addItem:[:item|
  		item
  			contents: (SystemWindow gradientWindow not ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Flat Widget Look' translated;
  			target: self;
  			selector: #toggleGradients].
  	menu addLine.
  	menu addItem:[:item |
  		item
  			contents: (((Preferences valueOfFlag: #menuAppearance3d ifAbsent: [false]) and: [Morph useSoftDropShadow]) ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Soft Shadows' translated;
  			target: self;
  			selector: #toggleSoftShadows].
  	menu addItem:[:item |
  		item
  			contents: (((Preferences valueOfFlag: #menuAppearance3d ifAbsent: [false]) and: [Morph useSoftDropShadow not]) ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Hard Shadows' translated;
  			target: self;
  			selector: #toggleHardShadows].
  	menu addLine.
  	menu addItem:[:item |
  		item
+ 			contents: (SystemWindow roundedWindowCorners ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Rounded Window/Dialog Look' translated;
- 			contents: (SystemWindow roundedWindowCorners ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Rounded Window/Dialog/Menu Look' translated;
  			target: self;
  			selector: #toggleRoundedWindowLook].
  	menu addItem:[:item |
  		item
+ 			contents: (PluggableButtonMorph roundedButtonCorners ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Rounded Button/Scrollbar/Menu Look' translated;
- 			contents: (PluggableButtonMorph roundedButtonCorners ifTrue: ['<yes>'] ifFalse: ['<no>']), 'Rounded Button/Scrollbar Look' translated;
  			target: self;
  			selector: #toggleRoundedButtonLook].
  	menu addLine.
  	themes := UserInterfaceTheme allThemes asArray sort: #name ascending.
  	themes := themes select: [ :each | each isGenuine].
  	themes ifEmpty: [ 
  		menu addItem: [ :item | 
  			item
  				contents: '(No UI themes found.)' translated;
  				isEnabled: false ] ].
  	themes do: [ :each |
  		menu addItem: [ :item |
  			item 
  				contents: (UserInterfaceTheme current name = each name ifTrue: ['<yes>'] ifFalse: ['<no>']), each name;
  				target: each;
  				selector: #applyScaled ] ].
  	menu	
  		addLine;
  		add: 'Set Etoys Mode' translated target: ReleaseBuilderSqueakland selector: #setEtoysMode.
  	menu
  		addLine;
  		add: 'Restore UI theme background' translated target: self selector: #restoreThemeBackground;
  		add: 'Reset all UI themes' translated target: self selector: #resetAllThemes;
  		add: 'Edit current UI theme...' translated target: self selector: #editCurrentTheme.!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>toggleRoundedButtonLook (in category 'submenu - extras') -----
  toggleRoundedButtonLook
  
  	| switch |
  	switch := PluggableButtonMorph roundedButtonCorners not.
  	
  	PluggableButtonMorph roundedButtonCorners: switch.
+ 	ScrollBar roundedScrollBarLook: switch.
+ 	MenuMorph roundedMenuCorners: switch.!
- 	ScrollBar roundedScrollBarLook: switch.!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>toggleRoundedWindowLook (in category 'submenu - extras') -----
  toggleRoundedWindowLook
  
  	| switch |
  	switch := SystemWindow roundedWindowCorners not.
  	
  	SystemWindow roundedWindowCorners: switch.
+ 	DialogWindow roundedDialogCorners: switch.!
- 	DialogWindow roundedDialogCorners: switch.
- 	MenuMorph roundedMenuCorners: switch.!



More information about the Squeak-dev mailing list