summaryrefslogtreecommitdiff
Unidiff
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)
243{ 243{
244 int i=0; 244 int i=0;
245 LauncherView* view; 245 LauncherView* view;
246 while ((view = (LauncherView*)stack->widget(i++))) { 246 while ((view = (LauncherView*)stack->widget(i++))) {
247 if ( view->removeLink(linkfile) ) 247 if ( view->removeLink(linkfile) )
248 break; 248 break;
249 } 249 }
250 addItem(linkfile); 250 addItem(linkfile);
251 docview->updateTools(); 251 docview->updateTools();
252} 252}
253 253
254void CategoryTabWidget::paletteChange( const QPalette &p ) 254void CategoryTabWidget::paletteChange( const QPalette &p )
255{ 255{
256 QVBox::paletteChange( p ); 256 QVBox::paletteChange( p );
257 QPalette pal = palette(); 257 QPalette pal = palette();
258 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); 258 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
259 pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); 259 pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
260 categoryBar->setPalette( pal ); 260 categoryBar->setPalette( pal );
261 categoryBar->update(); 261 categoryBar->update();
262} 262}
263 263
264void CategoryTabWidget::setBusy(bool on) 264void CategoryTabWidget::setBusy(bool on)
265{ 265{
266 if ( on ) 266 if ( on )
267 ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); 267 ((LauncherView*)stack->visibleWidget())->setBusy(TRUE);
268 else 268 else
269 for (int i=0; i<tabs; i++) 269 for (int i=0; i<tabs; i++)
270 ((LauncherView*)stack->widget(i))->setBusy(FALSE); 270 ((LauncherView*)stack->widget(i))->setBusy(FALSE);
271} 271}
272 272
273 273
274CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) 274CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name )
275 : QTabBar( parent, name ) 275 : QTabBar( parent, name )
276{ 276{
277 setFocusPolicy( NoFocus ); 277 setFocusPolicy( NoFocus );
278 connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); 278 connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) );
279} 279}
280 280
281CategoryTabBar::~CategoryTabBar() 281CategoryTabBar::~CategoryTabBar()
282{ 282{
283} 283}
284 284
285void CategoryTabBar::layoutTabs() 285void CategoryTabBar::layoutTabs()
286{ 286{
287 if ( !count() ) 287 if ( !count() )
288 return; 288 return;
289 289
290// int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 }; 290// int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 };
291 int hiddenTabWidth = -12; 291 int hiddenTabWidth = -7;
292 int middleTab = currentTab(); 292 int middleTab = currentTab();
293 int hframe, vframe, overlap; 293 int hframe, vframe, overlap;
294 style().tabbarMetrics( this, hframe, vframe, overlap ); 294 style().tabbarMetrics( this, hframe, vframe, overlap );
295 QFontMetrics fm = fontMetrics(); 295 QFontMetrics fm = fontMetrics();
296 int x = 0; 296 int x = 0;
297 QRect r; 297 QRect r;
298 QTab *t; 298 QTab *t;
299 int available = width()-1; 299 int available = width()-1;
300 int required = 0; 300 int required = 0;
301 for ( int i = 0; i < count(); i++ ) { 301 for ( int i = 0; i < count(); i++ ) {
302 t = tab(i); 302 t = tab(i);
303 // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { 303 // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) {
304 if ( i != middleTab ) { 304 if ( i != middleTab ) {
305 // required += hiddenTabWidth + hframe - overlap; 305 // required += hiddenTabWidth + hframe - overlap;
306 available -= hiddenTabWidth + hframe - overlap; 306 available -= hiddenTabWidth + hframe - overlap;
307 if ( t->iconSet() != 0 ) 307 if ( t->iconSet() != 0 )
308 available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); 308 available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
309 } else { 309 } else {
310 required += fm.width( t->text() ) + hframe - overlap; 310 required += fm.width( t->text() ) + hframe - overlap;
311 if ( t->iconSet() != 0 ) 311 if ( t->iconSet() != 0 )
312 required += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); 312 required += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
313 } 313 }
314 } 314 }
315 for ( int i = 0; i < count(); i++ ) { 315 for ( int i = 0; i < count(); i++ ) {
316 t = tab(i); 316 t = tab(i);
317 // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) { 317 // if (( i < (middleTab - 1) ) || ( i > (middleTab + 1) )) {
318 if ( i != middleTab ) { 318 if ( i != middleTab ) {
319 int w = hiddenTabWidth; 319 int w = hiddenTabWidth;
320 int ih = 0; 320 int ih = 0;
321 if ( t->iconSet() != 0 ) { 321 if ( t->iconSet() != 0 ) {
322 w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); 322 w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
323 ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); 323 ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
324 } 324 }
325 int h = QMAX( fm.height(), ih ); 325 int h = QMAX( fm.height(), ih );
326 h = QMAX( h, QApplication::globalStrut().height() ); 326 h = QMAX( h, QApplication::globalStrut().height() );
327 327
328 h += vframe; 328 h += vframe;
329 w += hframe; 329 w += hframe;
330 330
331 t->setRect( QRect(x, 0, w, h) ); 331 t->setRect( QRect(x, 0, w, h) );
332 x += t->rect().width() - overlap; 332 x += t->rect().width() - overlap;
333 r = r.unite( t->rect() ); 333 r = r.unite( t->rect() );
334 } else { 334 } else {
335 int w = fm.width( t->text() ); 335 int w = fm.width( t->text() );
336 int ih = 0; 336 int ih = 0;
337 if ( t->iconSet() != 0 ) { 337 if ( t->iconSet() != 0 ) {
338 w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); 338 w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
339 ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); 339 ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();