-rw-r--r-- | core/launcher/launcher.cpp | 7 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 4f81076..4255b44 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -394,48 +394,55 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray & | |||
394 | int mode; | 394 | int mode; |
395 | stream >> mode; | 395 | stream >> mode; |
396 | if ( view(id) ) | 396 | if ( view(id) ) |
397 | view(id)->setViewMode( (LauncherView::ViewMode)mode ); | 397 | view(id)->setViewMode( (LauncherView::ViewMode)mode ); |
398 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { | 398 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { |
399 | QString id; | 399 | QString id; |
400 | stream >> id; | 400 | stream >> id; |
401 | int mode; | 401 | int mode; |
402 | stream >> mode; | 402 | stream >> mode; |
403 | QString pixmapOrColor; | 403 | QString pixmapOrColor; |
404 | stream >> pixmapOrColor; | 404 | stream >> pixmapOrColor; |
405 | if ( view(id) ) | 405 | if ( view(id) ) |
406 | view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 406 | view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
407 | if ( id == "Documents" ) | 407 | if ( id == "Documents" ) |
408 | docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 408 | docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
409 | } else if ( msg == "setTextColor(QString,QString)" ) { | 409 | } else if ( msg == "setTextColor(QString,QString)" ) { |
410 | QString id; | 410 | QString id; |
411 | stream >> id; | 411 | stream >> id; |
412 | QString color; | 412 | QString color; |
413 | stream >> color; | 413 | stream >> color; |
414 | if ( view(id) ) | 414 | if ( view(id) ) |
415 | view(id)->setTextColor( QColor(color) ); | 415 | view(id)->setTextColor( QColor(color) ); |
416 | if ( id == "Documents" ) | 416 | if ( id == "Documents" ) |
417 | docLoadingWidget->setTextColor( QColor(color) ); | 417 | docLoadingWidget->setTextColor( QColor(color) ); |
418 | } else if ( msg == "setIconColumns(QString,int)" ) { | ||
419 | QString id; | ||
420 | stream >> id; | ||
421 | int number; | ||
422 | stream >> number; | ||
423 | if ( view(id ) ) | ||
424 | view(id)->setColNumber( number ); | ||
418 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { | 425 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { |
419 | QString id; | 426 | QString id; |
420 | stream >> id; | 427 | stream >> id; |
421 | QString fam; | 428 | QString fam; |
422 | stream >> fam; | 429 | stream >> fam; |
423 | int size; | 430 | int size; |
424 | stream >> size; | 431 | stream >> size; |
425 | int weight; | 432 | int weight; |
426 | stream >> weight; | 433 | stream >> weight; |
427 | int italic; | 434 | int italic; |
428 | stream >> italic; | 435 | stream >> italic; |
429 | if ( view(id) ) { | 436 | if ( view(id) ) { |
430 | if ( !fam.isEmpty() ) { | 437 | if ( !fam.isEmpty() ) { |
431 | view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); | 438 | view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); |
432 | odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl; | 439 | odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl; |
433 | } else { | 440 | } else { |
434 | view(id)->clearViewFont(); | 441 | view(id)->clearViewFont(); |
435 | } | 442 | } |
436 | } | 443 | } |
437 | }else if ( msg == "setBusyIndicatorType(QString)" ) { | 444 | }else if ( msg == "setBusyIndicatorType(QString)" ) { |
438 | QString type; | 445 | QString type; |
439 | stream >> type; | 446 | stream >> type; |
440 | setBusyIndicatorType( type ); | 447 | setBusyIndicatorType( type ); |
441 | }else if ( msg == "home()" ) { | 448 | }else if ( msg == "home()" ) { |
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 9d78c0d..2b34cc5 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -618,49 +618,49 @@ QIconViewItem* LauncherIconView::busyItem() const | |||
618 | { | 618 | { |
619 | return bsy; | 619 | return bsy; |
620 | } | 620 | } |
621 | 621 | ||
622 | void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } | 622 | void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } |
623 | 623 | ||
624 | void LauncherIconView::calculateGrid( ItemTextPos pos ) | 624 | void LauncherIconView::calculateGrid( ItemTextPos pos ) |
625 | { | 625 | { |
626 | int dw = QApplication::desktop()->width(); | 626 | int dw = QApplication::desktop()->width(); |
627 | int viewerWidth = dw-style().scrollBarExtent().width(); | 627 | int viewerWidth = dw-style().scrollBarExtent().width(); |
628 | if ( pos == Bottom ) { | 628 | if ( pos == Bottom ) { |
629 | if( !numColumns ) { | 629 | if( !numColumns ) { |
630 | if ( viewerWidth <= 200 ) numColumns = 2; | 630 | if ( viewerWidth <= 200 ) numColumns = 2; |
631 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/96; | 631 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/96; |
632 | else numColumns = 3; | 632 | else numColumns = 3; |
633 | } | 633 | } |
634 | setSpacing( 4 ); | 634 | setSpacing( 4 ); |
635 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); | 635 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); |
636 | setGridY( fontMetrics().height()*2+24 ); | 636 | setGridY( fontMetrics().height()*2+24 ); |
637 | } else { | 637 | } else { |
638 | if( !numColumns ) { | 638 | if( !numColumns ) { |
639 | if ( viewerWidth < 150 ) numColumns = 1; | 639 | if ( viewerWidth < 150 ) numColumns = 1; |
640 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/150; | 640 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/150; |
641 | else numColumns = 2; | 641 | else numColumns = 2; |
642 | } | 642 | } |
643 | setSpacing( 2 ); | 643 | setSpacing( 2 ); |
644 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); | 644 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); |
645 | setGridY( fontMetrics().height()+2 ); | 645 | setGridY( fontMetrics().height()+2 ); |
646 | } | 646 | } |
647 | } | 647 | } |
648 | 648 | ||
649 | void LauncherIconView::styleChange( QStyle &old ) | 649 | void LauncherIconView::styleChange( QStyle &old ) |
650 | { | 650 | { |
651 | QIconView::styleChange( old ); | 651 | QIconView::styleChange( old ); |
652 | calculateGrid( itemTextPos() ); | 652 | calculateGrid( itemTextPos() ); |
653 | } | 653 | } |
654 | 654 | ||
655 | void LauncherIconView::keyPressEvent(QKeyEvent* e) | 655 | void LauncherIconView::keyPressEvent(QKeyEvent* e) |
656 | { | 656 | { |
657 | ike = TRUE; | 657 | ike = TRUE; |
658 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { | 658 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { |
659 | if ( (e->state() & ShiftButton) ) | 659 | if ( (e->state() & ShiftButton) ) |
660 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); | 660 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); |
661 | else | 661 | else |
662 | returnPressed(currentItem()); | 662 | returnPressed(currentItem()); |
663 | } | 663 | } |
664 | 664 | ||
665 | QIconView::keyPressEvent(e); | 665 | QIconView::keyPressEvent(e); |
666 | ike = FALSE; | 666 | ike = FALSE; |