1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    75
    Vote Rating
    0
    anton_ds is on a distinguished road

      0  

    Default Unanswered: ButtonBar background

    Unanswered: ButtonBar background


    Hello all,

    Does anyone know how to change button bar background color?

  2. #2
    Sencha User
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    Answers
    2
    nmb1106 is on a distinguished road

      0  

    Default


    You can do it a few different ways but the recommended approach from the GXT Appearance Design article is that you should extend ButtonBarAppearance.

    I often use the client bundle styling approach for restyling basic components:

    Code:
    public class MyView extends ContentPanel{
    
        private DesktopButtonbarStyle style;
        private ButtonBar buttonBar;
    
        interface DesktopButtonbarStyle extends CssResource {
            String buttonBarStyle();
        }
    
        interface StyleResources extends ClientBundle {
            @Source("DesktopButtonbar.css")
            DesktopButtonbarStyle css();
        }
    
        public MyView () {
            super();
            final StyleResources resources = GWT.create(StyleResources.class);
            resources.css().ensureInjected();
            style = resources.css();
            buildButtonBar();
            this.add(toolBar);
        }
    
        public void buildButtonBar() {
            buttonBar= new ButtonBar();
            buttonBar.setStylePrimaryName(style.buttonBarStyle());
       }
    
    }

Thread Participants: 1