Commit 625237ea authored by Frédéric Larue's avatar Frédéric Larue

Color map selector button added to the UIParamGradient.

parent a238e980
......@@ -12,6 +12,7 @@ add_library( ${PROJECT_NAME} SHARED ${LIB_HEADERS} ${LIB_SOURCES} )
target_link_libraries( ${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
UIParam
UISettings
)
......
......@@ -11,6 +11,11 @@ file( GLOB LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp )
add_library( ${PROJECT_NAME} ${LIB_HEADERS} ${LIB_SOURCES} )
target_link_libraries( ${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
Widgets
)
if( ENABLE_SOLUTION_FOLDERS )
set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER "Core" )
......
......@@ -7,7 +7,8 @@
#include "UIParamGradient.h"
//#include ""
#include "ColorMapSelectionDialog.h"
#include "UISettings.h"
......@@ -39,5 +40,21 @@ void UIParamGradient::InitWidget( GradientWidget *gdtWidget )
void UIParamGradient::openColorMapSelector()
{
// ColorMapSele
// Create the dialog window with a minimum width of 25% of the screen size.
ColorMapSelectionDialog dlg( (QWidget*) Widget()->parent(), Widget()->ValueString() );
int thisScreenId = QApplication::desktop()->screenNumber( (QWidget*) Widget()->parent() );
QWidget *thisScreen = QApplication::desktop()->screen( thisScreenId );
dlg.setMinimumWidth( thisScreen->width()/4 );
if( dlg.exec() == QDialog::Accepted )
{
SetValueString( dlg.valueString() );
QSettings *settings = UI::GetUserSettings();
settings->beginGroup( "ColorMaps" );
settings->setValue( "attrMngrColorMap", dlg.valueString() );
settings->endGroup();
}
}
......@@ -18,6 +18,11 @@
class UIParamGradient : public UIParam
{
Q_OBJECT
private:
void InitWidget( GradientWidget *gdtWidget );
public:
inline UIParamGradient( const QString& id,
const QString& name,
......@@ -41,6 +46,9 @@ public:
inline virtual QString ValueString() const;
inline virtual bool SetValueString( const QString &valueString );
private slots:
void openColorMapSelector();
};
......@@ -50,9 +58,7 @@ inline UIParamGradient::UIParamGradient( const QString& id,
const QColor& color0,
const QColor& color1 ) : UIParam(id,name,description)
{
m_Widget = new GradientWidget( color0, color1 );
if( !m_Description.isNull() && !m_Description.isEmpty() )
m_Widget->setToolTip( m_Description );
InitWidget( new GradientWidget( color0, color1 ) );
}
......@@ -62,14 +68,12 @@ inline UIParamGradient::UIParamGradient( const QString& id,
const QList<QColor>& colors,
const QList<float>& values ) : UIParam(id,name,description)
{
m_Widget = new GradientWidget( colors, values );
if( !m_Description.isNull() && !m_Description.isEmpty() )
m_Widget->setToolTip( m_Description );
InitWidget( new GradientWidget( colors, values ) );
}
inline void UIParamGradient::ArrangeInLayout( QGridLayout *l, int line )
{
l->addWidget( m_Widget, line,0, 1,2 );
l->addWidget( (QWidget*) m_Widget->parent(), line,0, 1,2 );
}
inline void UIParamGradient::ConnectModificationSignal()
......
......@@ -14,10 +14,9 @@
#include <QtWidgets>
#include "GradientWidget.h"
#include "GUI_mainDefs.h"
class GUIMAIN_API ColorMapSelectionDialog : public QDialog
class ColorMapSelectionDialog : public QDialog
{
Q_OBJECT
......
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