author | llornkcor <llornkcor> | 2004-06-15 07:44:41 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-06-15 07:44:41 (UTC) |
commit | 631bd9765ed1d4e53ee8b021da644e0cfdcd623c (patch) (unidiff) | |
tree | 6ab82737682b5e8f3c97933bf3f8c43b216f31bd | |
parent | 01b44d9e12a324b8d77f52d66c6799f6f8f0df28 (diff) | |
download | opie-631bd9765ed1d4e53ee8b021da644e0cfdcd623c.zip opie-631bd9765ed1d4e53ee8b021da644e0cfdcd623c.tar.gz opie-631bd9765ed1d4e53ee8b021da644e0cfdcd623c.tar.bz2 |
workaround launcherview problems with qt/e 2.3.8
-rw-r--r-- | core/launcher/launcherview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 71e8753..e86f389 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -877,130 +877,132 @@ void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) | |||
877 | 877 | ||
878 | if ( img.depth() == 1 ) | 878 | if ( img.depth() == 1 ) |
879 | img = img.convertDepth(8); | 879 | img = img.convertDepth(8); |
880 | img.setAlphaBuffer(FALSE); | 880 | img.setAlphaBuffer(FALSE); |
881 | bg.convertFromImage(img); | 881 | bg.convertFromImage(img); |
882 | bgCache->insert( bgName, new BgPixmap(bg) ); | 882 | bgCache->insert( bgName, new BgPixmap(bg) ); |
883 | } | 883 | } |
884 | } | 884 | } |
885 | break; | 885 | break; |
886 | 886 | ||
887 | case SolidColor: | 887 | case SolidColor: |
888 | default: | 888 | default: |
889 | break; | 889 | break; |
890 | } | 890 | } |
891 | 891 | ||
892 | const QObjectList *list = queryList( "QWidget", 0, FALSE ); | 892 | const QObjectList *list = queryList( "QWidget", 0, FALSE ); |
893 | QObject *obj; | 893 | QObject *obj; |
894 | for ( QObjectListIt it( *list ); (obj=it.current()); ++it ) { | 894 | for ( QObjectListIt it( *list ); (obj=it.current()); ++it ) { |
895 | if ( obj->isWidgetType() ) { | 895 | if ( obj->isWidgetType() ) { |
896 | QWidget *w = (QWidget*)obj; | 896 | QWidget *w = (QWidget*)obj; |
897 | w->setBackgroundPixmap( bg ); | 897 | w->setBackgroundPixmap( bg ); |
898 | if ( bgName.isEmpty() ) { | 898 | if ( bgName.isEmpty() ) { |
899 | // Solid Color | 899 | // Solid Color |
900 | if ( val.isEmpty() ) | 900 | if ( val.isEmpty() ) |
901 | w->setBackgroundColor( colorGroup().base() ); | 901 | w->setBackgroundColor( colorGroup().base() ); |
902 | else | 902 | else |
903 | w->setBackgroundColor( val ); | 903 | w->setBackgroundColor( val ); |
904 | } else { | 904 | } else { |
905 | // Ruled or Image pixmap | 905 | // Ruled or Image pixmap |
906 | w->setBackgroundOrigin( ParentOrigin ); | 906 | w->setBackgroundOrigin( ParentOrigin ); |
907 | } | 907 | } |
908 | } | 908 | } |
909 | } | 909 | } |
910 | delete list; | 910 | delete list; |
911 | 911 | ||
912 | bgType = t; | 912 | bgType = t; |
913 | icons->viewport()->update(); | 913 | icons->viewport()->update(); |
914 | 914 | ||
915 | QTimer::singleShot( 1000, this, SLOT(flushBgCache()) ); | 915 | QTimer::singleShot( 1000, this, SLOT(flushBgCache()) ); |
916 | } | 916 | } |
917 | 917 | ||
918 | void LauncherView::setTextColor( const QColor &tc ) | 918 | void LauncherView::setTextColor( const QColor &tc ) |
919 | { | 919 | { |
920 | textCol = tc; | 920 | textCol = tc; |
921 | QColorGroup cg = icons->colorGroup(); | 921 | QColorGroup cg = icons->colorGroup(); |
922 | cg.setColor( QColorGroup::Text, tc ); | 922 | cg.setColor( QColorGroup::Text, tc ); |
923 | icons->setPalette( QPalette(cg,cg,cg) ); | 923 | icons->setPalette( QPalette(cg,cg,cg) ); |
924 | icons->viewport()->update(); | 924 | icons->viewport()->update(); |
925 | } | 925 | } |
926 | 926 | ||
927 | void LauncherView::setViewFont( const QFont &f ) | 927 | void LauncherView::setViewFont( const QFont &f ) |
928 | { | 928 | { |
929 | icons->setFont( f ); | 929 | icons->setFont( f ); |
930 | icons->hideOrShowItems( FALSE ); | 930 | icons->hideOrShowItems( FALSE ); |
931 | } | 931 | } |
932 | 932 | ||
933 | void LauncherView::clearViewFont() | 933 | void LauncherView::clearViewFont() |
934 | { | 934 | { |
935 | icons->unsetFont(); | 935 | icons->unsetFont(); |
936 | icons->hideOrShowItems( FALSE ); | 936 | icons->hideOrShowItems( FALSE ); |
937 | } | 937 | } |
938 | 938 | ||
939 | void LauncherView::resizeEvent(QResizeEvent *e) | 939 | void LauncherView::resizeEvent(QResizeEvent *e) |
940 | { | 940 | { |
941 | //qDebug("LauncherView resize event"); | ||
941 | QVBox::resizeEvent( e ); | 942 | QVBox::resizeEvent( e ); |
942 | if ( e->size().width() != e->oldSize().width() ) | 943 | // commented out for launcherview and qt/e 2.3.8 problems, probably needs real fixing somewhere... |
944 | // if ( e->size().width() != e->oldSize().width() ) | ||
943 | sort(); | 945 | sort(); |
944 | } | 946 | } |
945 | 947 | ||
946 | void LauncherView::selectionChanged() | 948 | void LauncherView::selectionChanged() |
947 | { | 949 | { |
948 | QIconViewItem* item = icons->currentItem(); | 950 | QIconViewItem* item = icons->currentItem(); |
949 | if ( item && item->isSelected() ) { | 951 | if ( item && item->isSelected() ) { |
950 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 952 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
951 | if ( icons->inKeyEvent() ) // not for mouse press | 953 | if ( icons->inKeyEvent() ) // not for mouse press |
952 | emit clicked( appLnk ); | 954 | emit clicked( appLnk ); |
953 | item->setSelected(FALSE); | 955 | item->setSelected(FALSE); |
954 | } | 956 | } |
955 | } | 957 | } |
956 | 958 | ||
957 | void LauncherView::returnPressed( QIconViewItem *item ) | 959 | void LauncherView::returnPressed( QIconViewItem *item ) |
958 | { | 960 | { |
959 | if ( item ) { | 961 | if ( item ) { |
960 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 962 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
961 | emit clicked( appLnk ); | 963 | emit clicked( appLnk ); |
962 | } | 964 | } |
963 | } | 965 | } |
964 | 966 | ||
965 | void LauncherView::itemClicked( int btn, QIconViewItem *item ) | 967 | void LauncherView::itemClicked( int btn, QIconViewItem *item ) |
966 | { | 968 | { |
967 | if ( item ) { | 969 | if ( item ) { |
968 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 970 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
969 | if ( btn == LeftButton ) { | 971 | if ( btn == LeftButton ) { |
970 | // Make sure it's the item we execute that gets highlighted | 972 | // Make sure it's the item we execute that gets highlighted |
971 | icons->setCurrentItem( item ); | 973 | icons->setCurrentItem( item ); |
972 | emit clicked( appLnk ); | 974 | emit clicked( appLnk ); |
973 | } | 975 | } |
974 | item->setSelected(FALSE); | 976 | item->setSelected(FALSE); |
975 | } | 977 | } |
976 | } | 978 | } |
977 | 979 | ||
978 | void LauncherView::itemPressed( int btn, QIconViewItem *item ) | 980 | void LauncherView::itemPressed( int btn, QIconViewItem *item ) |
979 | { | 981 | { |
980 | if ( item ) { | 982 | if ( item ) { |
981 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 983 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
982 | if ( btn == RightButton ) | 984 | if ( btn == RightButton ) |
983 | emit rightPressed( appLnk ); | 985 | emit rightPressed( appLnk ); |
984 | else if ( btn == ShiftButton ) | 986 | else if ( btn == ShiftButton ) |
985 | emit rightPressed( appLnk ); | 987 | emit rightPressed( appLnk ); |
986 | item->setSelected(FALSE); | 988 | item->setSelected(FALSE); |
987 | } | 989 | } |
988 | } | 990 | } |
989 | 991 | ||
990 | void LauncherView::removeAllItems() | 992 | void LauncherView::removeAllItems() |
991 | { | 993 | { |
992 | icons->clear(); | 994 | icons->clear(); |
993 | } | 995 | } |
994 | 996 | ||
995 | bool LauncherView::removeLink(const QString& linkfile) | 997 | bool LauncherView::removeLink(const QString& linkfile) |
996 | { | 998 | { |
997 | return icons->removeLink(linkfile); | 999 | return icons->removeLink(linkfile); |
998 | } | 1000 | } |
999 | 1001 | ||
1000 | void LauncherView::setSortEnabled( bool v ) | 1002 | void LauncherView::setSortEnabled( bool v ) |
1001 | { | 1003 | { |
1002 | icons->setSorting( v ); | 1004 | icons->setSorting( v ); |
1003 | if ( v ) | 1005 | if ( v ) |
1004 | sort(); | 1006 | sort(); |
1005 | } | 1007 | } |
1006 | 1008 | ||