Skip to content

Commit

Permalink
simplify ToSelectList node and related skins
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Oct 21, 2024
1 parent 21a047d commit 481c167
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 50 deletions.
10 changes: 7 additions & 3 deletions src/Toplo-Widget-List/ToListNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ ToListNode >> clickEventHandlerClasses [
ifFalse: [ { ToListNodeSingleSelectionClickEventHandler } ]
]

{ #category : #'instance creation' }
ToListNode >> newRawSkin [
{ #category : #skin }
ToListNode >> installRawStyle [

^ ToListNodeSkin new
super installRawStyle.
self outskirts: BlOutskirts inside.
self padding: (BlInsets
horizontal: (self valueOfTokenNamed: #'list-node-padding-H')
vertical: (self valueOfTokenNamed: #'list-node-padding-V'))
]
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ToMultiSelectPopupWindowManager >> defaultNodeFactory [
^ [ :theHolder |
theHolder isGroup
ifTrue: [ ToSelectGroupListNode new ]
ifFalse: [ ToSelectDataListNode new ] ]
ifFalse: [ ToListNode new ] ]
]

{ #category : #initialization }
Expand Down
26 changes: 0 additions & 26 deletions src/Toplo-Widget-Select/ToSelectDataListNode.class.st

This file was deleted.

20 changes: 7 additions & 13 deletions src/Toplo-Widget-Select/ToSelectGroupListNode.class.st
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
Class {
#name : #ToSelectGroupListNode,
#superclass : #ToSelectListNode,
#superclass : #ToListNode,
#category : #'Toplo-Widget-Select-List'
}

{ #category : #skin }
ToSelectGroupListNode >> installRawStyle [

| verticalPadding leftPadding rightPadding label |
| label |
super installRawStyle.
verticalPadding := self valueOfTokenNamed: #'padding-content-V'.
rightPadding := self valueOfTokenNamed: #'padding-content-H'.
leftPadding := (self valueOfTokenNamed: #'padding-content-H') / 3.
self padding: (BlInsets
top: verticalPadding + 6
left: leftPadding
bottom: verticalPadding
right: rightPadding).
self padding:
((self padding withTop: self padding top + 6) withBottom:
self padding bottom + 3).
label := self firstChild.
label text
foreground: Color lightGray;
light
label foreground: Color lightGray.
label applyStyle
]
6 changes: 0 additions & 6 deletions src/Toplo-Widget-Select/ToSelectListNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ Class {
#superclass : #ToListNode,
#category : #'Toplo-Widget-Select-List'
}

{ #category : #accessing }
ToSelectListNode >> isGroup [

^ self holder isGroup
]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ToSelectPopupWindowManager >> defaultNodeBuilder [
{ #category : #initialization }
ToSelectPopupWindowManager >> defaultNodeFactory [

^ [ :theHolder | ToSelectDataListNode new ]
^ [ :theHolder | ToListNode new ]
]

{ #category : #initialization }
Expand Down

0 comments on commit 481c167

Please sign in to comment.