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

moosetechnology / MooseIDE / 17938860495

23 Sep 2025 07:28AM UTC coverage: 66.75% (+0.4%) from 66.37%
17938860495

push

github

web-flow
Merge pull request #1423 from moosetechnology/a-good-cleaning

New settings implementation

2683 of 3100 new or added lines in 117 files covered. (86.55%)

105 existing lines in 29 files now uncovered.

20400 of 30562 relevant lines covered (66.75%)

1.33 hits per line

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

78.21
/src/MooseIDE-Core/MiColorGradientSelectionPresenter.class.st
1
Class {
2
        #name : 'MiColorGradientSelectionPresenter',
3
        #superclass : 'MiAbstractSettingPresenter',
4
        #instVars : [
5
                'originButton',
6
                'gradient',
7
                'endButton',
8
                'colorPicker'
9
        ],
10
        #category : 'MooseIDE-Core-Settings',
11
        #package : 'MooseIDE-Core',
12
        #tag : 'Settings'
13
}
14

15
{ #category : 'accessing' }
16
MiColorGradientSelectionPresenter class >> help [
2✔
17

2✔
18
        ^ 'Choose start color for the minimal value and end color for the higher value'
2✔
19
]
2✔
20

21
{ #category : 'accessing' }
22
MiColorGradientSelectionPresenter class >> label [
2✔
23

2✔
24
        ^ 'Color range:'
2✔
25
]
2✔
26

27
{ #category : 'initialization' }
28
MiColorGradientSelectionPresenter >> buildGradientOn: aCanvas [
2✔
29

2✔
30
        | paint |
2✔
31
        aCanvas
2✔
32
                clear;
2✔
33
                color: Color transparent.
2✔
34

2✔
35
        paint := LinearGradientPaint fromArray: {
2✔
36
                                 (0 -> configuration startColor).
2✔
37
                                 (1 -> configuration endColor) }.
2✔
38
        paint
2✔
39
                start: -50 @ 0;
2✔
40
                stop: 50 @ 0.
2✔
41

2✔
42
        aCanvas newBox
2✔
43
                height: 23; "23 is (25 - 2) to align with buttons"
2✔
44
                width: 150;
2✔
45
                paint: paint
2✔
46
]
2✔
47

48
{ #category : 'layout' }
49
MiColorGradientSelectionPresenter >> defaultLayout [
2✔
50

2✔
51
        ^ self newBoxLayoutTopToBottom
2✔
52
                  add: (self newBoxLayoutLeftToRight
2✔
53
                                   add: originButton width: 25;
2✔
54
                                   add: gradient;
2✔
55
                                   add: endButton width: 25;
2✔
56
                                   spacing: 5;
2✔
57
                                   yourself)
2✔
58
                  height: 25;
2✔
59
                  yourself
2✔
60
]
2✔
61

62
{ #category : 'initialization' }
63
MiColorGradientSelectionPresenter >> initializePresenters [
2✔
64

2✔
65
        originButton := self newButton
2✔
66
                                color: configuration startColor;
2✔
67
                                whenActivatedDo: [
2✔
68
                                                self
2✔
69
                                                        openNewColorPickerFrom: originButton
2✔
70
                                                        on: configuration startColor
2✔
71
                                                        action: [ :newColor |
2✔
72
                                                                configuration startColor: newColor ] ].
2✔
73

2✔
74
        gradient := self newRoassal script: [ :canvas |
2✔
75
                            self buildGradientOn: canvas ].
2✔
76

2✔
77
        endButton := self newButton
2✔
78
                             color: configuration endColor;
2✔
79
                             whenActivatedDo: [
2✔
80
                                             self
2✔
81
                                                     openNewColorPickerFrom: endButton
2✔
82
                                                     on: configuration endColor
2✔
83
                                                     action: [ :newColor | configuration endColor: newColor ] ]
2✔
84
]
2✔
85

86
{ #category : 'as yet unclassified' }
NEW
87
MiColorGradientSelectionPresenter >> openNewColorPickerFrom: aButton on: aColor action: aBlock [
×
NEW
88

×
NEW
89
        | picker popover |
×
NEW
90
        picker := aButton newColorPicker.
×
NEW
91
        picker
×
NEW
92
                setColor: aColor;
×
NEW
93
                whenColorChangedDo: [ :newColor |
×
NEW
94
                                aBlock value: newColor.
×
NEW
95
                                aButton color: newColor.
×
NEW
96
                                gradient refresh.
×
NEW
97
                                self update ].
×
NEW
98
        popover := picker asPopover.
×
NEW
99
        popover whenOpenedDo: [ "Not nice to have to get to the widget, but no other way worked."
×
NEW
100
                        popover withAdapterDo: [ :a |
×
NEW
101
                                a widgetDo: [ :w | w extent: 350 @ 500 ] ] ].
×
NEW
102
        popover popup
×
NEW
103
]
×
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