From: vsr Date: Tue, 21 Aug 2007 13:28:52 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: qt4_porting_delivery_220807~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a719d6582de995784859ca9cae02bfbe4a752519;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index a2f573213..0927f0745 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -1892,6 +1892,35 @@ int QtxWorkstack::accel( const int id ) const return res; } +/*! + \brief Get icon for the specified action. + + If \a id is invalid, null icon is returned. + + \param id menu action ID + \return menu item icon +*/ +QIcon QtxWorkstack::icon( const int id ) const +{ + QIcon ico; + if ( myActionsMap.contains( id ) ) + ico = myActionsMap[id]->icon(); + return ico; +} + +/*! + \brief Set menu item icon for the specified action. + \param id menu action ID + \param ico new menu item icon +*/ +void QtxWorkstack::setIcon( const int id, const QIcon& icon ) +{ + if ( !myActionsMap.contains( id ) ) + return; + + myActionsMap[id]->setIcon( icon ); +} + /*! \brief Set actions to be visible in the context popup menu. diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index e4ae55381..d549965d3 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -79,6 +79,9 @@ public: int accel( const int ) const; void setAccel( const int, const int ); + QIcon icon( const int ) const; + void setIcon( const int, const QIcon& ); + void setMenuActions( const int ); int menuActions() const; diff --git a/src/STD/STD_TabDesktop.cxx b/src/STD/STD_TabDesktop.cxx index d66c6c94f..cf98dad7a 100644 --- a/src/STD/STD_TabDesktop.cxx +++ b/src/STD/STD_TabDesktop.cxx @@ -56,6 +56,16 @@ myWorkstackAction( 0 ) myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H ); myWorkstack->setAccel( QtxWorkstack::Close, Qt::SHIFT + Qt::Key_C ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + if ( resMgr ) { + myWorkstack->setIcon( QtxWorkstack::SplitVertical, + resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) ); + myWorkstack->setIcon( QtxWorkstack::SplitHorizontal, + resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) ); + myWorkstack->setIcon( QtxWorkstack::Close, + resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) )); + } + connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) ); @@ -190,12 +200,14 @@ void STD_TabDesktop::createActions() resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) ); myWorkstackAction->setText( QtxWorkstackAction::SplitHorizontal, tr( "MEN_DESK_WINDOW_HSPLIT" ) ); myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitHorizontal, tr( "PRP_DESK_WINDOW_HSPLIT" ) ); + myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::SHIFT + Qt::Key_H ); // Split Vertical myWorkstackAction->setIcon( QtxWorkstackAction::SplitVertical, resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) ); myWorkstackAction->setText( QtxWorkstackAction::SplitVertical, tr( "MEN_DESK_WINDOW_VSPLIT" ) ); myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) ); + myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical, Qt::SHIFT + Qt::Key_V ); QtxActionMenuMgr* mMgr = menuMgr(); if ( !mMgr )