Rose
Rose

Reputation: 2872

Corner radius applied only to specific corners

I've this tabs that I wanted to make rounded only on top-right and top-left corners. But it ended up rounding all 4 corners.

What I did:

<mx:TabNavigator id="myTabNav" x="58" y="61" width="584"  height="200" creationComplete="setColors(event)" styleName="myTabStyle">
  <pages:One  label="ThisOne" id="one"  name="One"/>
  <pages:Two label="Twoooooooooooh" id="two"  width="584" name="two" />
  <pages:Three label="Threeeeeeeeh" id="three"  width="583" name="three" />
</mx:TabNavigator>

and

my pageStyles.css file is:

.myTabStyle {
 tabStyleName: "myTabs"; 

 corner-radius:15;
}

.myTabs {
 backgroundColor: #FF0080;
 corner-radius:10;
 focusRoundedCorners: "tl tr";
 skin:ClassReference('mx.skins.spark.ButtonSkin'); 
 chromeColor: #FF0080;  /* this is the tab widget itself, not the content */
 border-style:outset;
}

As you can see I have the "focusRoundedCorners" to point to top-right and top-left but no luck. What I got is:

What am I doing wrong guys??

Thanks in advance.

Upvotes: 1

Views: 1895

Answers (2)

Remy Mellet
Remy Mellet

Reputation: 1795

So here is the solution.

You can write you own button skin or use the one here http://www.wabysabi.com/flex/enhancedbuttonskin/ named EnhancedButtonSkin.as (right-click, View-Source). Then declare your TabNavigator component and specify its tabStyleName.

<mx:TabNavigator y="0" height="100%" right="0" left="0" id="navigator" tabStyleName="tab">

And now the css:

 <fx:Style>
  .tab
  {
   upSkin:ClassReference('com.EnhancedButtonSkin');
   overSkin:ClassReference('com.EnhancedButtonSkin');
   downSkin:ClassReference('com.EnhancedButtonSkin');
   disabledSkin:ClassReference('com.EnhancedButtonSkin');
   selectedUpSkin:ClassReference('com.EnhancedButtonSkin');
   selectedOverSkin:ClassReference('com.EnhancedButtonSkin');
   selectedDownSkin:ClassReference('com.EnhancedButtonSkin');
   selectedDisabledSkin:ClassReference('com.EnhancedButtonSkin');

   cornerRadii: 5, 5, 0, 0;
   borderColors: #CC0000, #000000;
   overBorderColors: #003399, #003399;
   selectedBorderColors: #666666, #FFFFFF;
   borderThickness: 1;
   borderAlpha: 1;
   fillColors: #CC3300, #F98900;
   fillAlphas: 1, 1;
   fillColorRatios: 0, 255;
   overFillColors: #999999, #FFFFFF;
   overFillAlphas: 1, 1;
   overFillColorRatios: 0, 255;
   selectedFillColors: #999999, #FFFFFF;
   selectedFillAlphas: 1, 1;
   selectedFillColorRatios: 111, 255;
   highlightAlphas: 0, 0;
   color: #000000;
   textRollOverColor: #000000;
   fontSize: 13;
  }
 </fx:Style>

This css will display:

Upvotes: 0

Gabriele Petrioli
Gabriele Petrioli

Reputation: 195952

Have a look at this tool http://www.wabysabi.com/flex/enhancedbuttonskin/

I would guess that the focus part of the focusRoundedCorners refers to how it should be when it has focus only..

Upvotes: 1

Related Questions