From: vsr Date: Mon, 10 Sep 2012 06:14:35 +0000 (+0000) Subject: 0021687: EDF 2306 STUDY: Dimension of the preference window X-Git-Tag: V6_6_0a1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=54ab859176b47906b798b18de383a291e186b1e8;p=modules%2Fgui.git 0021687: EDF 2306 STUDY: Dimension of the preference window Make contents of preference dialog box scrollable --- diff --git a/src/LightApp/LightApp_PreferencesDlg.cxx b/src/LightApp/LightApp_PreferencesDlg.cxx index f49b36d41..b627e9a5c 100644 --- a/src/LightApp/LightApp_PreferencesDlg.cxx +++ b/src/LightApp/LightApp_PreferencesDlg.cxx @@ -65,6 +65,8 @@ myPrefs( prefs ), mySaved ( false ) QAbstractButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) ); if( impBtn ) connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) ); + + setMinimumSize( 800, 600 ); } /*! diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index 8ce69e23d..5db47925c 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -1198,7 +1199,7 @@ void QtxPagePrefTabsItem::updateTabs() \param param resource file parameter associated with the preference item */ QtxPagePrefFrameItem::QtxPagePrefFrameItem( const QString& title, QtxPreferenceItem* parent, - const QString& sect, const QString& param ) + const QString& sect, const QString& param, const bool scrollable ) : QtxPagePrefItem( title, parent, sect, param ) { QWidget* main = new QWidget(); @@ -1207,7 +1208,15 @@ QtxPagePrefFrameItem::QtxPagePrefFrameItem( const QString& title, QtxPreferenceI base->setSpacing( 0 ); base->addWidget( myBox = new QtxGridBox( 1, Qt::Horizontal, main, 5, 5 ) ); - base->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + base->addStretch(); + + if ( scrollable ) { + QScrollArea* scroll = new QScrollArea(); + scroll->setWidget( main ); + scroll->setWidgetResizable( true ); + base->layout()->setSizeConstraint(QLayout::SetMinAndMaxSize); + main = scroll; + } setWidget( main ); } diff --git a/src/Qtx/QtxPagePrefMgr.h b/src/Qtx/QtxPagePrefMgr.h index 74cca6d31..65549b42a 100644 --- a/src/Qtx/QtxPagePrefMgr.h +++ b/src/Qtx/QtxPagePrefMgr.h @@ -253,7 +253,7 @@ class QTX_EXPORT QtxPagePrefFrameItem : public QtxPagePrefItem { public: QtxPagePrefFrameItem( const QString&, QtxPreferenceItem* = 0, - const QString& = QString(), const QString& = QString() ); + const QString& = QString(), const QString& = QString(), const bool = false ); virtual ~QtxPagePrefFrameItem(); virtual void updateContents(); diff --git a/src/SUIT/SUIT_PreferenceMgr.cxx b/src/SUIT/SUIT_PreferenceMgr.cxx index d6286ac8b..83ff1805a 100644 --- a/src/SUIT/SUIT_PreferenceMgr.cxx +++ b/src/SUIT/SUIT_PreferenceMgr.cxx @@ -96,7 +96,7 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId, item = new QtxPagePrefTabsItem( title, parent, sect, param ); break; case 2: - item = new QtxPagePrefFrameItem( title, parent, sect, param ); + item = new QtxPagePrefFrameItem( title, parent, sect, param, true ); break; case 3: item = new QtxPagePrefGroupItem( title, parent, sect, param );