Spec icon indicating copy to clipboard operation
Spec copied to clipboard

[BUG] - SpNumberInputFieldPresenter cannot be resize properly

Open Nyan11 opened this issue 2 years ago • 3 comments

Hello, I'm not sure if it's a bug or if it has been reported.

Description

I'm trying to build an application that use SpNumberInputFieldPresenter inside SpPanedLayout. The SpNumberInputFieldPresenter doesn't display well inside the SpPanedLayout. Also the display bug when i resize the window.

I think the SpNumberInputFieldPresenter cannot shrink.

Example 1 (bug : SpNumberInputFieldPresenter + SpPanedLayout)

number1

Here i drag the SpPanedLayout. The SpNumberInputFieldPresenter can grow but never shrink. (The button 'helloworld' disapear).

Example 2 (bug : SpNumberInputFieldPresenter + resize window)

number1b

Here i resize the window. The SpNumberInputFieldPresenter can grow but never shrink. (The button 'helloworld' disappear).

Example 3 (no bug : SpTextInputFieldPresenter)

number2

I do the same thing but this time using a SpTextInputFieldPresenter. The button never disappear.

Reproduction

code to reproduce:

"Example 1"

spItem := SpButtonPresenter new label: 'hello world'; yourself.
spNumber := SpNumberInputFieldPresenter new.

layoutLeft := SpBoxLayout newLeftToRight add: spNumber; add: spItem; yourself.
spLeft := SpPresenter new.
spLeft layout: layoutLeft.

layoutMain := SpPanedLayout newLeftToRight first: spLeft; second: SpNullPresenter new; yourself.
spMain := SpPresenter new.
spMain layout: layoutMain.
spMain open.
"Example 2"

spItem := SpButtonPresenter new label: 'hello world'; yourself.
spNumber := SpNumberInputFieldPresenter new.

layoutLeft := SpBoxLayout newLeftToRight add: spNumber; add: spItem; yourself.
spLeft := SpPresenter new.
spLeft layout: layoutLeft.
spLeft open.
"Example 3 - first"

spItem := SpButtonPresenter new label: 'hello world'; yourself.
spText := SpTextInputFieldPresenter new.

layoutLeft := SpBoxLayout newLeftToRight add: spText; add: spItem; yourself.
spLeft := SpPresenter new.
spLeft layout: layoutLeft.
spLeft open.
"Example 3 - second"

spItem := SpButtonPresenter new label: 'hello world'; yourself.
spText := SpTextInputFieldPresenter new.

layoutLeft := SpBoxLayout newLeftToRight add: spText ; add: spItem; yourself.
spLeft := SpPresenter new.
spLeft layout: layoutLeft.

layoutMain := SpPanedLayout newLeftToRight first: spLeft; second: SpNullPresenter new; yourself.
spMain := SpPresenter new.
spMain layout: layoutMain.
spMain open.

expected result:

The SpNumberInputFieldPresenter should have the same comportement has SpTextInputFieldPresenter.

Other

pharo image : Pharo-11.0.0+build.346.sha.b6ce4527b4f4881d6c6b4f968f1d1348b783b7a2 (64 Bit) spec: [e496266] 2023-02-08. I also tested it on the spec version that come with the base Image.

Nyan11 avatar Feb 17 '23 09:02 Nyan11