-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 @@ -42,5 +42,5 @@ struct TodayPlugin { TodayPluginInterface *iface; TodayPluginObject *guiPart; - QHBox *guiBox; + QWidget *guiBox; QString name; bool active; @@ -64,6 +64,4 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) #endif - // pluginLayout = 0l; - setOwnerField(); init(); @@ -166,9 +164,14 @@ void Today::loadPlugins() { 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() ); @@ -180,8 +183,9 @@ void Today::loadPlugins() { 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 ); |