author | zecke <zecke> | 2004-12-20 22:49:19 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-12-20 22:49:19 (UTC) |
commit | 3d9ea198ea8046d3f2c5b88efd721ffb00df2c22 (patch) (unidiff) | |
tree | 14ae80693ed5faadd7d8a177f8a86ecefff476b6 | |
parent | 21b825786deeb195fa73462f09fe70709aa5a628 (diff) | |
download | opie-3d9ea198ea8046d3f2c5b88efd721ffb00df2c22.zip opie-3d9ea198ea8046d3f2c5b88efd721ffb00df2c22.tar.gz opie-3d9ea198ea8046d3f2c5b88efd721ffb00df2c22.tar.bz2 |
Patch from Hrw for 1493
"Launcher starts in one column mode"
Set the QIconView to adjust its layout on resize
-rw-r--r-- | core/launcher/launcherview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 2783423..dc4c57f 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -641,97 +641,97 @@ void LauncherIconView::calculateGrid( ItemTextPos pos ) | |||
641 | cols = viewerWidth/150; | 641 | cols = viewerWidth/150; |
642 | setSpacing( 2 ); | 642 | setSpacing( 2 ); |
643 | setGridX( (viewerWidth-(cols+1)*spacing())/cols ); | 643 | setGridX( (viewerWidth-(cols+1)*spacing())/cols ); |
644 | setGridY( fontMetrics().height()+2 ); | 644 | setGridY( fontMetrics().height()+2 ); |
645 | } | 645 | } |
646 | } | 646 | } |
647 | 647 | ||
648 | void LauncherIconView::styleChange( QStyle &old ) | 648 | void LauncherIconView::styleChange( QStyle &old ) |
649 | { | 649 | { |
650 | QIconView::styleChange( old ); | 650 | QIconView::styleChange( old ); |
651 | calculateGrid( itemTextPos() ); | 651 | calculateGrid( itemTextPos() ); |
652 | } | 652 | } |
653 | 653 | ||
654 | void LauncherIconView::keyPressEvent(QKeyEvent* e) | 654 | void LauncherIconView::keyPressEvent(QKeyEvent* e) |
655 | { | 655 | { |
656 | ike = TRUE; | 656 | ike = TRUE; |
657 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { | 657 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { |
658 | if ( (e->state() & ShiftButton) ) | 658 | if ( (e->state() & ShiftButton) ) |
659 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); | 659 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); |
660 | else | 660 | else |
661 | returnPressed(currentItem()); | 661 | returnPressed(currentItem()); |
662 | } | 662 | } |
663 | 663 | ||
664 | QIconView::keyPressEvent(e); | 664 | QIconView::keyPressEvent(e); |
665 | ike = FALSE; | 665 | ike = FALSE; |
666 | } | 666 | } |
667 | 667 | ||
668 | //=========================================================================== | 668 | //=========================================================================== |
669 | // Implemantation of LauncherIconview end | 669 | // Implemantation of LauncherIconview end |
670 | //=========================================================================== | 670 | //=========================================================================== |
671 | 671 | ||
672 | 672 | ||
673 | //=========================================================================== | 673 | //=========================================================================== |
674 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) | 674 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) |
675 | : QVBox( parent, name, fl ) | 675 | : QVBox( parent, name, fl ) |
676 | { | 676 | { |
677 | catmb = 0; | 677 | catmb = 0; |
678 | icons = new LauncherIconView( this ); | 678 | icons = new LauncherIconView( this ); |
679 | setFocusProxy(icons); | 679 | setFocusProxy(icons); |
680 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); | 680 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); |
681 | 681 | ||
682 | icons->setItemsMovable( FALSE ); | 682 | icons->setItemsMovable( FALSE ); |
683 | icons->setAutoArrange( TRUE ); | 683 | icons->setAutoArrange( TRUE ); |
684 | icons->setSorting( TRUE ); | 684 | icons->setSorting( TRUE ); |
685 | icons->setFrameStyle( QFrame::NoFrame ); | 685 | icons->setFrameStyle( QFrame::NoFrame ); |
686 | icons->setMargin( 0 ); | 686 | icons->setMargin( 0 ); |
687 | icons->setSelectionMode( QIconView::NoSelection ); | 687 | icons->setSelectionMode( QIconView::NoSelection ); |
688 | icons->setBackgroundMode( PaletteBase ); | 688 | icons->setBackgroundMode( PaletteBase ); |
689 | icons->setResizeMode( QIconView::Fixed ); | 689 | icons->setResizeMode( QIconView::Adjust ); |
690 | vmode = (ViewMode)-1; | 690 | vmode = (ViewMode)-1; |
691 | setViewMode( Icon ); | 691 | setViewMode( Icon ); |
692 | 692 | ||
693 | connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)), | 693 | connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)), |
694 | SLOT(itemClicked(int,QIconViewItem*)) ); | 694 | SLOT(itemClicked(int,QIconViewItem*)) ); |
695 | connect( icons, SIGNAL(selectionChanged()), | 695 | connect( icons, SIGNAL(selectionChanged()), |
696 | SLOT(selectionChanged()) ); | 696 | SLOT(selectionChanged()) ); |
697 | connect( icons, SIGNAL(returnPressed(QIconViewItem*)), | 697 | connect( icons, SIGNAL(returnPressed(QIconViewItem*)), |
698 | SLOT(returnPressed(QIconViewItem*)) ); | 698 | SLOT(returnPressed(QIconViewItem*)) ); |
699 | connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)), | 699 | connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)), |
700 | SLOT(itemPressed(int,QIconViewItem*)) ); | 700 | SLOT(itemPressed(int,QIconViewItem*)) ); |
701 | 701 | ||
702 | tools = 0; | 702 | tools = 0; |
703 | setBackgroundType( Ruled, QString::null ); | 703 | setBackgroundType( Ruled, QString::null ); |
704 | } | 704 | } |
705 | 705 | ||
706 | LauncherView::~LauncherView() | 706 | LauncherView::~LauncherView() |
707 | { | 707 | { |
708 | if ( bgCache && bgCache->contains( bgName ) ) | 708 | if ( bgCache && bgCache->contains( bgName ) ) |
709 | (*bgCache)[bgName]->ref--; | 709 | (*bgCache)[bgName]->ref--; |
710 | } | 710 | } |
711 | 711 | ||
712 | 712 | ||
713 | bool LauncherView::bsy=FALSE; | 713 | bool LauncherView::bsy=FALSE; |
714 | 714 | ||
715 | void LauncherView::setBusy(bool on) | 715 | void LauncherView::setBusy(bool on) |
716 | { | 716 | { |
717 | icons->setBusy(on); | 717 | icons->setBusy(on); |
718 | } | 718 | } |
719 | 719 | ||
720 | void LauncherView::setBusyIndicatorType( const QString& type ) { | 720 | void LauncherView::setBusyIndicatorType( const QString& type ) { |
721 | if ( type. lower ( ) == "animated" ) | 721 | if ( type. lower ( ) == "animated" ) |
722 | icons->setBusyIndicatorType( BIT_Animated ) ; | 722 | icons->setBusyIndicatorType( BIT_Animated ) ; |
723 | else | 723 | else |
724 | icons->setBusyIndicatorType( BIT_Normal ) ; | 724 | icons->setBusyIndicatorType( BIT_Normal ) ; |
725 | } | 725 | } |
726 | 726 | ||
727 | void LauncherView::hideIcons() | 727 | void LauncherView::hideIcons() |
728 | { | 728 | { |
729 | icons->hide(); | 729 | icons->hide(); |
730 | } | 730 | } |
731 | 731 | ||
732 | void LauncherView::setToolsEnabled(bool y) | 732 | void LauncherView::setToolsEnabled(bool y) |
733 | { | 733 | { |
734 | if ( !y != !tools ) { | 734 | if ( !y != !tools ) { |
735 | if ( y ) { | 735 | if ( y ) { |
736 | tools = new QHBox(this); | 736 | tools = new QHBox(this); |
737 | // Type filter | 737 | // Type filter |