summaryrefslogtreecommitdiff
authorsandman <sandman>2002-09-27 00:59:52 (UTC)
committer sandman <sandman>2002-09-27 00:59:52 (UTC)
commitac99721b91f3c61d37236932a5d0f6bc09caaa54 (patch) (unidiff)
treee8397c2fd2636452485c5192bbe8166052d08df9
parent6ac98209a82c5aa24ab09faf79525cd9aa5a8a1d (diff)
downloadopie-ac99721b91f3c61d37236932a5d0f6bc09caaa54.zip
opie-ac99721b91f3c61d37236932a5d0f6bc09caaa54.tar.gz
opie-ac99721b91f3c61d37236932a5d0f6bc09caaa54.tar.bz2
- fixed bg image location
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 047fe45..c2bde53 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -642,129 +642,129 @@ void LauncherView::setViewMode( ViewMode m )
642 icons->viewport()->setUpdatesEnabled( FALSE ); 642 icons->viewport()->setUpdatesEnabled( FALSE );
643 icons->setBigIcons( bigIcons ); 643 icons->setBigIcons( bigIcons );
644 switch ( m ) { 644 switch ( m ) {
645 case List: 645 case List:
646 icons->setItemTextPos( QIconView::Right ); 646 icons->setItemTextPos( QIconView::Right );
647 break; 647 break;
648 case Icon: 648 case Icon:
649 icons->setItemTextPos( QIconView::Bottom ); 649 icons->setItemTextPos( QIconView::Bottom );
650 break; 650 break;
651 } 651 }
652 icons->hideOrShowItems( FALSE ); 652 icons->hideOrShowItems( FALSE );
653 icons->viewport()->setUpdatesEnabled( TRUE ); 653 icons->viewport()->setUpdatesEnabled( TRUE );
654 vmode = m; 654 vmode = m;
655 } 655 }
656} 656}
657 657
658void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) 658void LauncherView::setBackgroundType( BackgroundType t, const QString &val )
659{ 659{
660 if ( !bgCache ) 660 if ( !bgCache )
661 bgCache = new QMap<QString,BgPixmap*>; 661 bgCache = new QMap<QString,BgPixmap*>;
662 if ( bgCache->contains( bgName ) ) 662 if ( bgCache->contains( bgName ) )
663 (*bgCache)[bgName]->ref--; 663 (*bgCache)[bgName]->ref--;
664 664
665 switch ( t ) { 665 switch ( t ) {
666 case Ruled: { 666 case Ruled: {
667 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr 667 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr
668 QPixmap bg; 668 QPixmap bg;
669 if ( bgCache->contains( bgName ) ) { 669 if ( bgCache->contains( bgName ) ) {
670 (*bgCache)[bgName]->ref++; 670 (*bgCache)[bgName]->ref++;
671 bg = (*bgCache)[bgName]->pm; 671 bg = (*bgCache)[bgName]->pm;
672 } else { 672 } else {
673 bg.resize( width(), 9 ); 673 bg.resize( width(), 9 );
674 QPainter painter( &bg ); 674 QPainter painter( &bg );
675 for ( int i = 0; i < 3; i++ ) { 675 for ( int i = 0; i < 3; i++ ) {
676 painter.setPen( white ); 676 painter.setPen( white );
677 painter.drawLine( 0, i*3, width()-1, i*3 ); 677 painter.drawLine( 0, i*3, width()-1, i*3 );
678 painter.drawLine( 0, i*3+1, width()-1, i*3+1 ); 678 painter.drawLine( 0, i*3+1, width()-1, i*3+1 );
679 painter.setPen( colorGroup().background().light(105) ); 679 painter.setPen( colorGroup().background().light(105) );
680 painter.drawLine( 0, i*3+2, width()-1, i*3+2 ); 680 painter.drawLine( 0, i*3+2, width()-1, i*3+2 );
681 } 681 }
682 painter.end(); 682 painter.end();
683 bgCache->insert( bgName, new BgPixmap(bg) ); 683 bgCache->insert( bgName, new BgPixmap(bg) );
684 } 684 }
685 icons->setBackgroundPixmap( bg ); 685 icons->setBackgroundPixmap( bg );
686 break; 686 break;
687 } 687 }
688 688
689 case SolidColor: 689 case SolidColor:
690 icons->setBackgroundPixmap( QPixmap() ); 690 icons->setBackgroundPixmap( QPixmap() );
691 if ( val.isEmpty() ) { 691 if ( val.isEmpty() ) {
692 icons->setBackgroundColor( colorGroup().base() ); 692 icons->setBackgroundColor( colorGroup().base() );
693 } else { 693 } else {
694 icons->setBackgroundColor( val ); 694 icons->setBackgroundColor( val );
695 } 695 }
696 bgName = ""; 696 bgName = "";
697 break; 697 break;
698 698
699 case Image: 699 case Image:
700 bgName = val; 700 bgName = val;
701 if ( bgCache->contains( bgName ) ) { 701 if ( bgCache->contains( bgName ) ) {
702 (*bgCache)[bgName]->ref++; 702 (*bgCache)[bgName]->ref++;
703 icons->setBackgroundPixmap( (*bgCache)[bgName]->pm ); 703 icons->setBackgroundPixmap( (*bgCache)[bgName]->pm );
704 } else { 704 } else {
705 qDebug( "Loading image: %s", val.latin1() ); 705 qDebug( "Loading image: %s", val.latin1() );
706 QPixmap bg( Resource::loadPixmap( "wallpaper/" + val ) ); 706 QPixmap bg( Resource::loadPixmap( val ) );
707 if ( bg.isNull() ) { 707 if ( bg.isNull() ) {
708 QImageIO imgio; 708 QImageIO imgio;
709 imgio.setFileName( bgName ); 709 imgio.setFileName( bgName );
710 QSize ds = qApp->desktop()->size(); 710 QSize ds = qApp->desktop()->size();
711 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr 711 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr
712 imgio.setParameters( param.arg(ds.width()).arg(ds.height()).latin1() ); 712 imgio.setParameters( param.arg(ds.width()).arg(ds.height()).latin1() );
713 imgio.read(); 713 imgio.read();
714 bg = imgio.image(); 714 bg = imgio.image();
715 } 715 }
716 bgCache->insert( bgName, new BgPixmap(bg) ); 716 bgCache->insert( bgName, new BgPixmap(bg) );
717 icons->setBackgroundPixmap( bg ); 717 icons->setBackgroundPixmap( bg );
718 } 718 }
719 break; 719 break;
720 } 720 }
721 721
722 // remove unreferenced backgrounds. 722 // remove unreferenced backgrounds.
723 QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); 723 QMap<QString,BgPixmap*>::Iterator it = bgCache->begin();
724 while ( it != bgCache->end() ) { 724 while ( it != bgCache->end() ) {
725 QMap<QString,BgPixmap*>::Iterator curr = it; 725 QMap<QString,BgPixmap*>::Iterator curr = it;
726 ++it; 726 ++it;
727 if ( (*curr)->ref == 0 ) { 727 if ( (*curr)->ref == 0 ) {
728 delete (*curr); 728 delete (*curr);
729 bgCache->remove( curr ); 729 bgCache->remove( curr );
730 } 730 }
731 } 731 }
732 732
733 bgType = t; 733 bgType = t;
734 icons->viewport()->update(); 734 icons->viewport()->update();
735} 735}
736 736
737void LauncherView::setTextColor( const QColor &tc ) 737void LauncherView::setTextColor( const QColor &tc )
738{ 738{
739 textCol = tc; 739 textCol = tc;
740 QColorGroup cg = icons->colorGroup(); 740 QColorGroup cg = icons->colorGroup();
741 cg.setColor( QColorGroup::Text, tc ); 741 cg.setColor( QColorGroup::Text, tc );
742 icons->setPalette( QPalette(cg,cg,cg) ); 742 icons->setPalette( QPalette(cg,cg,cg) );
743 icons->viewport()->update(); 743 icons->viewport()->update();
744} 744}
745 745
746void LauncherView::setViewFont( const QFont &f ) 746void LauncherView::setViewFont( const QFont &f )
747{ 747{
748 icons->setFont( f ); 748 icons->setFont( f );
749} 749}
750 750
751void LauncherView::resizeEvent(QResizeEvent *e) 751void LauncherView::resizeEvent(QResizeEvent *e)
752{ 752{
753 QVBox::resizeEvent( e ); 753 QVBox::resizeEvent( e );
754 if ( e->size().width() != e->oldSize().width() ) 754 if ( e->size().width() != e->oldSize().width() )
755 sort(); 755 sort();
756} 756}
757 757
758void LauncherView::populate( AppLnkSet *folder, const QString& typefilter ) 758void LauncherView::populate( AppLnkSet *folder, const QString& typefilter )
759{ 759{
760 icons->clear(); 760 icons->clear();
761 internalPopulate( folder, typefilter ); 761 internalPopulate( folder, typefilter );
762} 762}
763 763
764QString LauncherView::getAllDocLinkInfo() const 764QString LauncherView::getAllDocLinkInfo() const
765{ 765{
766 return icons->getAllDocLinkInfo(); 766 return icons->getAllDocLinkInfo();
767} 767}
768 768
769void LauncherView::selectionChanged() 769void LauncherView::selectionChanged()
770{ 770{