Skip to content

Commit

Permalink
core: let ensureVisible also consider other scrollpanes
Browse files Browse the repository at this point in the history
  • Loading branch information
tom95 committed Sep 22, 2023
1 parent 5505b26 commit 5db6f00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/Sandblocks-Core/SBBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1175,8 +1175,17 @@ SBBlock >> ensureVisible [
method := self containingArtefact.
(method ~= self and: [method notNil and: [self visibleInWorld not]]) ifTrue: [method ensureExpanded].

self isInWorld ifTrue: [self sandblockEditor ifNotNil: [:e |
e scrollToShow: (e cursor cursorPosition block = self ifTrue: [e cursor cursorPosition] ifFalse: [self])]]
self isInWorld ifTrue: [ | show |
show := self fullBounds.
self allOwnersDo: [:o |
(o isKindOf: ScrollPane) ifTrue: [
o scrollToShow: show.
show := o fullBounds]].

self sandblockEditor ifNotNil: [:e |
e scrollToShow: (e cursor cursorPosition block = self
ifTrue: [e cursor cursorPosition]
ifFalse: [self])]]
]

{ #category : #actions }
Expand Down
6 changes: 6 additions & 0 deletions packages/Sandblocks-Morphs/SBButton.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ SBButton >> hovered: aBoolean [
self changed
]

{ #category : #initialization }
SBButton >> icon: anIconMorph do: aBlock [

self widget: anIconMorph shortcut: nil do: aBlock
]

{ #category : #initialization }
SBButton >> icon: anIconMorph label: aString do: aBlock [

Expand Down

0 comments on commit 5db6f00

Please sign in to comment.