[Pharo-project] Pressed Morph feedback on PharoTheme
I tried to add some feedback when manipulating scrollbars and buttons in the default Pharo Theme. Adding the following four methods to PharoTheme gives a reversed look when clicking on a scrollbar or a button : PharoTheme>>buttonPressedFillStyleFor: aButton "Return the pressed button fillStyle for the given button." (aButton valueOfProperty: #noFill ifAbsent: [false]) ifTrue: [^ SolidFillStyle color: Color transparent ]. ^ self glamorousReverseFillStyleFor: aButton height: aButton height PharoTheme>>glamorousReverseFillStyleFor: aMorph height: anInteger "Return the reversed button fillStyle for the given button." | baseColor | baseColor := self glamorousBaseColorFor: aMorph. ^ self glamorousReverseFillStyleWithBaseColor: baseColor for: aMorph height: anInteger PharoTheme>>glamorousReverseFillStyleWithBaseColor: aColor for: aMorph height: anInteger | top bottom | top := aColor twiceLighter. bottom := aColor. ^(GradientFillStyle ramp: { 0.0->bottom. 0.7->top.}) origin: aMorph bounds origin; direction: 0 @ anInteger; radial: false PharoTheme>>scrollbarPressedThumbFillStyleFor: aScrollbar "Return the pressed scrollbar fillStyle for the given scrollbar." ^ (self glamorousReverseFillStyleWithBaseColor: aScrollbar paneColor for: aScrollbar height: aScrollbar height) direction: (aScrollbar bounds isWide ifTrue: [0 @ aScrollbar height] ifFalse: [aScrollbar width @ 0]) It makes the default interaction a lot more reactive (i.e. you notice on screen when you are pressing on a button). Side note about UI changes in Nautilus: will there be any changes about the Groups/Hierarchy/Class/Comments buttons ? I have a hard time getting used to them (lack of selection/state clues, unusual behavior for buttons). Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
It makes the default interaction a lot more reactive (i.e. you notice on screen when you are pressing on a button).
Now with your change I do not understand why and when a button is becoming blue.
Side note about UI changes in Nautilus: will there be any changes about the Groups/Hierarchy/Class/Comments buttons ? I have a hard time getting used to them (lack of selection/state clues, unusual behavior for buttons).
Yes we all are saying that this is not working since we do not know if the state we are in. Stef
Le 23/05/2012 17:31, Stéphane Ducasse a écrit :
It makes the default interaction a lot more reactive (i.e. you notice
on screen when you are pressing on a button).
Now with your change I do not understand why and when a button is becoming blue.
I think this is when the button has a true state, as used by the getStateSelector of the morph. This is visible in the Hierarchy/Flat button in Nautilus, where Hierarchy is state == false, and Flat is state == true (and has the blue color). In the case state true, PharoTheme may be falling back on the colors of the WateryTheme. Another bug shown with my change is, if you start to scroll with the slider, it depresses correctly, but, as soon as you move outside the bounds of the scrollbar, even while pressing the left mouse button, then the slider goes back to the "not pressed" state while you are still scrolling up or down.
Side note about UI changes in Nautilus: will there be any changes about the Groups/Hierarchy/Class/Comments buttons ? I have a hard time getting used to them (lack of selection/state clues, unusual behavior for buttons).
Yes we all are saying that this is not working since we do not know if the state we are in.
Change with "toggle" buttons instead ? Playing with the Nautilus GUI, more interesting behavior(s) : * Select an empty package (_UnpackagedPackage) * Hierarchy button becomes disabled but * Instance / Class button is still enabled * Comment button is still enabled Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Le 24/05/2012 09:19, Goubier Thierry a écrit :
Another bug shown with my change is, if you start to scroll with the slider, it depresses correctly, but, as soon as you move outside the bounds of the scrollbar, even while pressing the left mouse button, then the slider goes back to the "not pressed" state while you are still scrolling up or down.
To correct that bug, a small change in ScrollBar>>mouseLeaveThumb: event redButtonPressed ifFalse: [ slider fillStyle: self normalThumbFillStyle; borderStyle: self normalThumbBorderStyle; changed ]. (self containsPoint: event position) ifTrue: [ upButton fillStyle: self mouseOverPagingAreaButtonFillStyle; borderStyle: self mouseOverPagingAreaButtonBorderStyle ] ifFalse: [ upButton fillStyle: self normalButtonFillStyle; borderStyle: self normalButtonBorderStyle ]. (self containsPoint: event position) ifTrue: [ downButton fillStyle: self mouseOverPagingAreaButtonFillStyle; borderStyle: self mouseOverPagingAreaButtonBorderStyle ] ifFalse: [ downButton fillStyle: self normalButtonFillStyle; borderStyle: self normalButtonBorderStyle ] Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Thierry Can you produce a change set with your change like that we can try? And open a bug entry. I'm a bit confused Stef
Le 24/05/2012 09:19, Goubier Thierry a écrit :
Another bug shown with my change is, if you start to scroll with the slider, it depresses correctly, but, as soon as you move outside the bounds of the scrollbar, even while pressing the left mouse button, then the slider goes back to the "not pressed" state while you are still scrolling up or down.
To correct that bug, a small change in ScrollBar>>mouseLeaveThumb:
event redButtonPressed ifFalse: [ slider fillStyle: self normalThumbFillStyle; borderStyle: self normalThumbBorderStyle; changed ]. (self containsPoint: event position) ifTrue: [ upButton fillStyle: self mouseOverPagingAreaButtonFillStyle; borderStyle: self mouseOverPagingAreaButtonBorderStyle ] ifFalse: [ upButton fillStyle: self normalButtonFillStyle; borderStyle: self normalButtonBorderStyle ]. (self containsPoint: event position) ifTrue: [ downButton fillStyle: self mouseOverPagingAreaButtonFillStyle; borderStyle: self mouseOverPagingAreaButtonBorderStyle ] ifFalse: [ downButton fillStyle: self normalButtonFillStyle; borderStyle: self normalButtonBorderStyle ]
Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Le 25/05/2012 12:36, Stéphane Ducasse a écrit :
Thierry
Can you produce a change set with your change like that we can try? And open a bug entry.
I'm a bit confused Stef
Here is the change set. Strange not to find this functionality associated with the package in the Monticello browser. Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Le 29/05/2012 12:46, Goubier Thierry a écrit :
Le 25/05/2012 12:36, Stéphane Ducasse a écrit :
Thierry
Can you produce a change set with your change like that we can try? And open a bug entry.
I'm a bit confused Stef
Here is the change set. Strange not to find this functionality associated with the package in the Monticello browser.
Thierry
And the issue is 5993 : http://code.google.com/p/pharo/issues/detail?id=5993 Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Goubier Thierry wrote
And the issue is 5993 : http://code.google.com/p/pharo/issues/detail?id=5993
It seems to work well. I couldn't resist a small refactor in the other part of the method (from the original)... Fix in inbox: SLICE-Issue-5993-Change-in-Scrollbar-behavior-SeanDeNigris.1 Fix to make a scrollbar thumb keep a "pressed" status as long as the left mouse button is pressed, even if the mouse pointer leaves the scrollbar area. To test with a theme where the "pressed" status of morph buttons is visible (e.g. Vistary). Sean p.s. in the same spirit, the scroll bar buttons should appear reactivated when the mouse re-enters the bar with the button down; but that is another issue... -- View this message in context: http://forum.world.st/Pressed-Morph-feedback-on-PharoTheme-tp4631515p4632296... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Le 29/05/2012 15:54, Sean P. DeNigris a écrit :
p.s. in the same spirit, the scroll bar buttons should appear reactivated when the mouse re-enters the bar with the button down; but that is another issue...
Oh, thanks for pointing that out. The scrollbar buttons should stay pressed when the mouse leaves the area, since they stay active and keep scrolling the pane. The fix is the same as the thumb. Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Thanks for the feedback because I had problem to figure out :) BTW thierry it would be good that you sign the license agreement for the code like that we continue to control the license of our code base (see the how to contribute on the web site). You can scan it and send it to me if you want. Stef On May 29, 2012, at 3:54 PM, Sean P. DeNigris wrote:
Goubier Thierry wrote
And the issue is 5993 : http://code.google.com/p/pharo/issues/detail?id=5993
It seems to work well. I couldn't resist a small refactor in the other part of the method (from the original)...
Fix in inbox: SLICE-Issue-5993-Change-in-Scrollbar-behavior-SeanDeNigris.1
Fix to make a scrollbar thumb keep a "pressed" status as long as the left mouse button is pressed, even if the mouse pointer leaves the scrollbar area. To test with a theme where the "pressed" status of morph buttons is visible (e.g. Vistary).
Sean
p.s. in the same spirit, the scroll bar buttons should appear reactivated when the mouse re-enters the bar with the button down; but that is another issue...
-- View this message in context: http://forum.world.st/Pressed-Morph-feedback-on-PharoTheme-tp4631515p4632296... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (3)
-
Goubier Thierry -
Sean P. DeNigris -
Stéphane Ducasse