Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To tag element #184

Merged
merged 35 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2a44f3e
first
plantec Jul 20, 2024
57aabee
finally, a tag element is a particular button with a different skin
plantec Jul 21, 2024
8171728
+ Toplo tag package
plantec Jul 21, 2024
2711f5b
+ tag in baseline
plantec Jul 21, 2024
f3ded7b
review selectionMode/selectionElementOption organisation and dependen…
plantec Jul 21, 2024
3e4e76e
review selection modes initialization
plantec Jul 22, 2024
32f5603
ToAbstractListElement: selection modes arestored in a dictionary.
plantec Jul 22, 2024
d41b78d
autocritics
plantec Jul 22, 2024
4d8f64d
fixed tag label
plantec Jul 22, 2024
9d8f159
fixed ToMultiSelectElementCheckSkin
plantec Jul 22, 2024
0aa07dd
ToTagElement: fixed remove button handler
plantec Jul 22, 2024
ccad6b3
example
plantec Jul 22, 2024
4c8b363
move some inst var from ToMultiSelectElement to ToMultiSelectBarElement
plantec Jul 23, 2024
38d9f12
+ TToTripletElement
plantec Jul 23, 2024
f9530fb
stresser
plantec Jul 23, 2024
68ea444
remove TToElementWithLabeledIcon TToElementWithTripletElement
plantec Jul 24, 2024
f815561
clean-up checkable and co
plantec Jul 24, 2024
18a1139
ToMultiSelect cleaning
plantec Jul 24, 2024
5c5a046
+ TToCheckableGroupHolder
plantec Jul 24, 2024
8a98ee5
+ ToSubSelectionModelRegistry
plantec Jul 25, 2024
7b32535
+ ToArrayBasedSubSelectionModelRegistry
plantec Jul 25, 2024
1927163
- ToSelectionModel>>duplicate
plantec Jul 25, 2024
cce7bca
+ ToOrderedCollectionBasedSubSelectionModelRegistry
plantec Jul 25, 2024
e044c75
optimized copySelectionFrom:
plantec Jul 26, 2024
dfe981a
fixed stresser
plantec Jul 26, 2024
53eb487
add few release in ToListSelectionModel and co
plantec Jul 26, 2024
b35bd1d
make stresser garbage collect
plantec Jul 26, 2024
93a9d88
stresser
plantec Jul 26, 2024
6669cba
release in selection model related classes
plantec Jul 26, 2024
7a915db
ToListNodeHolder>>dataItem is a weak reference
plantec Jul 27, 2024
0f3b1f2
+ ToCommandQueue
plantec Jul 27, 2024
05f529b
example (at bilbao)
plantec Aug 8, 2024
0fd36e3
remove ToFocusedLookEvent reference
plantec Aug 30, 2024
8ec744e
ToSkinStateGenerator should not handle BlClickAbortedEvent. This is …
plantec Sep 6, 2024
0065c43
utility method to reset the canvas scale factor
plantec Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/BaselineOfToplo/BaselineOfToplo.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ BaselineOfToplo >> registerPackages: spec [
spec package: #'Toplo-Widget-Segmented' with: [
spec requires:
#( #Toplo #'Toplo-Widget-Button' #'Toplo-Widget-List' ) ].

spec package: #'Toplo-Widget-Tag' with: [
spec requires:
#( #Toplo #'Toplo-Widget-Button' ) ].

spec
package: #'Toplo-Widget-TabPane-Tests'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Class {
#name : #ToListDisabledSelectionElementSkin,
#name : #ToListDisabledSelectionElementExampleSkin,
#superclass : #ToRawSkin,
#category : #'Toplo-Widget-List-Selection-Element'
#category : #'Toplo-Examples'
}

