Skip to content

Commit

Permalink
Fix to do list example
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Jul 18, 2024
1 parent 1f8b1c0 commit d5a28e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/Spec-Toplo/SpToploDropListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ SpToploDropListAdapter >> buildWidget [
{ #category : #factory }
SpToploDropListAdapter >> newItemElementFor: node holder: holder [

model hasIcons ifFalse: [
model hasIcons ifFalse: [
^ node addChild:
(ToLabel text: holder dataItem asString)
(ToLabel text: (model displayForItem: holder) asRopedText)
hMatchParent;
yourself ].

node addChild:
(ToLabeledIcon new
labelText: (model displayForItem: holder dataItem);
icon: (ToImage inner: (model getIconFor: holder dataItem));
labelText: (model displayForItem: holder);
icon: (ToImage inner: (model getIconFor: holder));
startInterspace: 10;
hMatchParent;
yourself)
Expand Down
23 changes: 11 additions & 12 deletions src/Spec-Toplo/SpToploListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ SpToploListAdapter >> isNonEditableRow: aRow column: aColumn [
{ #category : #'instance creation' }
SpToploListAdapter >> newItemElementFor: node holder: holder [

self model hasIcons ifFalse: [
^ node addChild:
(ToLabel text: holder dataItem asString)
hMatchParent;
yourself ].

node addChild:
(ToLabeledIcon new
label: (ToLabel
text: (model displayValueFor: holder dataItem) asRopedText);
icon: (ToImage inner: (model iconFor: holder dataItem));
| labeledIcon |
labeledIcon :=
ToLabeledIcon new
startInterspace: 10;
hMatchParent;
yourself)
yourself.

model hasIcons ifTrue: [
labeledIcon iconImage: (model iconFor: holder) ].

labeledIcon labelText: (model displayValueFor: holder) asRopedText.

node addChild: labeledIcon
]

{ #category : #refreshing }
Expand Down

0 comments on commit d5a28e5

Please sign in to comment.