The trouble with Skins
Tom Eugelink
tbee at tbee.org
Sat Mar 21 16:48:40 UTC 2015
On 21-3-2015 17:01, John Hendrikx wrote:
> On 14/03/2015 08:31, Tom Eugelink wrote:
>> Hi Tomas,
>>
>> I have looked into it, but not yet attempted, but I did do a lot of custom controls. And I agree that it is dubious that a control is a node, and has the properties that come with it. I try to maintain a strict separation in my controls in JFXtras; controls only have functional methods, the skin and CSS do all the layout. For example the gauge I've ported from Enzo; my version does not have a setFillColor() like the one in Enzo, that is something that the user needs to do through CSS.
>>
>> That said, if a control were only a model, than it would not be a control, right? We would create model-skins, so there is something that differentiates a control from a model. To me that is an abstraction of the skin. For example: not knowning HOW it is rendered, a textbox does know that it can receive the focus, it is implicit to what it is. So there is a certain logic for allowing controls to have rudimentary rendering info, as long as it does not expose the actual layout details.
>>
>> Looking at ListView, there is a logic in that a list can scroll, so onScroll on the control makes sense. Whether that scrolling is done via a scrollbar or buttons is a skin detail that should not leak out. So the fact that ListView does not have a scroll position makes sense to me.
>
> As someone that has been tempted to write a new Control that replaces ListView atleast half a dozen times now because of restrictions or idioms that don't match my needs, I'd disagree. A ListView doesn't need to scroll at all. An application that isn't mouse or touchscreen controlled (keyboard or remote controlled for example) has zero need for scrollbars except maybe as information to show the relative size of the view.
>
> A List of items could be paged only, or they could flip. I'd like to be able to take a List, and wrap it in a ScrollBarView... or in a PagerView, FlipOverView or CoverFlowView (with 30 new properties to set things like reflections, 3d parameters, distance between items, etc). It is possible to do this with Skins, but it feels like a hack rather than simply a different Look&Feel in the end.
>
> After all, a ListView is a container for an unbounded list of items. I can think of half a dozen ways of how that can be shown to the user, and the current ListView is just one way to do it. The promise of Skins here is that I could just change the look & feel, but unfortunately way too many details of the "default" look & feel leak through in the Control itself.
Maybe it is the definition of "scroll", because I don't think we have the same concept. For me scrolling means: moving certain items out of view and other into view. Now, that can be done by scrollbar and mouse, or touch and scrollbar, or by clicking on buttons or flip over a page. Basically a book does the same than a paper scroll; only in steps instead of fluent. So to me all these are just specific renderings of the scroll concept. One maybe could also have called it "onPaging".
So yes, you are right, and I still think it is scrolling.
Tom
More information about the openjfx-dev
mailing list