{ #category : #'event handling' }
ToListDisabledSelectionElementSkin >> installSkinEvent: anEvent [
ToListDisabledSelectionElementExampleSkin >> installSkinEvent: anEvent [

super installSkinEvent: anEvent.
anEvent elementDo: [ :e |
Expand Down
25 changes: 18 additions & 7 deletions src/Toplo-Examples/ToListElementStresser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Class {
'counter',
'listIdentifiers',
'maxPrimaryIntervals',
'maxNbTasks'
'maxNbTasks',
'endTime',
'startTime'
],
#category : #'Toplo-Examples'
}
Expand Down Expand Up @@ -203,7 +205,7 @@ ToListElementStresser >> finishedInAllTabs [
^ tabsPanel tabs allSatisfy: [ :tab |
| list |
list := tab userData at: #list.
list userData at: #finishedStress ]
list userData at: #finishedStress ifAbsent: [false] ]
]

{ #category : #initialization }
Expand Down Expand Up @@ -237,6 +239,7 @@ ToListElementStresser >> initialize [
tabSelectionProcess := [
| round |
round := 0.
startTime := DateAndTime now.
[ self finishedInAllTabs ] whileFalse: [
| idx |
round := round + 1.
Expand All @@ -245,10 +248,14 @@ ToListElementStresser >> initialize [
self tabsPanel enqueueTask:
(BlTaskAction new action: [
(self tabsPanel tabs at: idx) check ]).
1 seconds wait ] ] newProcess.
1 seconds wait
"Smalltalk garbageCollect" ].
endTime := DateAndTime now.
(endTime - startTime) asDuration traceCr ]
newProcess.

tabSelectionProcess name: self class name.
tabSelectionProcess priority: Processor systemBackgroundPriority.
tabSelectionProcess priority: Processor userBackgroundPriority.

self tabsPanel
addEventHandlerOn: BlElementAddedToSceneGraphEvent
Expand Down Expand Up @@ -365,6 +372,7 @@ ToListElementStresser >> newStressedListNumber: aNumber [
list userData at: #finishedStress put: false.
self maxRound timesRepeat: [
round := round + 1.
(round \\ 100) isZero ifTrue: [ Smalltalk garbageCollect ].
self processingRound: round inList: list number: aNumber.
self afterRoundInList: list ].
self processEndInList: list number: aNumber ] newProcess.
Expand All @@ -385,7 +393,9 @@ ToListElementStresser >> newStressedListNumber: aNumber [

pane addChild: list.
pane addChild: (self newSelectionBoardOn: list).
list userData at: #identifier put: (ident asRopedText bold , suffix asRopedText).
list userData
at: #identifier
put: ident asRopedText bold , suffix asRopedText.

^ pane -> list
]
Expand All @@ -400,13 +410,14 @@ ToListElementStresser >> nextCounter [
{ #category : #private }
ToListElementStresser >> nextProcessPriorityForListNumber: aNumber [

| priorities |
"| priorities |
priorities := {
Processor lowestPriority.
Processor userBackgroundPriority.
Processor systemBackgroundPriority }.

^ priorities at: aNumber \\ priorities size + 1
^ priorities at: aNumber \\ priorities size + 1"
^ Processor userBackgroundPriority.
]

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ToListElementStresserWithAdditionalSelecters >> newListElement [

| l |
l := ToListElement new
nodeBuilder: [ :node :dataItem :holder |
nodeBuilder: [ :node :dataItem :holder |
| lab |
lab := ToLabel text: dataItem.
node addChild: lab.
Expand All @@ -161,15 +161,10 @@ ToListElementStresserWithAdditionalSelecters >> newListElement [
holder isDisabled ifTrue: [
node background: (Color veryLightGray alpha: 0.5) ] ];
yourself.
"
l newDisabledSelectionMode onInstalledIn: l.
l newUnselectableSelectionMode onInstalledIn: l.
l withHiddenSelecter.
"
l
withHiddenSelecter;
withUnselectableSelecter;
withDisabledSelecter.

l newHiddenSelectionMode on: l.
l newUnselectableSelectionMode on: l.
l newDisabledSelectionMode on: l.

^ l
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Class {
#name : #ToListUnselectableSelectionElementExempleSkin,
#name : #ToListUnselectableSelectionElementExampleSkin,
#superclass : #ToRawSkin,
#category : #'Toplo-Examples'
}

{ #category : #'event handling' }
ToListUnselectableSelectionElementExempleSkin >> installSkinEvent: anEvent [
ToListUnselectableSelectionElementExampleSkin >> installSkinEvent: anEvent [

super installSkinEvent: anEvent.
anEvent elementDo: [ :e |
| btn border |
e positionHook: [ :p :l | p - (l padding left / 2 @ 0) ].
e sizeHook: [ :p :l | p + ((l padding left / 2) + (l padding right / 2) @ 0) ].
e layout: BlFrameLayout new.
e padding: (BlInsets right: 5).
btn := ToButton new
Expand Down
47 changes: 47 additions & 0 deletions src/Toplo-Examples/ToMultiSelectElementCheckSkin.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Class {
#name : #ToMultiSelectElementCheckSkin,
#superclass : #ToRawSkin,
#category : #'Toplo-Examples'
}

{ #category : #'event handling' }
ToMultiSelectElementCheckSkin >> installSkinEvent: anEvent [

super installSkinEvent: anEvent.
anEvent elementDo: [ :e |
| im cont bar w background |
w := 2.
e background: BlBackground transparent.
background := e valueOfTokenNamed: #'border-color-primary-selection'.
bar := BlElement new
width: w;
yourself.
bar background: background.
bar constraintsDo: [ :c |
c vertical matchParent.
c frame horizontal alignLeft ].
e addChild: bar.
cont := BlElement new
geometry: BlCircleGeometry new;
layout: BlFrameLayout new;
yourself.
im := ToImage inner: self pathCheckSVG.
im innerImage firstChild background: background.
im margin: (BlInsets right: 20).
im constraintsDo: [ :c |
c frame vertical alignCenter.
c frame horizontal alignRight ].
im size: 16 asPoint.
im background: Color transparent.
e layout: BlFrameLayout new.
e addChild: im ]
]

{ #category : #'event handling' }
ToMultiSelectElementCheckSkin >> pathCheckSVG [

^ '<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 1024 1024">
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/>
</svg>'
]
11 changes: 0 additions & 11 deletions src/Toplo-Examples/ToPicsumPhotosGallerySelectionElement.class.st

This file was deleted.

Loading