From: ouv Date: Tue, 28 Nov 2006 11:00:48 +0000 (+0000) Subject: Icons for slider X-Git-Tag: WP1_2_3_05-12-2006_cache_system~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a37cc43ec8ff154b41466a8e0f61d203be7da308;p=modules%2Fvisu.git Icons for slider --- diff --git a/resources/Visu_slider_first.png b/resources/Visu_slider_first.png new file mode 100644 index 00000000..ba47a29f 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 index 00000000..a5a63b7e 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 index 00000000..1cca9a88 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 index 00000000..fea48a1e 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 index 00000000..7bd655fe 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 index 00000000..95fd1589 Binary files /dev/null and b/resources/Visu_slider_previous.png differ diff --git a/src/VISUGUI/VISU_images.po b/src/VISUGUI/VISU_images.po index afee2ba5..8efe098c 100644 --- a/src/VISUGUI/VISU_images.po +++ b/src/VISUGUI/VISU_images.po @@ -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" diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index 03a181e5..b3da409f 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -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" ) ) ); } } diff --git a/src/VISUGUI/VisuGUI_Slider.h b/src/VISUGUI/VisuGUI_Slider.h index bc86ba67..d76ecf69 100644 --- a/src/VISUGUI/VisuGUI_Slider.h +++ b/src/VISUGUI/VisuGUI_Slider.h @@ -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;