Announcement

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

    IButton.setTitleStyle

    I am trying to customize the Title style for an IButton, but I don't see my style being applied. I expected the CSS style name "stretchTitle" to be applied to the button title text in the example below taken from the showcase.
    Code:
    final IButton stretchButton = new IButton("Stretch Button");  
    stretchButton.setWidth(150);  
    stretchButton.setShowRollOver(true);  
    stretchButton.setShowDisabled(true);  
    stretchButton.setShowDown(true);  
    stretchButton.setTitleStyle("stretchTitle");  
    stretchButton.setIcon("silk/printer.png");
    Inspecting the HTML, I don't see class="stretchTitle" applied for the title text.
    Code:
    <div id="isc_7V" style="display:inline-block;margin-left:-22px;:border-box;max-width:100%;padding-left:22px;vertical-align:middle;overflow:hidden;text-overflow:ellipsis">Stretch Button</div>
    This is consistent with the behaviour I am seeing in my code where I can't seem to customize the Title style using IButton.setTitleStyle("customTitle");

    For something like a ToolStripButton, this is working, specifically, I do see the class="customTitle" and my style is applied.
    Code:
    <td nowrap="true" style="margin:0px;border:0px;padding:0px;background-image:none;background-color:transparent;-webkit-box-shadow:none;box-shadow:none;" class="customTitle">Save</td>
    Am I misunderstanding something here?

    SmartClient Version: v9.1p_2014-04-29/Pro Deployment (built 2014-04-29)

    FF ESR 24.5.0/Chrome 34.0.1847.131

    Thanks
    Last edited by stonebranch2; 6 May 2014, 17:41.

    #2
    I assume it has something to do with the skin, specifically:

    com.smartgwt.client.widgets.IButton

    @FrameworkClass
    @ScClassName(value="IButton")
    The IButton widget class is a class that implements the same APIs as the com.smartgwt.client.widgets.Button class. Depending on the current skin, IButtons may be on the com.smartgwt.client.widgets.StretchImgButton component, which renders via images, or may be based on the com.smartgwt.client.widgets.Button component, which renders via CSS styles.

    I assume one supports the title style, the other does not. Is possible to always support the title style for IButton regardless of the current skin?

    Comment


      #3
      Right, Button does not support a separate titleStyle, sorry. But this simply means that the font information should be included in the style applied to the button as a whole, so it is, if anything, simpler.

      Comment


        #4
        OK, thanks.

        Any chance there is a quick way to change the default font size across the board without having to deal with skinning if all we want is to change the default font from what appears to be 11px to 12px?

        Comment


          #5
          Sure: search and replace :)

          However, more seriously, you have to be a bit selective about this because you may need to tweak a lot of different component sizes to match larger fonts. Many auto-adjust, but for some, there is no reasonable way to auto-adjust.

          Comment


            #6
            Understood. Thx

            Comment

            Working...
            X