You're right, there is no notification to stack-header widgets of their
selection state. I'll make a note to add a standard way for them to be
notified of this.

As for standard CSS, with the current design (i.e., your own widget is the
only header element), there's nothing to add a default style to. Perhaps we
can find a way to add a default "wrapper" element to each stack header, but
such that the header widget still fills the space.

On Mon, Jan 4, 2010 at 11:06 AM, dflorey <[email protected]> wrote:

> Correct me if I'm wrong but I found it quite hard to apply a
> "selected" style to the selected stack panel header.
> I came up with a workaround like this:
>
> StackLayoutPanel danielStackPanel = new StackLayoutPanel
> (Style.Unit.PX) {
> @Override
>        public void showWidget(Widget widget) {
>        // Find associated header (map<widget,header>) and apply "selected"
> style to header
>        // Remove "selected" style from all other header widgets
>        }
> }
> But for some reason that I don't remember (I tried that out
> yesterday...) it did not work. I guess the style order was interfering
> somehow...
>
> I really would prefer if some of the useful styles would be set by
> default.
>
> On Jan 4, 4:47 pm, Joel Webber <[email protected]> wrote:
> > Coming up with a general structure for stack header widgets (a la
> > TabLayoutPanel tabs), such that you could achieve whatever style you
> like,
> > proved very difficult in practice. I basically punted and just allowed
> you
> > to add an arbitrary widget, which you can style however you like.
> >
> > I'm quite open to alternative structures that work more like tabs. The
> > problem I ran into is that you typically want a stack header to extend
> > vertically to cover the entire space between stacks. The layout system
> does
> > this automatically, but it is rather difficult to place the "content" of
> a
> > header wherever you want it.
> >
> >
> >
> > On Sun, Jan 3, 2010 at 1:41 PM, dflorey <[email protected]> wrote:
> > > Maybe I'm dumb but I do not find any styles associated with the new
> > > StackLayoutPanel...
> > > And no methods to add click listeners etc.
> > > I'd expect the same styles as on StackPanel:
> >
> > > CSS Style Rules
> >
> > > .gwt-StackPanel { the panel itself }
> > > .gwt-StackPanel .gwt-StackPanelItem { unselected items }
> > > .gwt-StackPanel .gwt-StackPanelItem-selected { selected items }
> > > .gwt-StackPanel .gwt-StackPanelContent { the wrapper around the
> > > contents of the item }
> >
> > > I tried to set the primary name but no effect.
> >
> > > Any ideas?
> >
> > > --
> > >http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to