Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Standalone Header or HeaderSpan?

    I was just wondering whether it would be relatively easy to create a widget/Label which is styled like a table Header or HeaderSpan?

    For advanced UI's it would make a great consistent user experience if this was possible.

    Thanks in advance.

    PS: Would be nice if HeaderSpan gains a setAlignment rather than having to guess .setAttribute("align", "left");

    #2
    You can easily just apply the headerspan style to a Label or widget setBaseStyle().

    Comment


      #3
      Thanks for the pointer. I inspected the CSS and came up with this which does pretty well:

      final Label headerLabel = new Label("Translation:");
      headerLabel.setBaseStyle("headerBar");
      headerLabel.setHeight(24);
      headerLabel.setBorder("1px solid #A7ABB4");

      ...except for one thing, the label font is obviously not being set, because it's big and ugly. I feel like I am missing a setContentStyle() but not sure what could do the trick. Any suggestions?

      EDIT:
      Oh well, it feels like a nasty hack but it looks ok if I override the style manually in the content:

      Label headerLabel = new Label("<p style=\"font-family:Arial,Verdana,sans-serif; font-size:11px; color:#333333;\">&nbsp;Translation:</p>");
      Last edited by casper.bang; 17 Jun 2010, 17:03.

      Comment

      Working...
      X