@@ -52,8 +52,8 @@ TaskbarItemMorph >> initialize [
5252{ #category : ' initialization' }
5353TaskbarItemMorph >> initializeAnnouncements [
5454 self
55- on: #mouseEnter send: #taskbarButtonEntered:event:in: to: self model withValue: self ;
56- on: #mouseLeave send: #taskbarButtonLeft:event:in: to: self model withValue: self
55+ on: #mouseEnter send: #taskbarButtonEntered:event:in: to: self model morph withValue: self ;
56+ on: #mouseLeave send: #taskbarButtonLeft:event:in: to: self model morph withValue: self
5757]
5858
5959{ #category : ' initialization' }
@@ -65,7 +65,7 @@ TaskbarItemMorph >> initializeFor: aTaskbar [
6565 lm := self theme
6666 newRowIn: aTaskbar
6767 for:
68- {(( self iconFormSetNamed: self model taskbarIconName) ifNil: [ ^ nil ]) asMorph.
68+ {(self model icon ifNil: [ ^ nil ]) asMorph.
6969 lab}.
7070 lm cellInset: 2 .
7171 self
@@ -78,14 +78,14 @@ TaskbarItemMorph >> initializeFor: aTaskbar [
7878 self initializeAnnouncements.
7979 lab
8080 color:
81- (self model isCollapsed
81+ (self model state = #minimized
8282 ifTrue: [ self theme taskbarItemLabelColorForCollapsed: self ]
8383 ifFalse: [ self theme taskbarItemLabelColorForExpanded: self ])
8484]
8585
8686{ #category : ' accessing' }
8787TaskbarItemMorph >> labelOfSize: labSize [
88- ^ self theme buttonLabelForText: (self model taskbarLabel truncateWithElipsisTo: labSize)
88+ ^ self theme buttonLabelForText: (self model label truncateWithElipsisTo: labSize)
8989]
9090
9191{ #category : ' accessing' }
@@ -121,6 +121,23 @@ TaskbarItemMorph >> normalFillStyle [
121121 ^ self theme taskbarItemNormalFillStyleFor: self
122122]
123123
124+ { #category : ' accessing' }
125+ TaskbarItemMorph >> performAction: event [
126+ " Inform the model that this button has been pressed. Sent by the controller when this button is pressed. If the button's actionSelector takes any arguments, they are obtained dynamically by sending the argumentSelector to the argumentsProvider"
127+
128+ enabled ifFalse: [ ^ self ].
129+ askBeforeChanging ifTrue: [
130+ model morph okToChange ifFalse: [ ^ self ] ].
131+ self actionBlock ifNotNil: [ ^ self actionBlock cull: event ].
132+ actionSelector ifNotNil: [
133+ actionSelector numArgs = 0
134+ ifTrue: [ model morph perform: actionSelector ]
135+ ifFalse: [
136+ argumentsProvider ifNotNil: [
137+ arguments := argumentsProvider perform: argumentsSelector ].
138+ model morph perform: actionSelector withArguments: arguments ] ]
139+ ]
140+
124141{ #category : ' style - border' }
125142TaskbarItemMorph >> pressedBorderStyle [
126143 " Return the pressed borderStyle of the receiver."
0 commit comments