本文整理汇总了C++中TabBarButton::isColourSpecified方法的典型用法代码示例。如果您正苦于以下问题:C++ TabBarButton::isColourSpecified方法的具体用法?C++ TabBarButton::isColourSpecified怎么用?C++ TabBarButton::isColourSpecified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabBarButton
的用法示例。
在下文中一共展示了TabBarButton::isColourSpecified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawTabButtonText
void CtrlrTabsLF::drawTabButtonText (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
{
const Rectangle<float> area (button.getTextArea().toFloat());
float length = area.getWidth();
float depth = area.getHeight();
if (button.getTabbedButtonBar().isVertical())
std::swap (length, depth);
Font otherTabFont = owner.getOwner().getOwner().getOwner().getFontManager().getFontFromString (owner.getProperty(Ids::uiTabsTabFont));
Font activeTabFont = owner.getOwner().getOwner().getOwner().getFontManager().getFontFromString (owner.getProperty(Ids::uiTabsFrontTabFont));
otherTabFont.setUnderline (button.hasKeyboardFocus (false));
activeTabFont.setUnderline (button.hasKeyboardFocus (false));
GlyphArrangement textLayout;
textLayout.addFittedText (button.isFrontTab() ? activeTabFont : otherTabFont, button.getButtonText().trim(),
0.0f, 0.0f, (float) length, (float) depth,
Justification::centred,
jmax<int> (1, depth / 12));
AffineTransform t;
switch (button.getTabbedButtonBar().getOrientation())
{
case TabbedButtonBar::TabsAtLeft:
t = t.rotated (float_Pi * -0.5f).translated (area.getX(), area.getBottom());
break;
case TabbedButtonBar::TabsAtRight:
t = t.rotated (float_Pi * 0.5f).translated (area.getRight(), area.getY());
break;
case TabbedButtonBar::TabsAtTop:
case TabbedButtonBar::TabsAtBottom:
t = t.translated (area.getX(), area.getY());
break;
default:
jassertfalse;
break;
}
Colour col;
if (button.isFrontTab() && (button.isColourSpecified (TabbedButtonBar::frontTextColourId)
|| isColourSpecified (TabbedButtonBar::frontTextColourId)))
col = findColour (TabbedButtonBar::frontTextColourId);
else if (button.isColourSpecified (TabbedButtonBar::tabTextColourId)
|| isColourSpecified (TabbedButtonBar::tabTextColourId))
col = findColour (TabbedButtonBar::tabTextColourId);
else
col = button.getTabBackgroundColour().contrasting();
const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
g.setColour (col.withMultipliedAlpha (alpha));
textLayout.draw (g, t);
}