From a37cc43ec8ff154b41466a8e0f61d203be7da308 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 28 Nov 2006 11:00:48 +0000 Subject: [PATCH] Icons for slider --- resources/Visu_slider_first.png | Bin 0 -> 197 bytes resources/Visu_slider_last.png | Bin 0 -> 198 bytes resources/Visu_slider_next.png | Bin 0 -> 198 bytes resources/Visu_slider_pause.png | Bin 0 -> 180 bytes resources/Visu_slider_play.png | Bin 0 -> 204 bytes resources/Visu_slider_previous.png | Bin 0 -> 198 bytes src/VISUGUI/VISU_images.po | 18 ++++++++++++++ src/VISUGUI/VisuGUI_Slider.cxx | 37 +++++++++++++++++------------ src/VISUGUI/VisuGUI_Slider.h | 11 +++++---- 9 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 resources/Visu_slider_first.png create mode 100644 resources/Visu_slider_last.png create mode 100644 resources/Visu_slider_next.png create mode 100644 resources/Visu_slider_pause.png create mode 100644 resources/Visu_slider_play.png create mode 100644 resources/Visu_slider_previous.png diff --git a/resources/Visu_slider_first.png b/resources/Visu_slider_first.png new file mode 100644 index 0000000000000000000000000000000000000000..ba47a29f4beb5c1f350fd15491d830fae35e3cce GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^*SKZ4nAuj9{%-*a1$nwShFF|_d&QcML4kw$!nEJ_ zck->%nm@rpBUxBpqGw9WIwO;7-4Z9Cnl0LC9l5OW=Y&H$OC6)vFy$J0vPhh}n;mxG oG1I06zfGPUj5zl{`_56eXTS7Scial)0h-R>>FVdQ&MBb@0HF0k5C8xG literal 0 HcmV?d00001 diff --git a/resources/Visu_slider_last.png b/resources/Visu_slider_last.png new file mode 100644 index 0000000000000000000000000000000000000000..a5a63b7e3d4e6b5317e8a1b9fd175869c27bccab GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^*SKZ4c=$sMqu&FCf<0XvLo80ey%Na9puoX=VeRkx zm9Yz^c3p7)srjanD@bTp)`E?3M?Cb_3%>2oGO$?Y6X1T~%^J2mz6tE+5{jK4_Z|H- o;b7JUq2fki7KT6ZkM+zLr*rD7vfP=-4K$v?)78&qol`;+0EVGG{r~^~ literal 0 HcmV?d00001 diff --git a/resources/Visu_slider_next.png b/resources/Visu_slider_next.png new file mode 100644 index 0000000000000000000000000000000000000000..1cca9a88973fdc060b6b5ede7bde69cb0e285208 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^*SKZ4cv;u}Z{7eD3ifny46!)<_R2xd0|q?KfttVH z|Jm%&^D61Y!moi3+&d1inV5Pve@;DPHrHm~8{UYdg19xGex%15h+SY*PV;V<|0J7> pEBD)i3(qPSo>D#e|LTtJT)TJ^Wy=JCSwQ0%JYD@<);T3K0RaDrL{0zz literal 0 HcmV?d00001 diff --git a/resources/Visu_slider_pause.png b/resources/Visu_slider_pause.png new file mode 100644 index 0000000000000000000000000000000000000000..fea48a1e4be8174bf0e131c5c000e2b3e1c289d7 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^*SKZ4c$MovvH1dp96eneLo7}w|M~ylo_Q;SFtg}E z4#OVS*$T?a%3f=LqVol3OI+0Z&40Azh+A^8%Ti-DAaGMU8t}y3ySLGlhavogkm4=d S^L#+V7(8A5T-G@yGywp9jWXW= literal 0 HcmV?d00001 diff --git a/resources/Visu_slider_play.png b/resources/Visu_slider_play.png new file mode 100644 index 0000000000000000000000000000000000000000..7bd655fe8e21842cc95c479c85b8af6dedc02ef7 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^*SKZ4n2rA&vtAAqiu81G46!)<_KG9d0RsUh2i>3l zr@vKfoO3I5*K~*40}tFdR2OQCOBE})1+6_B^x?0M?*-S_=9k@mvl&FCWsB*$w-nA4 u+MihCR;@JlhJWz^bEGqODr>9nPfY|`!r #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; -- 2.39.2