Salome HOME
Improve the look-n-feel of the splash window
authorvsr <vsr@opencascade.com>
Tue, 28 Jun 2005 09:12:31 +0000 (09:12 +0000)
committervsr <vsr@opencascade.com>
Tue, 28 Jun 2005 09:12:31 +0000 (09:12 +0000)
src/Session/InquireServersQThread.cxx
src/Session/InquireServersQThread.h

index a3edf53a60648a2115f517c8681be6f0388fc97c..0f165b4517c0df1d21096f1bd449d4af4bab1454 100755 (executable)
@@ -20,6 +20,8 @@ using namespace std;
 #include <qdir.h>
 #include <qfileinfo.h>
 #include <qstringlist.h>
+#include <qlabel.h> 
+#include <qprogressbar.h> 
 
 //VRV: porting on Qt 3.0.5
 #if QT_VERSION >= 0x030005
@@ -59,12 +61,20 @@ InquireServersGUI::InquireServersGUI()
   setLineWidth( 2 );
   setMinimumSize( 200, 150 );
 
+  // 2. Set palette
+  QPalette pal = palette();
+  QColorGroup cg = pal.active();
+  cg.setColor( QColorGroup::Foreground, Qt::darkBlue ); 
+  cg.setColor( QColorGroup::Background, Qt::white );
+  pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
+  setPalette( pal );
+
   // 2. Splash image
-  QFrame* frm = new QFrame( this );
-  frm->setFrameStyle( QFrame::Box | QFrame::Raised );
-  QHBoxLayout* frmLayout = new QHBoxLayout( frm );
+  mySplashFrame = new QFrame( this );
+  mySplashFrame->setFrameStyle( QFrame::Box | QFrame::Raised );
+  QHBoxLayout* frmLayout = new QHBoxLayout( mySplashFrame );
   frmLayout->setMargin( MARGIN_SIZE );
-  mySplash = new QLabel( frm, "splash" );
+  mySplash = new QLabel( mySplashFrame, "splash" );
   frmLayout->addWidget( mySplash );
 
   // setting pixmap
@@ -75,6 +85,14 @@ InquireServersGUI::InquireServersGUI()
   myPrgBar = new QProgressBar( this, "QProgressBar" );
   myPrgBar->setFixedWidth( 180 );
   //Sets the total number of steps . 
+  myPrgBar->setPercentageVisible( false );
+  myPrgBar->setIndicatorFollowsStyle( false );
+  myPrgBar->setFixedHeight( 8 );
+  myPrgBar->setFrameStyle( QFrame::Box | QFrame::Plain );
+  myPrgBar->setMargin( 0 );
+  pal = myPrgBar->palette(); cg = pal.active();
+  cg.setColor( QColorGroup::Highlight, Qt::red );
+  pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg ); myPrgBar->setPalette( pal );
   myPrgBar->setTotalSteps ( myThread->getInquiredServers() );
   myPrgBar->setProgress( 0 );
 
@@ -122,8 +140,9 @@ void InquireServersGUI::setPixmap( QPixmap pix )
 {
   if ( !pix.isNull() ) {
     mySplash->setPixmap( pix );
-    myPrgBar->setFixedWidth( mySplash->sizeHint().width() );
-    myLabel->setFixedWidth( mySplash->sizeHint().width() );
+    int w = mySplash->sizeHint().width() + MARGIN_SIZE*2;
+    myPrgBar->setFixedWidth( w );
+    myLabel->setFixedWidth( w );
   }
 }
 
index ef08ace7d27b0802f5ee105b27e25dc9c7920fcb..b6bc7a8ce3bceec993eb52fbb5c569398af85db9 100755 (executable)
@@ -9,8 +9,6 @@
 
 #include <qthread.h> 
 #include <qvbox.h> 
-#include <qprogressbar.h> 
-#include <qlabel.h> 
 #include <qguardedptr.h> 
 
 /**********************************************************
@@ -18,7 +16,6 @@
 **  Descr:   Contains QCustomEvents for posting to InquireServersQThread
 **  Level:   Private
 ***********************************************************/
-
 class InquireEvent : public QCustomEvent
 {
 public:
@@ -82,6 +79,9 @@ private:
 
 } ;
 
+class QLabel;
+class QFrame;
+class QProgressBar;
 class InquireServersGUI : public QVBox
 {
     Q_OBJECT
@@ -111,6 +111,7 @@ private:
   //this string contains description of currently asked server
   QLabel* myLabel;
   QLabel* mySplash;
+  QFrame* mySplashFrame;
   //  bool myGUI;
 
 private slots: