99 ' startTime' ,
1010 ' currentTimeMorph' ,
1111 ' lastEventMorph' ,
12- ' lastToolInfo'
12+ ' lastToolInfo' ,
13+ ' windowColorIndicator'
1314 ],
1415 #category : ' DebuggingSpy-Browser' ,
1516 #package : ' DebuggingSpy-Browser'
@@ -22,8 +23,10 @@ DSTimerWindow >> buildLayout [
2223 timerMorph := self timerMorph.
2324 currentTimeMorph := self currentTimeMorph.
2425 lastEventMorph := self lastEventMorph.
26+ windowColorIndicator := self windowColorIndicator.
2527
2628 self
29+ addMorph: windowColorIndicator;
2730 addMorph: lastEventMorph;
2831 addMorph: self recordingIcon;
2932 addMorph: timerMorph;
@@ -43,7 +46,7 @@ DSTimerWindow >> currentTimeMorph [
4346
4447 ^ StringMorph new
4548 contents: Time now print24;
46- position: 325 @ 6
49+ position: 335 @ 6
4750]
4851
4952{ #category : ' timer' }
@@ -67,6 +70,17 @@ DSTimerWindow >> getFormattedNameFrom: aRecord [
6770 ^ formattedEventName
6871]
6972
73+ { #category : ' accessing' }
74+ DSTimerWindow >> getRecordColorFrom: aRecord [
75+ " Returns the toolInfo's window corresponding color, or default color otherwise."
76+
77+ | toolInfo |
78+ toolInfo := self getToolInfoFor: aRecord.
79+ toolInfo ifNil: [ ^ DSRecordBrowserPresenter defaultWindowColor ].
80+
81+ ^ toolInfo toolClass windowColor
82+ ]
83+
7084{ #category : ' accessing' }
7185DSTimerWindow >> getToolInfoFor: aRecord [
7286 " Returns the record's toolInfo if possible, else returns the last used toolInfo (which can be nil)."
@@ -121,14 +135,18 @@ DSTimerWindow >> lastEventMorph [
121135 ^ lastEventMorph ifNil: [
122136 lastEventMorph := StringMorph new
123137 contents: ' No last record' ;
124- position: 5 @ 6 ]
138+ height: 15 ;
139+ position: 15 @ 6 ]
125140]
126141
127142{ #category : ' accessing' }
128143DSTimerWindow >> lastRecord: aRecord [
129144 " Updates the last record text on the window."
130145
131- lastEventMorph contents: (self getFormattedNameFrom: aRecord)
146+ lastEventMorph contents: (self getFormattedNameFrom: aRecord).
147+ windowColorIndicator
148+ backgroundColor: (self getRecordColorFrom: aRecord);
149+ contents: ' ' " so we force the redraw"
132150]
133151
134152{ #category : ' accessing' }
@@ -172,14 +190,14 @@ DSTimerWindow >> recordingIcon [
172190
173191 ^ ImageMorph new
174192 image: (self iconNamed: #glamorousRedCircle );
175- position: 250 @ 7 ;
193+ position: 260 @ 7 ;
176194 yourself
177195]
178196
179197{ #category : ' accessing' }
180198DSTimerWindow >> size [
181199
182- ^ 400 @ 30
200+ ^ 410 @ 30
183201]
184202
185203{ #category : ' accessing' }
@@ -210,7 +228,7 @@ DSTimerWindow >> stopButton [
210228 label: (IconicListItemMorph new icon: (self iconNamed: #stop ));
211229 model: self ;
212230 actionSelector: #stopTimer ;
213- position: 375 @ 4 ;
231+ position: 385 @ 4 ;
214232 yourself
215233]
216234
@@ -227,7 +245,7 @@ DSTimerWindow >> timerMorph [
227245
228246 ^ StringMorph new
229247 contents: ' 00:00:00' ;
230- position: 265 @ 6
248+ position: 275 @ 6
231249]
232250
233251{ #category : ' private - layout' }
@@ -236,3 +254,13 @@ DSTimerWindow >> updatePosition [
236254
237255 self position: self currentWorld extent - self extent - self margin - (0 @ self currentWorld taskbars first extent y)
238256]
257+
258+ { #category : ' layout' }
259+ DSTimerWindow >> windowColorIndicator [
260+
261+ ^ windowColorIndicator ifNil: [
262+ windowColorIndicator := StringMorph new
263+ contents: ' ' ;
264+ height: 15 ;
265+ position: 5 @ 6 ]
266+ ]
0 commit comments