]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Icons for slider
authorouv <ouv@opencascade.com>
Tue, 28 Nov 2006 11:00:48 +0000 (11:00 +0000)
committerouv <ouv@opencascade.com>
Tue, 28 Nov 2006 11:00:48 +0000 (11:00 +0000)
resources/Visu_slider_first.png [new file with mode: 0644]
resources/Visu_slider_last.png [new file with mode: 0644]
resources/Visu_slider_next.png [new file with mode: 0644]
resources/Visu_slider_pause.png [new file with mode: 0644]
resources/Visu_slider_play.png [new file with mode: 0644]
resources/Visu_slider_previous.png [new file with mode: 0644]
src/VISUGUI/VISU_images.po
src/VISUGUI/VisuGUI_Slider.cxx
src/VISUGUI/VisuGUI_Slider.h

diff --git a/resources/Visu_slider_first.png b/resources/Visu_slider_first.png
new file mode 100644 (file)
index 0000000..ba47a29
Binary files /dev/null and b/resources/Visu_slider_first.png differ
diff --git a/resources/Visu_slider_last.png b/resources/Visu_slider_last.png
new file mode 100644 (file)
index 0000000..a5a63b7
Binary files /dev/null and b/resources/Visu_slider_last.png differ
diff --git a/resources/Visu_slider_next.png b/resources/Visu_slider_next.png
new file mode 100644 (file)
index 0000000..1cca9a8
Binary files /dev/null and b/resources/Visu_slider_next.png differ
diff --git a/resources/Visu_slider_pause.png b/resources/Visu_slider_pause.png
new file mode 100644 (file)
index 0000000..fea48a1
Binary files /dev/null and b/resources/Visu_slider_pause.png differ
diff --git a/resources/Visu_slider_play.png b/resources/Visu_slider_play.png
new file mode 100644 (file)
index 0000000..7bd655f
Binary files /dev/null and b/resources/Visu_slider_play.png differ
diff --git a/resources/Visu_slider_previous.png b/resources/Visu_slider_previous.png
new file mode 100644 (file)
index 0000000..95fd158
Binary files /dev/null and b/resources/Visu_slider_previous.png differ
index afee2ba532d05975ed8447d23cce6030d4d9c833..8efe098cd30c10940d020a8f0357d6b9381ee019 100644 (file)
@@ -132,3 +132,21 @@ msgstr "Visu_recording_stop.png"
 
 msgid "ICON_LOAD_TEXTURE"
 msgstr "Visu_load_texture.png"
+
+msgid "ICON_SLIDER_FIRST"
+msgstr "Visu_slider_first.png"
+
+msgid "ICON_SLIDER_PREVIOUS"
+msgstr "Visu_slider_previous.png"
+
+msgid "ICON_SLIDER_PLAY"
+msgstr "Visu_slider_play.png"
+
+msgid "ICON_SLIDER_PAUSE"
+msgstr "Visu_slider_pause.png"
+
+msgid "ICON_SLIDER_NEXT"
+msgstr "Visu_slider_next.png"
+
+msgid "ICON_SLIDER_LAST"
+msgstr "Visu_slider_last.png"
index 03a181e581404c90b955a6178b6ecf506520b8e7..b3da409f6ddf0af831cdde373c81ed5edf5e28fc 100644 (file)
@@ -59,6 +59,7 @@
 #include <qlayout.h>
 #include <qhbox.h>
 #include <qpushbutton.h>
+#include <qtoolbutton.h>
 #include <qslider.h>
 #include <qspinbox.h>
 #include <qtimer.h>
@@ -80,7 +81,7 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule,
   if(!CORBA::is_nil(aView.in()))
     myView3D = VISU::View3D::_narrow(aView);
 
-  //SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   setHorizontallyStretchable( true );
 
@@ -132,30 +133,35 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule,
   myMoreButton->setEnabled( false );
   aButtonsLayout->addWidget( myMoreButton );
 
-  aButtonsLayout->addItem( new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+  aButtonsLayout->addItem( new QSpacerItem( 24, 24, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
 
-  myFirstButton = new QPushButton( tr( "|<<" ), aWidget );
-  myFirstButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+  myFirstButton = new QToolButton( aWidget );
+  myFirstButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+  //myFirstButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
   aButtonsLayout->addWidget( myFirstButton );
 
-  myPreviousButton = new QPushButton( tr( "<<" ), aWidget );
-  myPreviousButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+  myPreviousButton = new QToolButton( aWidget );
+  myPreviousButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+  //myPreviousButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
   aButtonsLayout->addWidget( myPreviousButton );
 
-  myPlayButton = new QPushButton( tr( ">" ), aWidget );
-  myPlayButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+  myPlayButton = new QToolButton( aWidget );
+  myPlayButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+  //myPlayButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
   myPlayButton->setToggleButton( true );
   aButtonsLayout->addWidget( myPlayButton );
 
-  myNextButton = new QPushButton( tr( ">>" ), aWidget );
-  myNextButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+  myNextButton = new QToolButton( aWidget );
+  myNextButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+  //myNextButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
   aButtonsLayout->addWidget( myNextButton );
 
-  myLastButton = new QPushButton( tr( ">>|" ), aWidget );
-  myLastButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+  myLastButton = new QToolButton( aWidget );
+  myLastButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+  //myLastButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
   aButtonsLayout->addWidget( myLastButton );
 
-  aButtonsLayout->addItem( new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+  aButtonsLayout->addItem( new QSpacerItem( 24, 24, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
 
   QLabel* aSpeedLabel = new QLabel( tr( "SPEED" ), aWidget );
   aSpeedLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
@@ -324,9 +330,10 @@ void VisuGUI_Slider::onPrevious()
 
 void VisuGUI_Slider::onPlay( bool on )
 {
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   if( on )
   {
-    myPlayButton->setText( "||" );
+    myPlayButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
 
     int delay = int(5000.0 / double(mySpeedBox->value()));
     myTimer->start( delay );
@@ -334,7 +341,7 @@ void VisuGUI_Slider::onPlay( bool on )
   else
   {
     myTimer->stop();
-    myPlayButton->setText( ">" );
+    myPlayButton->setIconSet( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
   }
 }
 
index bc86ba6716ced801f951e7212cbf37782a8c056e..d76ecf69b06f8f0998925a1436f66f84c9723e50 100644 (file)
@@ -43,6 +43,7 @@ class QCheckBox;
 class QComboBox;
 class QLabel;
 class QPushButton;
+class QToolButton;
 class QSlider;
 class QSpinBox;
 class QTimer;
@@ -100,11 +101,11 @@ private:
   QComboBox*       myTimeStampIndices;
 
   QPushButton*     myMoreButton;
-  QPushButton*     myFirstButton;
-  QPushButton*     myPreviousButton;
-  QPushButton*     myPlayButton;
-  QPushButton*     myNextButton;
-  QPushButton*     myLastButton;
+  QToolButton*     myFirstButton;
+  QToolButton*     myPreviousButton;
+  QToolButton*     myPlayButton;
+  QToolButton*     myNextButton;
+  QToolButton*     myLastButton;
 
   QSpinBox*        mySpeedBox;
   QCheckBox*       myAVIBox;