|
|
|
@ -121,9 +121,9 @@ void KMultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clip
|
|
|
|
|
if (m_position==KMultiTabBar::Right)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,0,viewport()->height());
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(1,0,1,viewport()->height());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -131,28 +131,28 @@ void KMultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clip
|
|
|
|
|
else
|
|
|
|
|
if (m_position==KMultiTabBar::Left)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().light());
|
|
|
|
|
paint->setPen(colorGroup().light());
|
|
|
|
|
paint->drawLine(23,0,23,viewport()->height());
|
|
|
|
|
paint->drawLine(22,0,22,viewport()->height());
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,0,viewport()->height());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (m_position==KMultiTabBar::Bottom)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,viewport()->width(),0);
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(0,1,viewport()->width(),1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().light());
|
|
|
|
|
paint->setPen(colorGroup().light());
|
|
|
|
|
paint->drawLine(0,23,viewport()->width(),23);
|
|
|
|
|
paint->drawLine(0,22,viewport()->width(),22);
|
|
|
|
|
|
|
|
|
|
/* paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
/* paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,0,viewport()->height());*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -458,7 +458,7 @@ void KMultiTabBarButton::showEvent( TQShowEvent* he) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQSize KMultiTabBarButton::tqsizeHint() const
|
|
|
|
|
TQSize KMultiTabBarButton::sizeHint() const
|
|
|
|
|
{
|
|
|
|
|
constPolish();
|
|
|
|
|
|
|
|
|
@ -474,7 +474,7 @@ TQSize KMultiTabBarButton::tqsizeHint() const
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if ( isMenuButton() )
|
|
|
|
|
w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this);
|
|
|
|
|
w += tqstyle().pixelMetric(TQStyle::PM_MenuButtonIndicator, this);
|
|
|
|
|
|
|
|
|
|
if ( pixmap() ) {
|
|
|
|
|
TQPixmap *pm = (TQPixmap *)pixmap();
|
|
|
|
@ -484,7 +484,7 @@ TQSize KMultiTabBarButton::tqsizeHint() const
|
|
|
|
|
TQString s( text() );
|
|
|
|
|
bool empty = s.isEmpty();
|
|
|
|
|
if ( empty )
|
|
|
|
|
s = TQString::tqfromLatin1("XXXX");
|
|
|
|
|
s = TQString::fromLatin1("XXXX");
|
|
|
|
|
TQFontMetrics fm = fontMetrics();
|
|
|
|
|
TQSize sz = fm.size( ShowPrefix, s );
|
|
|
|
|
if(!empty || !w)
|
|
|
|
@ -581,12 +581,12 @@ void KMultiTabBarTab::updateState()
|
|
|
|
|
if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left)) {
|
|
|
|
|
setFixedWidth(24);
|
|
|
|
|
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (down)) {
|
|
|
|
|
setFixedHeight(KMultiTabBarButton::tqsizeHint().width());
|
|
|
|
|
setFixedHeight(KMultiTabBarButton::sizeHint().width());
|
|
|
|
|
} else setFixedHeight(36);
|
|
|
|
|
} else {
|
|
|
|
|
setFixedHeight(24);
|
|
|
|
|
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (down)) {
|
|
|
|
|
setFixedWidth(KMultiTabBarButton::tqsizeHint().width());
|
|
|
|
|
setFixedWidth(KMultiTabBarButton::sizeHint().width());
|
|
|
|
|
} else setFixedWidth(36);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -637,7 +637,7 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) {
|
|
|
|
|
const int height = 24;
|
|
|
|
|
if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (down)) {
|
|
|
|
|
if ((m_position==KMultiTabBar::Left) || (m_position==KMultiTabBar::Right))
|
|
|
|
|
sh=TQSize(this->height(),this->width());//KMultiTabBarButton::tqsizeHint();
|
|
|
|
|
sh=TQSize(this->height(),this->width());//KMultiTabBarButton::sizeHint();
|
|
|
|
|
else sh=TQSize(this->width(),this->height());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -654,8 +654,8 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) {
|
|
|
|
|
|
|
|
|
|
if (down) st|=TQStyle::Style_On;
|
|
|
|
|
|
|
|
|
|
tqstyle().tqdrawControl(TQStyle::CE_PushButton,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), tqcolorGroup(),st);
|
|
|
|
|
tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), tqcolorGroup(),st);
|
|
|
|
|
tqstyle().drawControl(TQStyle::CE_PushButton,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
|
|
|
|
|
tqstyle().drawControl(TQStyle::CE_PushButtonLabel,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st);
|
|
|
|
|
|
|
|
|
|
switch (m_position) {
|
|
|
|
|
case KMultiTabBar::Left:
|
|
|
|
@ -671,8 +671,8 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) {
|
|
|
|
|
paint->drawPixmap(0,0,pixmap);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()),
|
|
|
|
|
// tqcolorGroup(),TQStyle::Style_Enabled);
|
|
|
|
|
// tqstyle().drawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()),
|
|
|
|
|
// colorGroup(),TQStyle::Style_Enabled);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -682,58 +682,58 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
TQPixmap pixmap;
|
|
|
|
|
if ( iconSet())
|
|
|
|
|
pixmap = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal );
|
|
|
|
|
paint->fillRect(0, 0, 24, 24, tqcolorGroup().background());
|
|
|
|
|
paint->fillRect(0, 0, 24, 24, colorGroup().background());
|
|
|
|
|
|
|
|
|
|
if (!down)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (m_position==KMultiTabBar::Right)
|
|
|
|
|
{
|
|
|
|
|
paint->fillRect(0,0,21,21,TQBrush(tqcolorGroup().background()));
|
|
|
|
|
paint->fillRect(0,0,21,21,TQBrush(colorGroup().background()));
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(150));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(150));
|
|
|
|
|
paint->drawLine(0,22,23,22);
|
|
|
|
|
|
|
|
|
|
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,0,23);
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(1,0,1,23);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top))
|
|
|
|
|
{
|
|
|
|
|
paint->fillRect(0,1,23,22,TQBrush(tqcolorGroup().background()));
|
|
|
|
|
paint->fillRect(0,1,23,22,TQBrush(colorGroup().background()));
|
|
|
|
|
|
|
|
|
|
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(23,0,23,23);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().light());
|
|
|
|
|
paint->setPen(colorGroup().light());
|
|
|
|
|
paint->drawLine(0,22,23,22);
|
|
|
|
|
paint->drawLine(0,23,23,23);
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,23,0);
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(0,1,23,1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().background().dark(120));
|
|
|
|
|
paint->setPen(colorGroup().background().dark(120));
|
|
|
|
|
paint->drawLine(0,23,23,23);
|
|
|
|
|
paint->fillRect(0,0,23,21,TQBrush(tqcolorGroup().background()));
|
|
|
|
|
paint->fillRect(0,0,23,21,TQBrush(colorGroup().background()));
|
|
|
|
|
paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap);
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().light());
|
|
|
|
|
paint->setPen(colorGroup().light());
|
|
|
|
|
paint->drawLine(23,0,23,23);
|
|
|
|
|
paint->drawLine(22,0,22,23);
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,0,0,23);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -744,12 +744,12 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
{
|
|
|
|
|
if (m_position==KMultiTabBar::Right)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,height()-1,23,height()-1);
|
|
|
|
|
paint->drawLine(0,height()-2,23,height()-2);
|
|
|
|
|
paint->drawLine(23,0,23,height()-1);
|
|
|
|
|
paint->drawLine(22,0,22,height()-1);
|
|
|
|
|
paint->fillRect(0,0,21,height()-3,TQBrush(tqcolorGroup().light()));
|
|
|
|
|
paint->fillRect(0,0,21,height()-3,TQBrush(colorGroup().light()));
|
|
|
|
|
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
|
|
|
|
|
|
|
|
|
if (m_showActiveTabText)
|
|
|
|
@ -759,9 +759,9 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
TQPixmap tpixmap(height()-25-3, width()-2);
|
|
|
|
|
TQPainter painter(&tpixmap);
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(tqcolorGroup().light()));
|
|
|
|
|
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(colorGroup().light()));
|
|
|
|
|
|
|
|
|
|
painter.setPen(tqcolorGroup().text());
|
|
|
|
|
painter.setPen(colorGroup().text());
|
|
|
|
|
painter.drawText(0,+width()/2+TQFontMetrics(TQFont()).height()/2,m_text);
|
|
|
|
|
|
|
|
|
|
paint->rotate(90);
|
|
|
|
@ -773,25 +773,25 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
else
|
|
|
|
|
if (m_position==KMultiTabBar::Top)
|
|
|
|
|
{
|
|
|
|
|
paint->fillRect(0,0,width()-1,23,TQBrush(tqcolorGroup().light()));
|
|
|
|
|
paint->fillRect(0,0,width()-1,23,TQBrush(colorGroup().light()));
|
|
|
|
|
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
|
|
|
|
if (m_showActiveTabText)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().text());
|
|
|
|
|
paint->setPen(colorGroup().text());
|
|
|
|
|
paint->drawText(25,height()/2+TQFontMetrics(TQFont()).height()/2,m_text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (m_position==KMultiTabBar::Bottom)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,23,width()-1,23);
|
|
|
|
|
paint->drawLine(0,22,width()-1,22);
|
|
|
|
|
paint->fillRect(0,0,width()-1,21,TQBrush(tqcolorGroup().light()));
|
|
|
|
|
paint->fillRect(0,0,width()-1,21,TQBrush(colorGroup().light()));
|
|
|
|
|
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
|
|
|
|
if (m_showActiveTabText)
|
|
|
|
|
{
|
|
|
|
|
paint->setPen(tqcolorGroup().text());
|
|
|
|
|
paint->setPen(colorGroup().text());
|
|
|
|
|
paint->drawText(25,height()/2+TQFontMetrics(TQFont()).height()/2,m_text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -800,10 +800,10 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paint->setPen(tqcolorGroup().shadow());
|
|
|
|
|
paint->setPen(colorGroup().shadow());
|
|
|
|
|
paint->drawLine(0,height()-1,23,height()-1);
|
|
|
|
|
paint->drawLine(0,height()-2,23,height()-2);
|
|
|
|
|
paint->fillRect(0,0,23,height()-3,TQBrush(tqcolorGroup().light()));
|
|
|
|
|
paint->fillRect(0,0,23,height()-3,TQBrush(colorGroup().light()));
|
|
|
|
|
paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap);
|
|
|
|
|
if (m_showActiveTabText)
|
|
|
|
|
{
|
|
|
|
@ -813,9 +813,9 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint)
|
|
|
|
|
TQPixmap tpixmap(height()-25-3, width()-2);
|
|
|
|
|
TQPainter painter(&tpixmap);
|
|
|
|
|
|
|
|
|
|
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(tqcolorGroup().light()));
|
|
|
|
|
painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(colorGroup().light()));
|
|
|
|
|
|
|
|
|
|
painter.setPen(tqcolorGroup().text());
|
|
|
|
|
painter.setPen(colorGroup().text());
|
|
|
|
|
painter.drawText(tpixmap.width()-TQFontMetrics(TQFont()).width(m_text),+width()/2+TQFontMetrics(TQFont()).height()/2,m_text);
|
|
|
|
|
|
|
|
|
|
paint->rotate(-90);
|
|
|
|
@ -842,13 +842,13 @@ KMultiTabBar::KMultiTabBar(KMultiTabBarMode bm, TQWidget *parent,const char *nam
|
|
|
|
|
if (bm==Vertical)
|
|
|
|
|
{
|
|
|
|
|
m_l=new TQVBoxLayout(this);
|
|
|
|
|
tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding, true);
|
|
|
|
|
setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding, true);
|
|
|
|
|
// setFixedWidth(24);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_l=new TQHBoxLayout(this);
|
|
|
|
|
tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, true);
|
|
|
|
|
setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, true);
|
|
|
|
|
// setFixedHeight(24);
|
|
|
|
|
}
|
|
|
|
|
m_l->setMargin(0);
|
|
|
|
|