• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / MooseIDE / 18782250839

24 Oct 2025 02:06PM UTC coverage: 66.592% (-0.03%) from 66.625%
18782250839

push

github

web-flow
Merge pull request #1488 from moosetechnology/radio-button-layout

refactor: add all presenters at once instead of doing one by one.

41 of 60 new or added lines in 4 files covered. (68.33%)

4 existing lines in 1 file now uncovered.

20726 of 31124 relevant lines covered (66.59%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.22
/src/MooseIDE-Core/MiMultipleRowsLayout.class.st
1
Class {
2
        #name : 'MiMultipleRowsLayout',
3
        #superclass : 'SpBoxLayout',
4
        #category : 'MooseIDE-Core-Settings',
5
        #package : 'MooseIDE-Core',
6
        #tag : 'Settings'
7
}
8

9
{ #category : 'api - adding' }
NEW
10
MiMultipleRowsLayout >> add: aName withConstraints: aBlock [
×
NEW
11
        "This layout depends on the number of presenters so it should receive all presenters at once.
×
NEW
12
        
×
NEW
13
        instead of doing: 
×
NEW
14
        aCollectionOfPresenters do: [ :p | self layout add: p ]
×
NEW
15
        
×
NEW
16
        do: 
×
NEW
17
        self layout addPresenters: aCollectionOfPresenters
×
NEW
18
        "
×
NEW
19
        
×
NEW
20
        self error: 'Please use #addPresenters: with all your presenters at once'
×
NEW
21
]
×
22

23
{ #category : 'adding' }
NEW
24
MiMultipleRowsLayout >> addPresenters: aCollection [
×
NEW
25

×
NEW
26
        self addPresenters: aCollection withConstraints: [ :constraints |
×
NEW
27
                        constraints
×
NEW
28
                                expand: false;
×
NEW
29
                                fill: false ]
×
NEW
30
]
×
31

32
{ #category : 'adding' }
33
MiMultipleRowsLayout >> addPresenters: aCollection withConstraints: aConstraintsBlock [
2✔
34
        "puts presenters on rows of up to 4 presenters (to the limit of 12 presenter)
2✔
35
         tries to put same number of presenters on each row"
2✔
36

2✔
37
        | nbRows rowLength |
2✔
38
        self beTopToBottom.
2✔
39

2✔
40
        nbRows := aCollection size / 4 roundUpTo: 1.
2✔
41
        "rowLength is the number of items per row in order to be evenly distributed
2✔
42
        e.g: for 9 items it will be:
2✔
43
         0 - 0 - 0
2✔
44
         0 - 0 - 0
2✔
45
         0 - 0 - 0
2✔
46
        instead of
2✔
47
        0 - 0 - 0 - 0
2✔
48
        0 - 0 - 0 - 0
2✔
49
        0
2✔
50
        "
2✔
51
        rowLength := aCollection size / nbRows roundUpTo: 1.
2✔
52

2✔
53

2✔
54
        (aCollection groupsOf: rowLength) do: [ :aRow |
2✔
55
                        | rowLayout |
2✔
56
                        rowLayout := SpBoxLayout newLeftToRight.
2✔
57
                        aRow do: [ :presenter | rowLayout add: presenter withConstraints: aConstraintsBlock ].
2✔
58
                        super add: rowLayout withConstraints: [ :c |
2✔
59
                                        c
2✔
60
                                                expand: false;
2✔
61
                                                fill: false ] ]
2✔
62
]
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc