Skip to content

Commit d3c8e7e

Browse files
committed
Merge 25400ac
2 parents 48f456c + 25400ac commit d3c8e7e

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

src/Brick-Glamorous/BrGlamorousVectorIcons.class.st

+17
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,18 @@ BrGlamorousVectorIcons class >> largePlay [
419419
background: Color black ] asStencil
420420
]
421421

422+
{ #category : #icons }
423+
BrGlamorousVectorIcons class >> largePlayAsynchronous [
424+
<script: 'self largeParallelPlay inspect'>
425+
426+
^ [ BlElement new
427+
size: 128@64;
428+
geometry: (BlSvgPath new
429+
svg: 'M 10.506208 3.0563515 L 53.95177 32.020057 L 10.506208 60.98376 Z M 80.987392 51.61287 C 82.209382 50.390874 84.190618 50.390874 85.412608 51.61287 C 86.634604 52.834856 86.634604 54.81609 85.412608 56.038075 C 84.190618 57.26007 82.209382 57.26007 80.987392 56.038075 C 79.765396 54.81609 79.765396 52.834856 80.987392 51.61287 M 80.987392 7.961925 C 82.209382 6.739931 84.190618 6.739931 85.412608 7.961925 C 86.634604 9.183912 86.634604 11.165144 85.412608 12.387132 C 84.190618 13.609126 82.209382 13.609126 80.987392 12.387132 C 79.765396 11.165144 79.765396 9.183912 80.987392 7.961925 M 108.58739 17.955897 C 109.80938 16.733903 111.79061999999999 16.733903 113.01261 17.955897 C 114.23460399999999 19.177885 114.23460399999999 21.159116 113.01261 22.381104 C 111.79061999999999 23.603098 109.80938 23.603098 108.58739 22.381104 C 107.365396 21.159116 107.365396 19.177885 108.58739 17.955897 M 80.2 45.42739 C 78.993649 45.857395 77.861406 46.5553 76.895611 47.521096 C 73.413774 51.00291 73.413774 56.648036 76.895611 60.12985 C 80.37743 63.61168 86.02257 63.61168 89.504388 60.12985 C 92.986225 56.648036 92.986225 51.00291 89.504388 47.521096 C 88.571439 46.588143 87.48317 45.905174 86.322817 45.47219 L 86.35163800000001 42.302544 L 88.2 42.4 C 88.2 42.4 92.85648 42.705223 96.20304 42.549193 C 102.46873 42.25706 106.98172 41.309813 109.53014999999999 39.125446 C 112.62365 36.47387 113.92451 33.411835 114.10638 29.295624 L 114.144376 28.43571 C 115.22163 28.000484 116.23106 27.346207 117.10439 26.472876 C 120.58622600000001 22.991065 120.58622600000001 17.345937 117.10439 13.864125 C 113.62257 10.382295 107.97743 10.382295 104.49561 13.864125 C 101.01377500000001 17.345937 101.01377500000001 22.991065 104.49561 26.472876 C 105.548445 27.525713 106.79908 28.260192 108.12789000000001 28.676315 L 108.11223 29.030775 C 107.99933 31.585943 107.36516499999999 33.07868 105.6254 34.569906 C 104.459215 35.569493 100.856304 36.32572 95.9236 36.555704 C 92.81067 36.70084 89.450278 36.644723 86.204986 36.46231 C 86.203322 36.462216 86.201658 36.462123 86.199994 36.46203 C 86.2 35.330257 86.2 33.94234 86.2 32 C 86.2 25.195285 86.2 25.195285 86.2 19.17452 L 86.2 18.572612 C 87.40635 18.142605 88.538594 17.444702 89.504388 16.478904 C 92.986225 12.997092 92.986225 7.351964 89.504388 3.8701525 C 86.02257 .38832283 80.37743 .38832283 76.895611 3.8701525 C 73.413774 7.351964 73.413774 12.997092 76.895611 16.478904 C 77.861406 17.444702 78.993649 18.142605 80.2 18.572612 L 80.2 19.17452 C 80.2 25.195285 80.2 25.195285 80.2 32 C 80.2 38.804715 80.2 38.804715 80.2 44.82548 Z'
430+
viewbox: (0@0 extent: 128@64));
431+
background: Color black ] asStencil
432+
]
433+
422434
{ #category : #icons }
423435
BrGlamorousVectorIcons class >> largeRustLogo [
424436
<script: 'self largeRustLogo inspect'>
@@ -643,6 +655,11 @@ BrGlamorousVectorIcons class >> play [
643655
background: Color black ] asStencil
644656
]
645657

658+
{ #category : #icons }
659+
BrGlamorousVectorIcons class >> playAsynchronous [
660+
^ [ self largePlayAsynchronous asElement asScalableElement size: 16 @ 16 ] asStencil
661+
]
662+
646663
{ #category : #icons }
647664
BrGlamorousVectorIcons class >> playground [
648665
<script: 'self playground inspect'>

src/Brick/BrEditor.class.st

+27-9
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,12 @@ BrEditor >> beReadOnlyWithoutSelection [
3636

3737
{ #category : #accessing }
3838
BrEditor >> computeVerticalScrollExtent [
39-
^ (self layout
40-
findFirstVisibleChildClosestToEndCompletelyVisible: true
41-
acceptPartiallyVisible: true) segment textEnd
42-
- (self layout
43-
findFirstVisibleChildClosestToStartCompletelyVisible: true
44-
acceptPartiallyVisible: true) segment textStart
39+
^ self lastVisibleSegment textEnd - self firstVisibleSegment textStart
4540
]
4641

4742
{ #category : #accessing }
4843
BrEditor >> computeVerticalScrollOffset [
49-
^ (self layout
50-
findFirstVisibleChildClosestToStartCompletelyVisible: true
51-
acceptPartiallyVisible: true) segment textStart
44+
^ self firstVisibleSegment textStart
5245
]
5346

5447
{ #category : #accessing }
@@ -101,6 +94,13 @@ BrEditor >> editor: aBrTextEditor [
10194
aBrTextEditor consumeClickEvent: false
10295
]
10396

97+
{ #category : #accessing }
98+
BrEditor >> firstVisibleSegment [
99+
^ (self layout
100+
findFirstVisibleChildClosestToStartCompletelyVisible: true
101+
acceptPartiallyVisible: true) segment
102+
]
103+
104104
{ #category : #initialization }
105105
BrEditor >> initialize [
106106
super initialize.
@@ -120,6 +120,7 @@ BrEditor >> initialize [
120120

121121
self when: BlMouseUpEvent do: [ :anEvent | anEvent consumed: true ].
122122
self when: BlClickEvent do: [ :anEvent | anEvent consumed: true ].
123+
self when: BrScrollByWish do: [:aWish | self onScrollBy: aWish]
123124
]
124125

125126
{ #category : #'api - editor' }
@@ -148,13 +149,30 @@ BrEditor >> isReadOnly [
148149
^ self viewModel mode isReadOnly
149150
]
150151

152+
{ #category : #accessing }
153+
BrEditor >> lastVisibleSegment [
154+
^ (self layout
155+
findFirstVisibleChildClosestToEndCompletelyVisible: true
156+
acceptPartiallyVisible: true) segment
157+
]
158+
151159
{ #category : #'editor - operations' }
152160
BrEditor >> navigator [
153161
<return: #BrTextEditorNavigator>
154162

155163
^ self editor navigator
156164
]
157165

166+
{ #category : #'api - scrolling' }
167+
BrEditor >> onScrollBy: aWish [
168+
| position linesOnScreen |
169+
position := aWish delta y asInteger.
170+
linesOnScreen := self lastVisibleSegment index - self firstVisibleSegment index.
171+
position > self computeVerticalScrollExtent
172+
ifTrue: [ self scrollToPosition: self lastVisibleSegment index + linesOnScreen ]
173+
ifFalse: [ self scrollToPosition: self firstVisibleSegment index - linesOnScreen ]
174+
]
175+
158176
{ #category : #'editor - operations' }
159177
BrEditor >> selecter [
160178
<return: #BrTextEditorSelecter>

0 commit comments

Comments
 (0)