author | harlekin <harlekin> | 2002-09-17 17:53:32 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-17 17:53:32 (UTC) |
commit | d09947cc7ead59747feb10679ba6ba0a9db20a74 (patch) (side-by-side diff) | |
tree | e33a831e8002608817728bfe821650a2a45c56d7 | |
parent | a1b2f800f53715452f75153218e33fcd8907bbbf (diff) | |
download | opie-d09947cc7ead59747feb10679ba6ba0a9db20a74.zip opie-d09947cc7ead59747feb10679ba6ba0a9db20a74.tar.gz opie-d09947cc7ead59747feb10679ba6ba0a9db20a74.tar.bz2 |
icons back to the to
-rw-r--r-- | core/pim/today/today.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 2095174..f052a9f 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -32,48 +32,46 @@ #include <qtimer.h> #include <qpixmap.h> #include <qlayout.h> #include <qhbox.h> #include <qtabwidget.h> #include <qdialog.h> struct TodayPlugin { QLibrary *library; TodayPluginInterface *iface; TodayPluginObject *guiPart; - QHBox *guiBox; + QWidget *guiBox; QString name; bool active; int pos; }; static QValueList<TodayPlugin> pluginList; Today::Today( QWidget* parent, const char* name, WFlags fl ) : TodayBase( parent, name, fl ) { QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); #if defined(Q_WS_QWS) #if !defined(QT_NO_COP) QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); #endif #endif - // pluginLayout = 0l; - setOwnerField(); init(); loadPlugins(); draw(); showMaximized(); } /** * Qcop receive method. */ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { QDataStream stream( data, IO_ReadOnly ); @@ -156,42 +154,48 @@ void Today::loadPlugins() { TodayPlugin plugin; plugin.library = lib; plugin.iface = iface; plugin.name = QString(*it); if ( m_excludeApplets.grep( *it ).isEmpty() ) { plugin.active = true; } else { plugin.active = false; } plugin.guiPart = plugin.iface->guiPart(); - plugin.guiBox = new QHBox( this ); + // package the whole thing into a qwidget so it can be shown and hidden + plugin.guiBox = new QWidget( this ); + QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); + QPixmap plugPix; plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); - OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); + OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); plugIcon->setPixmap( plugPix ); + + // a scrollview for each plugin QScrollView* sv = new QScrollView( plugin.guiBox ); QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); sv->setMinimumHeight( plugin.guiPart->minHeight() ); //sv->setMaximumHeight( plugin.guiPart->maxHeight() ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setHScrollBarMode( QScrollView::AlwaysOff ); sv->setFrameShape( QFrame::NoFrame ); sv->addChild( plugWidget ); - //plugin.guiBox->addWidget( plugIcon, 0, AlignTop ); - //plugin.guiBox->addWidget( sv, 0, AlignTop ); - plugin.guiBox->setStretchFactor( plugIcon, 1 ); - plugin.guiBox->setStretchFactor( sv, 9 ); + // make sure the icon is on the top alligned + boxLayout->addWidget( plugIcon, 0, AlignTop ); + boxLayout->addWidget( sv, 0, AlignTop ); + boxLayout->setStretchFactor( plugIcon, 1 ); + boxLayout->setStretchFactor( sv, 9 ); layout->addWidget( plugin.guiBox ); pluginList.append( plugin ); count++; } else { qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); delete lib; } } } |