summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index e9e17f7..02124d2 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -243,97 +243,97 @@ void CategoryTabWidget::updateLink(const QString& linkfile)
{
int i=0;
LauncherView* view;
while ((view = (LauncherView*)stack->widget(i++))) {
if ( view->removeLink(linkfile) )
break;
}
addItem(linkfile);
docview->updateTools();
}
void CategoryTabWidget::paletteChange( const QPalette &p )
{
QVBox::paletteChange( p );
QPalette pal = palette();
pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
categoryBar->setPalette( pal );
categoryBar->update();
}
void CategoryTabWidget::setBusy(bool on)
{
if ( on )
((LauncherView*)stack->visibleWidget())->setBusy(TRUE);
else
for (int i=0; i<tabs; i++)
((LauncherView*)stack->widget(i))->setBusy(FALSE);
}
CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name )
: QTabBar( parent, name )
{
setFocusPolicy( NoFocus );
connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) );
}
CategoryTabBar::~CategoryTabBar()
{
}
void CategoryTabBar::layoutTabs()
{
if ( !count() )
return;
// int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 };
- int hiddenTabWidth = -12;
+ int hiddenTabWidth = -7;
int middleTab = currentTab();
int hframe, vframe, overlap;
style().tabbarMetrics( this, hframe, vframe, overlap );
QFontMetrics fm = fontMetrics();
int x = 0;
QRect r;
QTab *t;
int available = width()-1;
int required = 0;
for ( int i = 0; i < count(); i++ ) {
t = tab(i);
// if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) {
if ( i != middleTab ) {
// required += hiddenTabWidth + hframe - overlap;
available -= hiddenTabWidth + hframe - overlap;
if ( t->iconSet() != 0 )
available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
} else {
required += fm.width( t->text() ) + hframe - overlap;
if ( t->iconSet() != 0 )
required += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
}
}
for ( int i = 0; i < count(); i++ ) {
t = tab(i);
// if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) {
if ( i != middleTab ) {
int w = hiddenTabWidth;
int ih = 0;
if ( t->iconSet() != 0 ) {
w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
}
int h = QMAX( fm.height(), ih );
h = QMAX( h, QApplication::globalStrut().height() );
h += vframe;
w += hframe;
t->setRect( QRect(x, 0, w, h) );
x += t->rect().width() - overlap;
r = r.unite( t->rect() );
} else {
int w = fm.width( t->text() );
int ih = 0;
if ( t->iconSet() != 0 ) {
w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();