--nextPart19034933.7DXqcqB5GG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Aurélien Gâteau wrote: > Nevertheless, I see your point about not making a change which would > impact all KDE dialogs, especially at a time were the next release is not > an rc. I am going to see if I can figure a way to do add scrollbars to > SystemSettings modules only. While I still believe having scrollbars on all overgrowing KDE dialogs would be a good idea, since it is what the HIG recommends, I worked this evening on a SystemSettings specific implementation. Attached patch adds QScrollArea to SystemSettings modules only. So the question is: which patch (if any) should I apply? Aurélien --nextPart19034933.7DXqcqB5GG Content-Type: text/x-diff; name="systemsettings_scrolling_pages.diff" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="systemsettings_scrolling_pages.diff" Index: mainwindow.cpp =================================================================== --- mainwindow.cpp (révision 751014) +++ mainwindow.cpp (copie de travail) @@ -277,17 +277,13 @@ kDebug() << "item selected: " << item->text(); groupWidget = moduleItemToWidgetDict[mItem]; - scrollView = moduleItemToScrollerDict[mItem]; if(groupWidget==0) { QList list = mItem->modules; - scrollView = new QScrollArea(windowStack); - groupWidget = new KCMultiWidget(0, scrollView, Qt::NonModal); // THAT ZERO IS NEW (actually the 0 can go, jr) - scrollView->setWidget(groupWidget); - scrollView->setWidgetResizable(true); - windowStack->addWidget(scrollView); - moduleItemToScrollerDict.insert(mItem,scrollView); + groupWidget = new KCMultiWidget(0, windowStack, Qt::NonModal); // THAT ZERO IS NEW (actually the 0 can go, jr) + groupWidget->setWindowFlags(Qt::Widget); + windowStack->addWidget(groupWidget); moduleItemToWidgetDict.insert(mItem,groupWidget); connect(groupWidget, SIGNAL(aboutToShow( KCModuleProxy * )), this, SLOT(updateModuleHelp( KCModuleProxy * ))); @@ -305,7 +301,7 @@ // which makes the show() call below segfault. The groupWidget test // above should prevent execution reaching here while the KCMultiWidget is // visible - windowStack->setCurrentWidget( scrollView ); + windowStack->setCurrentWidget( groupWidget ); setCaption( mItem->text() ); showAllAction->setEnabled(true); @@ -318,8 +314,6 @@ currentRadioAction->setEnabled(false); } - groupWidget->show(); - // We resize and expand the window if necessary, but only once the window has been updated. // Some modules seem to dynamically change thier size. The new size is only available // once the dialog is updated. :-/ -SBE Index: kcmultiwidget.cpp =================================================================== --- kcmultiwidget.cpp (révision 751014) +++ kcmultiwidget.cpp (copie de travail) @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -239,6 +240,7 @@ return; } KCModuleProxy * module; + QScrollArea * moduleScrollArea; if( m_orphanModules.contains( moduleinfo.service() ) ) { // the KCModule already exists - it was removed from the dialog in @@ -252,10 +254,15 @@ clientChanged( true ); } + moduleScrollArea = static_cast( module->parentWidget() ); } else { - module = new KCModuleProxy( moduleinfo, this ); + moduleScrollArea = new QScrollArea( this ); + module = new KCModuleProxy( moduleinfo, moduleScrollArea ); + moduleScrollArea->setWidget( module ); + moduleScrollArea->setWidgetResizable( true ); + moduleScrollArea->setFrameStyle( QFrame::NoFrame ); QStringList parentComponents = moduleinfo.service()->property( "X-KDE-System-Settings-Parent-Category" ).toStringList(); @@ -287,7 +294,7 @@ if( m_modules.count() == 1 ) { slotAboutToShow( module ); } - KPageWidgetItem* page = addPage(module, moduleinfo.moduleName()); + KPageWidgetItem* page = addPage(moduleScrollArea, moduleinfo.moduleName()); page->setIcon( KIcon(moduleinfo.icon()) ); page->setHeader(moduleinfo.comment()); } Index: mainwindow.h =================================================================== --- mainwindow.h (révision 751014) +++ mainwindow.h (copie de travail) @@ -78,7 +78,6 @@ QScrollArea *scrollView; QHash moduleItemToWidgetDict; - QHash moduleItemToScrollerDict; QList pageActions; QList overviewPages; --nextPart19034933.7DXqcqB5GG--