[squeak-dev] The Inbox: MorphicExtras-ct.325.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 23 10:56:25 UTC 2022


A new version of MorphicExtras was added to project The Inbox:
http://source.squeak.org/inbox/MorphicExtras-ct.325.mcz

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

Name: MorphicExtras-ct.325
Author: ct
Time: 23 August 2022, 12:56:21.917308 pm
UUID: 9dbee01e-1b9f-f24b-93a1-16d02f845373
Ancestors: MorphicExtras-eem.322

Fixes high-dpi support in RecordingControlsMorph. Removes unused #addRecordLevelSlider. Improves color of record level slider.

Supersedes incomplete MorphicExtras-ct.324.

=============== Diff against MorphicExtras-eem.322 ===============

Item was changed:
  ----- Method: RecordingControlsMorph>>addButtonRows (in category 'initialization') -----
  addButtonRows
  
  	| r fullWidth |
  	r := AlignmentMorph newRow vResizing: #shrinkWrap.
+ 	
- 
- 
  	r addMorphBack: (self buttonName: 'Morph' translated action: #makeSoundMorph).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Tile' translated action: #makeTile).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Trim' translated action: #trim).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Show' translated action: #showEditor).
  	self addMorphBack: r.
  	r layoutChanged.
  	fullWidth := r fullBounds width.
+ 	
- 
  	r := AlignmentMorph newRow vResizing: #shrinkWrap.
  	r addMorphBack: (self buttonName: 'Record' translated action: #record).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Stop' translated action: #stop).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Play' translated action: #playback).
+ 	r addMorphBack: (Morph new extent: 4 px @ 1 px; color: Color transparent).
- 	r addMorphBack: (Morph new extent: 4 at 1; color: Color transparent).
  	r addMorphBack: (self buttonName: 'Codec' translated action: #chooseCodec).
  	r addMorphBack: self makeStatusLight.
  	self addMorphBack: r.
  	Smalltalk at: #OggSpeexCodec ifPresent: [:c |
  		self changeCodec: c name: 'Speex'].
  	r layoutChanged.
  	fullWidth := fullWidth max: r fullBounds width.
+ 	^ fullWidth @ r fullBounds height!
- 	^ fullWidth@(r fullBounds height).
- !

Item was removed:
- ----- Method: RecordingControlsMorph>>addRecordLevelSlider (in category 'other') -----
- addRecordLevelSlider
- 
- 	| levelSlider r |
- 	levelSlider := SimpleSliderMorph new
- 		color: color;
- 		extent: 100 at 2;
- 		target: recorder;
- 		actionSelector: #recordLevel:;
- 		adjustToValue: recorder recordLevel.
- 	r := AlignmentMorph newRow
- 		color: color;
- 		layoutInset: 0;
- 		wrapCentering: #center; cellPositioning: #leftCenter;
- 		hResizing: #shrinkWrap;
- 		vResizing: #rigid;
- 		height: 24.
- 	r addMorphBack: (StringMorph contents: '0 ').
- 	r addMorphBack: levelSlider.
- 	r addMorphBack: (StringMorph contents: ' 10').
- 	self addMorphBack: r.
- !

Item was changed:
  ----- Method: RecordingControlsMorph>>addRecordLevelSliderIn: (in category 'other') -----
  addRecordLevelSliderIn: aPoint
  
  	| levelSlider r |
+ 	(levelSlider := SimpleSliderMorph new)
- 	levelSlider := SimpleSliderMorph new
  		color: color darker;
+ 		sliderColor: Color gray;
+ 		extent: (aPoint x * 0.75) asInteger @ (aPoint y * 0.6) asInteger;
+ 		minimumExtent: levelSlider extent;
- 		extent: (aPoint x * 0.75) asInteger@(aPoint y*0.6) asInteger;
  		target: recorder;
  		actionSelector: #recordLevel:;
+ 		orientation: #horizontal;
  		adjustToValue: recorder recordLevel.
  	r := AlignmentMorph newRow
  		color: color;
  		layoutInset: 0;
  		wrapCentering: #center; cellPositioning: #leftCenter;
  		hResizing: #shrinkWrap;
  		vResizing: #rigid;
+ 		height: aPoint y + 2 px.
+ 	r addMorphBack: (StringMorph contents: '0 ' font: TextStyle defaultFont).
- 		height: aPoint y + 2.
- 	r addMorphBack: (StringMorph contents: '0 ' font: Preferences standardButtonFont).
  	r addMorphBack: levelSlider.
+ 	r addMorphBack: (StringMorph contents: ' 10' font: TextStyle defaultFont).
+ 	self addMorphBack: r.!
- 	r addMorphBack: (StringMorph contents: ' 10' font: Preferences standardButtonFont).
- 	self addMorphBack: r.
- !

Item was changed:
  ----- Method: RecordingControlsMorph>>buttonName:action: (in category 'other') -----
  buttonName: aString action: aSymbol
  
  	^ SimpleButtonMorph new
  		target: self;
+ 		label: aString;
- 		label: aString font: Preferences standardButtonFont;
  		actionSelector: aSymbol
  !

Item was changed:
  ----- Method: RecordingControlsMorph>>initialize (in category 'initialization') -----
  initialize
  
  	| r full |
  	super initialize.
  	self hResizing: #shrinkWrap; vResizing: #shrinkWrap.
+ 	self borderWidth: 2 px.
- 	self borderWidth: 2.
  	self listDirection: #topToBottom.
  	recorder := SoundRecorder new.
  	full := self addButtonRows.
  	self addRecordLevelSliderIn: full.
  
  	r := AlignmentMorph newRow vResizing: #shrinkWrap.
  	r addMorphBack: (self makeRecordMeterIn: full).
  	self addMorphBack: r.
+ 	self extent: 10 @ 10.  "make minimum size"!
- 	self extent: 10 at 10.  "make minimum size"
- !

Item was changed:
  ----- Method: RecordingControlsMorph>>makeRecordMeterIn: (in category 'other') -----
  makeRecordMeterIn: aPoint
  
  	| outerBox h |
  	h := (aPoint y * 0.6) asInteger.
+ 	outerBox := Morph new extent: aPoint x asInteger @ h; color: Color gray.
+ 	recordMeter := Morph new extent: 1 px @ h; color: Color yellow.
+ 	recordMeter position: outerBox topLeft + (1 px @ 1 px).
- 	outerBox := Morph new extent: (aPoint x) asInteger at h; color: Color gray.
- 	recordMeter := Morph new extent: 1 at h; color: Color yellow.
- 	recordMeter position: outerBox topLeft + (1 at 1).
  	outerBox addMorph: recordMeter.
+ 	^ outerBox!
- 	^ outerBox
- !



More information about the Squeak-dev mailing list