Closed tinchodias closed 1 year ago
thanks again. is it possible to have the 2 scrollbars (H and V) on the same element ? InfiniteElement ?
Hi, in infinite element I didn't check, but in a regular element yes, this is my example:
largeElement := OBlElement new
size: 1000 asPoint;
background: (BlRadialGradientPaint new
stops: { 0 -> Color blue . 1 -> Color red};
center: 500 asPoint;
radius: 500;
yourself);
yourself.
scrollableElement := largeElement asScrollableElement.
hBar :=
OBlHorizontalScrollbarElement new
constraintsDo: [ :c |
c ignoreByLayout.
c ignored vertical alignBottom ];
attachTo: scrollableElement;
yourself.
vBar :=
OBlVerticalScrollbarElement new
constraintsDo: [ :c |
c ignoreByLayout.
c ignored horizontal alignRight ];
attachTo: scrollableElement;
yourself.
scrollPane :=
BlElement new
addChild: scrollableElement;
addChild: vBar;
addChild: hBar;
constraintsDo: [ :c |
c horizontal matchParent.
c vertical matchParent ];
yourself.
space := OBlSpace new.
space root
layout: BlLinearLayout new;
padding: (BlInsets all: 10);
background: Color blue muchDarker;
addChild: scrollPane.
space
extent: 500@500;
show
in an infinite it works differently, scrolling is managed by the layout by updating the infinite children. In the case of a vertical infinite layout, the horizontal scrolling should work as in your example. In the case of horizontal infinite layout, the vertical scrolling should work as in your example.
@plantec The album editor has an infinite layout, or am I wrong? Do you have a snippet, to be sure? Thanks in advance
This PR requires changes in other repos:
scrollbars
branch in https://github.com/plantec/onblocscrollbars
branch in https://github.com/pharo-graphics/BlocCommit comments have information