mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2798 Dock Widgets : Improve menus and handling of tabbed dock widgets
Create dock widgets based on static names Build Windows menu based on static names Wire up toggleView actions to RiuDockWidgetTools Change dock widget visibility based on view
This commit is contained in:
@@ -20,9 +20,13 @@
|
||||
|
||||
#include "RiaVersionInfo.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDockWidget>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -118,3 +122,24 @@ void RiuMainWindowBase::setExpanded(const caf::PdmUiItem* uiItem, bool expanded)
|
||||
{
|
||||
m_projectTreeView->setExpanded(uiItem, expanded);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::slotDockWidgetToggleViewActionTriggered()
|
||||
{
|
||||
if (!sender()) return;
|
||||
|
||||
auto dockWidget = dynamic_cast<QDockWidget*>(sender()->parent());
|
||||
if (dockWidget)
|
||||
{
|
||||
if (dockWidget->isVisible())
|
||||
{
|
||||
// Raise the dock widget to make it visible if the widget is part of a tab widget
|
||||
dockWidget->raise();
|
||||
}
|
||||
|
||||
RiuDockWidgetTools::instance()->setDockWidgetVisibility(dockWidget->objectName(), dockWidget->isVisible());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user