mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 14:17:52 -05:00
#12925: Add Curve Appearance dock window
This commit is contained in:
1 parent
625d7e684e
commit
c7473c2549
4 files changed
+51
No files matched your search
@@ -175,6 +175,14 @@ QString RiuDockWidgetTools::plotMainWindowPlotManagerName()
|
||||
return "dockSummaryPlotManager";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::plotMainWindowCurveAppearanceName()
|
||||
{
|
||||
return "dockCurveAppearance";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -419,6 +427,8 @@ QIcon RiuDockWidgetTools::dockIcon( const QString dockWidgetName )
|
||||
return QIcon( ":/undo-stack.svg" );
|
||||
else if ( dockWidgetName == plotMainWindowPlotManagerName() )
|
||||
return QIcon( ":/plot-manager.svg" );
|
||||
else if ( dockWidgetName == plotMainWindowCurveAppearanceName() )
|
||||
return QIcon( ":/property-editor.svg" );
|
||||
else if ( dockWidgetName == mainWindowPropertyEditorName() )
|
||||
return QIcon( ":/property-editor.svg" );
|
||||
else if ( dockWidgetName == mainWindowResultInfoName() )
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
static QString plotMainWindowMessagesName();
|
||||
static QString plotMainWindowUndoStackName();
|
||||
static QString plotMainWindowPlotManagerName();
|
||||
static QString plotMainWindowCurveAppearanceName();
|
||||
static QString plotWindowQuickAccessName();
|
||||
|
||||
static QString dockState3DEclipseName();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "Histogram/RimHistogramMultiPlot.h"
|
||||
#include "Histogram/RimHistogramPlot.h"
|
||||
#include "RimCurveStyleRules.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlot.h"
|
||||
@@ -78,6 +79,7 @@
|
||||
#include "DockManager.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QFrame>
|
||||
#include <QLayout>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
@@ -125,6 +127,7 @@ RiuPlotMainWindow::~RiuPlotMainWindow()
|
||||
setBeingDestroyed();
|
||||
|
||||
m_summaryPlotManagerView->showProperties( nullptr );
|
||||
m_curveStyleRulesView->showProperties( nullptr );
|
||||
setPdmRoot( nullptr );
|
||||
}
|
||||
|
||||
@@ -169,6 +172,8 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
||||
setPdmRoot( RimProject::current() );
|
||||
restoreTreeViewState();
|
||||
|
||||
m_curveStyleRulesView->showProperties( RimProject::current()->curveStyleRules() );
|
||||
|
||||
RimMainPlotCollection* mainPlotColl = RimMainPlotCollection::current();
|
||||
mainPlotColl->ensureDefaultFlowPlotsAreCreated();
|
||||
|
||||
@@ -242,6 +247,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
|
||||
{
|
||||
pdmUiPropertyView->showProperties( nullptr );
|
||||
}
|
||||
m_curveStyleRulesView->showProperties( nullptr );
|
||||
|
||||
cleanUpTemporaryWidgets();
|
||||
|
||||
@@ -592,6 +598,16 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
rightWidgets.push_back( dockWidget );
|
||||
}
|
||||
|
||||
// the global curve appearance and per item rules, stored in the project
|
||||
{
|
||||
auto dockWidget =
|
||||
RiuDockWidgetTools::createDockWidget( "Curve Appearance", RiuDockWidgetTools::plotMainWindowCurveAppearanceName(), dockManager() );
|
||||
|
||||
m_curveStyleRulesView = std::make_unique<caf::PdmUiPropertyView>( dockWidget );
|
||||
dockWidget->setWidget( m_curveStyleRulesView.get() );
|
||||
rightWidgets.push_back( dockWidget );
|
||||
}
|
||||
|
||||
// the undo stack
|
||||
if ( m_undoView && RiaPreferences::current()->useUndoRedo() )
|
||||
{
|
||||
@@ -766,6 +782,28 @@ RiuMessagePanel* RiuPlotMainWindow::messagePanel()
|
||||
return m_messagePanel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::showCurveAppearance()
|
||||
{
|
||||
auto dockWidget = RiuDockWidgetTools::findDockWidget( dockManager(), RiuDockWidgetTools::plotMainWindowCurveAppearanceName() );
|
||||
if ( !dockWidget ) return;
|
||||
|
||||
dockWidget->toggleView( true );
|
||||
dockWidget->raise();
|
||||
dockWidget->setAsCurrentTab();
|
||||
|
||||
// Briefly outline the dock edges so the user sees where the settings are, also when it was already visible
|
||||
auto outline = new QFrame( dockWidget );
|
||||
outline->setAttribute( Qt::WA_TransparentForMouseEvents );
|
||||
outline->setStyleSheet( "QFrame { background: transparent; border: 3px solid rgb(255, 160, 0); }" );
|
||||
outline->setGeometry( dockWidget->rect() );
|
||||
outline->show();
|
||||
outline->raise();
|
||||
QTimer::singleShot( 1000, outline, &QObject::deleteLater );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
RiuMessagePanel* messagePanel();
|
||||
|
||||
void showAndSetKeyboardFocusToSummaryPlotManager();
|
||||
void showCurveAppearance();
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent* event ) override;
|
||||
@@ -130,6 +131,7 @@ private:
|
||||
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotLayoutToolBarEditor;
|
||||
|
||||
std::unique_ptr<caf::PdmUiPropertyView> m_summaryPlotManagerView;
|
||||
std::unique_ptr<caf::PdmUiPropertyView> m_curveStyleRulesView;
|
||||
|
||||
std::unique_ptr<RicSummaryPlotEditorDialog> m_summaryCurveCreatorDialog;
|
||||
std::unique_ptr<RicSummaryCurveCalculatorDialog> m_summaryCurveCalculatorDialog;
|
||||
|
||||
Reference in new issue
Block a user