-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
myOpaque( true ),
myResizer( 0 ),
myMouseMove( 0 ),
- myFullScreenAllowed(true)
+ myFullScreenAllowed(true),
+ myMinimizeAllowed(true)
{
//rnv: Enables tooltips for inactive windows.
//rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
state = QString( "max" );
break;
case Qt::WindowMinimized:
- state = QString( "min" );
+ if ( isMinimizeAllowed() ) state = QString( "min" );
break;
case Qt::WindowFullScreen:
state = isFullScreenAllowed() ? QString( "full" ) : QString( "max" );
if ( stRx.indexIn( geom ) != -1 )
{
QString stStr = stRx.cap( 1 ).trimmed().toLower();
- if ( stStr.startsWith( QString( "max" ) ) )
+ if ( stStr.startsWith( QString( "max" ) ) ) {
state = Qt::WindowMaximized;
- else if ( stStr.startsWith( QString( "min" ) ) )
- state = Qt::WindowMinimized;
- else if ( stStr.startsWith( QString( "full" ) ) )
- state = Qt::WindowFullScreen;
+ }
+ else if ( stStr.startsWith( QString( "min" ) ) ) {
+ if ( isMinimizeAllowed() )
+ state = Qt::WindowMinimized;
+ }
+ else if ( stStr.startsWith( QString( "full" ) ) ) {
+ state = isFullScreenAllowed() ? Qt::WindowFullScreen : Qt::WindowMaximized;
+ }
}
resize( rect.size() );
/*!
\brief FullScreenAllowed flag allowed dump in the main window geometry
Qt::WindowFullScreen parameter.
- \return \c fullScreenAllowed flag.
+ \return \c FullScreenAllowed flag.
*/
bool QtxMainWindow::isFullScreenAllowed() const {
return myFullScreenAllowed;
/*!
\brief Set FullScreenAllowed flag.
The default value is true.
- \param f value of the fullScreenAllowed flag.
+ \param f value of the FullScreenAllowed flag.
*/
void QtxMainWindow::setFullScreenAllowed( const bool f ) {
myFullScreenAllowed = f;
}
+
+/*!
+ \brief MinimizeAllowed flag allowed dump in the main window geometry
+ Qt::WindowMinimized parameter.
+ \return \c MinimizeAllowed flag.
+*/
+bool QtxMainWindow::isMinimizeAllowed() const {
+ return myMinimizeAllowed;
+}
+
+
+/*!
+ \brief Set MinimizeAllowed flag.
+ The default value is true.
+ \param f value of the MinimizeAllowed flag.
+*/
+void QtxMainWindow::setMinimizeAllowed( const bool f ) {
+ myMinimizeAllowed = f;
+}