Skip to content

Commit

Permalink
Use external input color
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Feb 7, 2024
1 parent 89333f2 commit e4d00ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
27 changes: 8 additions & 19 deletions ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonInView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "RimTools.h"
#include "WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.h"

#include "RiuGuiTheme.h"
#include "RivPolylinePartMgr.h"

#include "WellPathCommands/RicPolylineTargetsPickEventHandler.h"
Expand Down Expand Up @@ -320,7 +321,7 @@ void RimPolygonInView::defineEditorAttribute( const caf::PdmFieldHandle* field,

if ( m_enablePicking )
{
tvAttribute->baseColor.setRgb( 255, 220, 255 );
tvAttribute->baseColor = RiuGuiTheme::getColorByVariableName( "externalInputColor" );
tvAttribute->alwaysEnforceResizePolicy = true;
}
}
Expand All @@ -346,25 +347,13 @@ void RimPolygonInView::defineCustomContextMenu( const caf::PdmFieldHandle* field
//--------------------------------------------------------------------------------------------------
void RimPolygonInView::updateNameField()
{
/*
m_targets.deleteChildren();
QString name = "Undefined";
if ( m_polygon() )
{
name = m_polygon->name();
for ( auto p : m_polygon->pointsInDomainCoords() )
{
auto target = new RimPolylineTarget();
target->setAsPointXYZ( p );
m_targets.push_back( target );
}
}
QString name = "Undefined";
if ( m_polygon() )
{
name = m_polygon->name();
}

setName( name );
*/
setName( name );
}

//--------------------------------------------------------------------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiTableViewEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,14 @@ void PdmUiTableViewEditor::configureAndUpdateUi( const QString& uiConfigName )
this->setRowSelectionLevel( editorAttrib.rowSelectionLevel );
this->enableHeaderText( editorAttrib.enableHeaderText );

QPalette myPalette( m_tableView->palette() );
myPalette.setColor( QPalette::Base, editorAttrib.baseColor );
m_tableView->setPalette( myPalette );
m_tableView->repaint();
if ( editorAttrib.baseColor.isValid() )
{
m_tableView->setStyleSheet( QString( "background-color: %1;" ).arg( editorAttrib.baseColor.name() ) );
}
else
{
m_tableView->setStyleSheet( "" );
}

// Drop target settings
m_tableView->setAcceptDrops( editorAttrib.enableDropTarget );
Expand Down
3 changes: 0 additions & 3 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiTableViewEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,8 @@ class PdmUiTableViewEditorAttribute : public PdmUiEditorAttribute
, resizePolicy( NO_AUTOMATIC_RESIZE )
, enableDropTarget( false )
{
QPalette myPalette;
baseColor = myPalette.color( QPalette::Active, QPalette::Base );
}

int selectionLevel;
int tableSelectionLevel;
int rowSelectionLevel;
bool enableHeaderText;
Expand Down

0 comments on commit e4d00ee

Please sign in to comment.