mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
@@ -0,0 +1,6 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="4" y="4" width="16" height="12" rx="2"
|
||||
fill="#DCEBFF" stroke="#4F8EF7" stroke-width="2"/>
|
||||
<rect x="12" y="12" width="16" height="12" rx="2"
|
||||
fill="#FFF0CC" stroke="#F5A623" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 310 B |
@@ -96,7 +96,8 @@
|
||||
<file>Legend.png</file>
|
||||
<file>LinkView.svg</file>
|
||||
<file>MainGrid16x16.png</file>
|
||||
<file>MasterView16x16.png</file>
|
||||
<file>MaximizeWindows.svg</file>
|
||||
<file>MasterView16x16.png</file>
|
||||
<file>Minus.png</file>
|
||||
<file>NorthView.svg</file>
|
||||
<file>MultiPlot16x16.png</file>
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M 15 1 L 1 1 L 0.462 1.538 L 0.462 12.308 L 1 12.846 L 6.924 12.846 L 6.924 13.923 L 3.693 13.923 L 3.693 15 L 12.308 15 L 12.308 13.923 L 9.077 13.923 L 9.077 12.846 L 15 12.846 L 15.539 12.308 L 15.539 1.538 L 15 1 Z M 14.462 11.769 L 1.539 11.769 L 1.539 2.077 L 14.462 2.077 L 14.462 11.769 Z" style="fill: rgb(128, 128, 128);"/>
|
||||
<rect x="7.977" y="2.159" width="6.492" height="5.26" style="stroke: rgb(0, 0, 0); stroke-width: 0.2px; fill: rgb(251, 176, 0);"/>
|
||||
<rect x="8.026" y="2.194" width="6.407" height="1.124" style="stroke: rgb(0, 0, 0); stroke-width: 0.1px; fill: rgb(205, 205, 205);"/>
|
||||
<rect x="1.5" y="2.16" width="6.492" height="5.26" style="stroke: rgb(0, 0, 0); stroke-width: 0.2px; fill: rgb(117, 190, 255);"/>
|
||||
<rect x="1.55" y="2.195" width="6.407" height="1.124" style="stroke: rgb(0, 0, 0); stroke-width: 0.1px; fill: rgb(205, 205, 205);"/>
|
||||
<rect x="1.485" y="6.94" width="6.492" height="4.918" style="stroke: rgb(0, 0, 0); stroke-width: 0.2px; fill: rgb(174, 78, 151);"/>
|
||||
<rect x="1.535" y="6.973" width="6.407" height="0.918" style="stroke: rgb(0, 0, 0); stroke-width: 0.1px; fill: rgb(205, 205, 205);"/>
|
||||
<rect x="7.977" y="6.916" width="6.492" height="4.943" style="stroke: rgb(0, 0, 0); stroke-width: 0.2px; fill: rgb(137, 209, 133);"/>
|
||||
<rect x="8.026" y="6.949" width="6.407" height="0.936" style="stroke: rgb(0, 0, 0); stroke-width: 0.1px; fill: rgb(205, 205, 205);"/>
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Top Left Window -->
|
||||
<rect x="2" y="2" width="13" height="13" rx="2" fill="#4F8EF7"/>
|
||||
<rect x="2" y="2" width="13" height="3" rx="2" fill="#2D6CDF"/>
|
||||
<circle cx="4.5" cy="3.5" r="0.5" fill="white"/>
|
||||
<circle cx="6.5" cy="3.5" r="0.5" fill="white"/>
|
||||
|
||||
<!-- Top Right Window -->
|
||||
<rect x="17" y="2" width="13" height="13" rx="2" fill="#34C759"/>
|
||||
<rect x="17" y="2" width="13" height="3" rx="2" fill="#23A847"/>
|
||||
<circle cx="19.5" cy="3.5" r="0.5" fill="white"/>
|
||||
<circle cx="21.5" cy="3.5" r="0.5" fill="white"/>
|
||||
|
||||
<!-- Bottom Left Window -->
|
||||
<rect x="2" y="17" width="13" height="13" rx="2" fill="#FF9500"/>
|
||||
<rect x="2" y="17" width="13" height="3" rx="2" fill="#E07F00"/>
|
||||
<circle cx="4.5" cy="18.5" r="0.5" fill="white"/>
|
||||
<circle cx="6.5" cy="18.5" r="0.5" fill="white"/>
|
||||
|
||||
<!-- Bottom Right Window -->
|
||||
<rect x="17" y="17" width="13" height="13" rx="2" fill="#AF52DE"/>
|
||||
<rect x="17" y="17" width="13" height="3" rx="2" fill="#8E44BE"/>
|
||||
<circle cx="19.5" cy="18.5" r="0.5" fill="white"/>
|
||||
<circle cx="21.5" cy="18.5" r="0.5" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -638,6 +638,9 @@ void RiuMainWindow::createToolBars()
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicShowPlotWindowFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicLinkVisibleViewsFeature" ) );
|
||||
toolbar->addAction( cmdFeatureMgr->action( "RicShowGridCalculatorFeature" ) );
|
||||
toolbar->addSeparator();
|
||||
toolbar->addAction( m_tileWindowsAction );
|
||||
toolbar->addAction( m_maximizeWindowsAction );
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "DockAreaTitleBar.h"
|
||||
#include "DockAreaWidget.h"
|
||||
#include "DockManager.h"
|
||||
#include "DockSplitter.h"
|
||||
#include "DockWidget.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -54,11 +55,16 @@
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QTextEdit>
|
||||
#include <QTimer>
|
||||
#include <QTreeView>
|
||||
#include <QUndoStack>
|
||||
#include <QUndoView>
|
||||
#include <QUuid>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -95,6 +101,14 @@ RiuMainWindowBase::RiuMainWindowBase()
|
||||
m_hideTabsAction->setCheckable( true );
|
||||
connect( m_hideTabsAction, SIGNAL( toggled( bool ) ), SLOT( slotHideTabs( bool ) ) );
|
||||
|
||||
m_tileWindowsAction = new QAction( QIcon( ":/TileWindows.svg" ), "Tile Windows", this );
|
||||
m_tileWindowsAction->setToolTip( "Tile All View Windows" );
|
||||
connect( m_tileWindowsAction, SIGNAL( triggered() ), SLOT( tileViewWindows() ) );
|
||||
|
||||
m_maximizeWindowsAction = new QAction( QIcon( ":/MaximizeWindows.svg" ), "Maximize Windows", this );
|
||||
m_maximizeWindowsAction->setToolTip( "Maximize All View Windows" );
|
||||
connect( m_maximizeWindowsAction, SIGNAL( triggered() ), SLOT( maximizeViewWindows() ) );
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if ( RiaPreferences::current()->guiTheme() == RiaDefines::ThemeEnum::DARK )
|
||||
{
|
||||
@@ -775,6 +789,10 @@ void RiuMainWindowBase::addDefaultEntriesToWindowsMenu()
|
||||
QAction* exportLayoutAction = m_windowMenu->addAction( "Export Layout to Clipboard" );
|
||||
connect( exportLayoutAction, SIGNAL( triggered() ), this, SLOT( exportDockLayout() ) );
|
||||
}
|
||||
|
||||
m_windowMenu->addSeparator();
|
||||
m_windowMenu->addAction( m_tileWindowsAction );
|
||||
m_windowMenu->addAction( m_maximizeWindowsAction );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -849,3 +867,125 @@ void RiuMainWindowBase::slotHideTabs( bool hideTabs )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::tileViewWindows()
|
||||
{
|
||||
// predefined grid size map for tiling of windows: number of views -> (columns, rows) in grid, max 25 views
|
||||
static std::map<int, std::pair<int, int>> gridSizeMap = { { 1, { 1, 1 } }, { 2, { 2, 1 } }, { 3, { 3, 1 } }, { 4, { 2, 2 } },
|
||||
{ 5, { 3, 2 } }, { 6, { 3, 2 } }, { 7, { 3, 3 } }, { 8, { 3, 3 } },
|
||||
{ 9, { 3, 3 } }, { 10, { 4, 3 } }, { 11, { 4, 3 } }, { 12, { 4, 3 } },
|
||||
{ 13, { 4, 4 } }, { 14, { 4, 4 } }, { 15, { 4, 4 } }, { 16, { 4, 4 } },
|
||||
{ 17, { 5, 4 } }, { 18, { 5, 4 } }, { 19, { 5, 4 } }, { 20, { 5, 4 } },
|
||||
{ 21, { 5, 5 } }, { 22, { 5, 5 } }, { 23, { 5, 5 } }, { 24, { 5, 5 } },
|
||||
{ 25, { 5, 5 } } };
|
||||
|
||||
// stores the views to tile
|
||||
std::vector<RimViewWindow*> tiledWindows;
|
||||
|
||||
// remove all visible views from central dock area
|
||||
for ( auto view : viewWindows() )
|
||||
{
|
||||
if ( !view->dockWidget() ) continue;
|
||||
if ( !view->showWindow() ) continue;
|
||||
tiledWindows.push_back( view );
|
||||
m_dockManager->removeDockWidget( view->dockWidget() );
|
||||
}
|
||||
|
||||
// redock views in a grid layout
|
||||
const int nViews = (int)tiledWindows.size();
|
||||
const int nCols = gridSizeMap[nViews].first;
|
||||
const int nRows = gridSizeMap[nViews].second;
|
||||
|
||||
std::vector<std::vector<ads::CDockAreaWidget*>> areas( nRows, std::vector<ads::CDockAreaWidget*>( nCols ) );
|
||||
|
||||
int viewIndex = 0;
|
||||
|
||||
for ( int row = 0; row < nRows; row++ )
|
||||
{
|
||||
for ( int col = 0; col < nCols; col++ )
|
||||
{
|
||||
if ( viewIndex >= nViews ) break;
|
||||
if ( viewIndex >= 25 ) // limit to 25 views, see map above
|
||||
{
|
||||
tiledWindows[viewIndex++]->removeWindowFromDock();
|
||||
continue;
|
||||
}
|
||||
|
||||
auto view = tiledWindows[viewIndex++];
|
||||
auto dock = view->dockWidget();
|
||||
|
||||
if ( row == 0 && col == 0 )
|
||||
{
|
||||
areas[row][col] =
|
||||
m_dockManager->addDockWidget( ads::CenterDockWidgetArea, dock, m_dockManager->centralWidget()->dockAreaWidget() );
|
||||
}
|
||||
else if ( row == 0 )
|
||||
{
|
||||
areas[row][col] = m_dockManager->addDockWidget( ads::RightDockWidgetArea, dock, areas[row][col - 1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
areas[row][col] = m_dockManager->addDockWidget( ads::BottomDockWidgetArea, dock, areas[row - 1][col] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// build unique list of splitters used in the areas created
|
||||
std::set<ads::CDockSplitter*> splitters;
|
||||
|
||||
for ( auto arealist : areas )
|
||||
{
|
||||
for ( auto area : arealist )
|
||||
{
|
||||
if ( area && area->parentSplitter() )
|
||||
{
|
||||
splitters.insert( area->parentSplitter() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_dockManager->centralWidget() && m_dockManager->centralWidget()->dockAreaWidget() )
|
||||
{
|
||||
splitters.insert( m_dockManager->centralWidget()->dockAreaWidget()->parentSplitter() );
|
||||
}
|
||||
|
||||
// rebalance splitters after a short delay to allow the layout to be updated before setting sizes
|
||||
QTimer::singleShot( 10,
|
||||
this,
|
||||
[splitters]()
|
||||
{
|
||||
for ( QSplitter* splitter : splitters )
|
||||
{
|
||||
QList<int> sizes( splitter->count(), 1000 ); // size not important, just needs all to be equal
|
||||
splitter->setSizes( sizes );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::maximizeViewWindows()
|
||||
{
|
||||
// remove all active views from dock manager
|
||||
std::vector<RimViewWindow*> activeViews;
|
||||
for ( auto view : viewWindows() )
|
||||
{
|
||||
if ( !view->dockWidget() ) continue;
|
||||
if ( !view->showWindow() ) continue;
|
||||
activeViews.push_back( view );
|
||||
|
||||
m_dockManager->removeDockWidget( view->dockWidget() );
|
||||
}
|
||||
|
||||
// add all views to the center area
|
||||
for ( auto view : activeViews )
|
||||
{
|
||||
m_dockManager->addDockWidget( ads::DockWidgetArea::CenterDockWidgetArea,
|
||||
view->dockWidget(),
|
||||
m_dockManager->centralWidget()->dockAreaWidget() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,11 +135,17 @@ protected slots:
|
||||
void saveDockLayout();
|
||||
void exportDockLayout();
|
||||
|
||||
void tileViewWindows();
|
||||
void maximizeViewWindows();
|
||||
|
||||
protected:
|
||||
bool m_allowActiveViewChangeFromSelection; // To be used in selectedObjectsChanged() to control
|
||||
// whether to select the corresponding active view or not
|
||||
|
||||
QAction* m_hideTabsAction;
|
||||
QAction* m_hideTabsAction;
|
||||
QAction* m_tileWindowsAction;
|
||||
QAction* m_maximizeWindowsAction;
|
||||
|
||||
QAction* m_undoAction;
|
||||
QAction* m_redoAction;
|
||||
QUndoView* m_undoView;
|
||||
|
||||
@@ -537,6 +537,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
|
||||
dockWidget->setWidget( projectTree );
|
||||
dockWidget->hide();
|
||||
|
||||
projectTree->treeView()->setHeaderHidden( true );
|
||||
projectTree->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
|
||||
Reference in New Issue
Block a user