Commit e97af1d7 authored by Stefan Philips's avatar Stefan Philips
Browse files

[MERGE]

parents de22c555 b568e138
......@@ -124,7 +124,7 @@ WQtColormapper::~WQtColormapper()
m_sortConnection.disconnect();
}
WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGETexture3D > texture, WQtColormapper* cmapper, QListWidget* parent ):
WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGETexture3D > texture, WQtColormapper* /*cmapper*/, QListWidget* parent ):
QListWidgetItem( parent ),
m_texture( texture ),
m_parent( parent )
......@@ -151,10 +151,10 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
QHBoxLayout* labelContainerLayout = new QHBoxLayout();
labelContainer->setLayout( labelContainerLayout );
WScaleLabel* l = new WScaleLabel( QString::fromStdString( m_texture->name()->get() ), 5, labelContainer );
l->setTextInteractionFlags( Qt::NoTextInteraction );
l->setToolTip( "The name of this texture. This usually is the name of the file it was loaded from." );
labelContainerLayout->addWidget( l );
WPropertyStringWidget* nameLabel = new WPropertyStringWidget( m_texture->name(), NULL, m_itemWidget );
nameLabel->setToolTip( "The name of this texture. This usually is the name of the file it was loaded from." );
labelContainerLayout->addWidget( nameLabel );
// alpha property
WPropertyDoubleWidget* alpha = new WPropertyDoubleWidget( m_texture->alpha(), NULL, m_itemWidget );
......@@ -207,7 +207,7 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
propActionBtn->setStyleSheet( "background-color:" + propertyCol.name() + ";" );
active->setStyleSheet( "background-color:" + labelCol.name() + ";" );
alpha->setStyleSheet( "#ControlPanelPropertyWidget{ background-color:" + propertyCol.name() + ";}" );
l->setStyleSheet( "background-color:" + labelCol.name() + ";" );
nameLabel->setStyleSheet( "background-color:" + labelCol.name() + ";border:none;" );
labelContainer->setStyleSheet( "background-color:" + labelCol.name() + ";" );
// fill layout
......@@ -232,16 +232,11 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
// widget size constraints and policies
m_itemWidget->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
// we need to know the name of the texture
m_nameConnection = m_texture->name()->getUpdateCondition()->subscribeSignal(
boost::bind( &WQtColormapper::pushUpdateEvent, cmapper )
);
}
WQtColormapper::WQtTextureListItem::~WQtTextureListItem()
{
m_nameConnection.disconnect();
// cleanup
}
const osg::ref_ptr< WGETexture3D > WQtColormapper::WQtTextureListItem::getTexture() const
......@@ -257,7 +252,7 @@ QWidget* WQtColormapper::WQtTextureListItem::getWidget() const
void WQtColormapper::pushUpdateEvent()
{
// create a new event for this and insert it into event queue
QCoreApplication::postEvent( this, new WUpdateTextureSorterEvent() );
QCoreApplication::postEvent( this, new WUpdateTextureSorterEvent() );
}
bool WQtColormapper::event( QEvent* event )
......
......@@ -164,11 +164,6 @@ private:
*/
const osg::ref_ptr< WGETexture3D > m_texture;
/**
* Connection for the texture's name property
*/
boost::signals2::connection m_nameConnection;
/**
* Parent list.
*/
......
......@@ -143,13 +143,21 @@ void WQtMenuFiltered::filterUpdate()
// match value against filter
if( match )
{
( *a )->setVisible( true );
#ifdef __APPLE__
( *a )->setDisabled( false );
#else
( *a )->setVisible( true );
#endif
nbLeft++;
lastVisibleAction = *a;
}
else
{
( *a )->setVisible( false );
#ifdef __APPLE__
( *a )->setDisabled( true );
#else
( *a )->setVisible( false );
#endif
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment