From 3265d6601db6e89e1b99f5c8fe3387c4c5a97e6b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 6 Apr 2011 13:13:47 +0000 Subject: [PATCH] 0021219: [CEA 463] Add a preference to setOpaqueResize --- src/LightApp/LightApp_Application.cxx | 22 +++++++++++++++++++++- src/LightApp/resources/LightApp.xml | 3 ++- src/LightApp/resources/LightApp_msg_en.ts | 8 ++++++++ src/Qtx/QtxWorkstack.cxx | 23 +++++++++++++++++++++++ src/Qtx/QtxWorkstack.h | 3 +++ 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 532f43e27..b30c2719a 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1936,6 +1936,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "strings", aLangs, curLang ); pref->setItemProperty( "icons", aIcons, curLang ); + int lookGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), genTab ); + pref->addPreference( tr( "PREF_OPAQUE_RESIZE" ), lookGroup, LightApp_Preferences::Bool, "desktop", "opaque_resize" ); + int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab ); pref->setItemProperty( "columns", 2, studyGroup ); @@ -2624,6 +2627,15 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_MessageBox::information( desktop(), tr( "WRN_WARNING" ), tr( "LANG_CHANGED" ) ); } + if ( sec == "desktop" && param == "opaque_resize" ) { + bool opaqueResize = resMgr->booleanValue( "desktop", "opaque_resize", false ); + QMainWindow::DockOptions dopts = desktop()->dockOptions(); + if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks; + else dopts &= ~QMainWindow::AnimatedDocks; + desktop()->setDockOptions( dopts ); + if ( dynamic_cast( desktop() ) ) + dynamic_cast( desktop() )->workstack()->setOpaqueResize( opaqueResize ); + } } /*! @@ -2672,8 +2684,16 @@ void LightApp_Application::loadPreferences() myWinVis.insert( *itr, arr ); } - if ( desktop() ) + if ( desktop() ) { desktop()->retrieveGeometry( aResMgr->stringValue( "desktop", "geometry" ) ); + bool opaqueResize = aResMgr->booleanValue( "desktop", "opaque_resize", false ); + QMainWindow::DockOptions dopts = desktop()->dockOptions(); + if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks; + else dopts &= ~QMainWindow::AnimatedDocks; + desktop()->setDockOptions( dopts ); + if ( dynamic_cast( desktop() ) ) + dynamic_cast( desktop() )->workstack()->setOpaqueResize( opaqueResize ); + } } /*! diff --git a/src/LightApp/resources/LightApp.xml b/src/LightApp/resources/LightApp.xml index 37962eb32..9b703edb1 100644 --- a/src/LightApp/resources/LightApp.xml +++ b/src/LightApp/resources/LightApp.xml @@ -79,7 +79,8 @@
- + +
diff --git a/src/LightApp/resources/LightApp_msg_en.ts b/src/LightApp/resources/LightApp_msg_en.ts index 4141f4291..810955293 100644 --- a/src/LightApp/resources/LightApp_msg_en.ts +++ b/src/LightApp/resources/LightApp_msg_en.ts @@ -506,6 +506,14 @@ The changes will be applied on the next application session. PREF_CURRENT_LANGUAGE Current language + + PREF_GROUP_LOOK_AND_FEEL + Look & feel + + + PREF_OPAQUE_RESIZE + Opaque resize + PREF_GROUP_STUDY Study properties diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index ae651bf48..5e9e66b03 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -3140,6 +3140,29 @@ bool QtxWorkstack::restoreState( QDataStream& stream ) return ok; } +/*! + \brief Set resize mode of all splitters opaque or transparent. + \param opaque opaque mode +*/ +void QtxWorkstack::setOpaqueResize( bool opaque ) +{ + QList splitList; + splitters( mySplit, splitList, true ); + splitList << mySplit; + foreach( QSplitter* split, splitList ) + split->setOpaqueResize( opaque ); +} + +/*! + \brief Get resize mode of all splitters: opaque (\c true) or transparent (\c false). + \return current opaque mode +*/ +bool QtxWorkstack::opaqueResize() const +{ + return mySplit->opaqueResize(); +} + + /*! \fn void QtxWorkstack::windowActivated( QWidget* w ) \brief Emitted when the workstack's child widget \w is activated. diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index 2f3653187..cf2725f45 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -111,6 +111,9 @@ public: QByteArray saveState( int ) const; bool restoreState( const QByteArray&, int ); + + void setOpaqueResize( bool = true ); + bool opaqueResize() const; void Split( QWidget* wid, const Qt::Orientation o, const SplitType type ); void Attract( QWidget* wid1, QWidget* wid2, const bool all ); -- 2.39.2