Unverified Commit c48b8344 authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Merge pull request #334 from kdl222/tileViews

Added the capability to tile all docked/undocked and tabbed views in ipce
parents a80cd0be d83e84b3
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -353,6 +353,10 @@ namespace Isis {
    connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabViews()) );
    m_viewMenuActions.append(tabViewsAction);

    QAction *tileViewsAction = new QAction("Tile Views", this);
    connect( tileViewsAction, SIGNAL(triggered()), this, SLOT(tileViews()) );
    m_viewMenuActions.append(tileViewsAction);

    QAction *undoAction = m_directory->undoAction();
    undoAction->setShortcut(Qt::Key_Z | Qt::CTRL);

@@ -813,6 +817,28 @@ namespace Isis {
  }


  /**
   * Tile all open attached/detached views
   */
  void IpceMainWindow::tileViews() {
    // splitDockWidget() takes two widgets and tiles them, so an easy way to do
    // this is to grab the first view and tile the rest with the first.
    QDockWidget *firstView = m_viewDocks.first();

    foreach (QDockWidget *currentView, m_viewDocks) {
      // We have to reattach a view before it can be tiled. If it is attached,
      // this will have no affect. We have to call addDockWidget() to untab any views.
      currentView->setFloating(false);
      addDockWidget(Qt::LeftDockWidgetArea, currentView, Qt::Horizontal);

      if (currentView == firstView) {
        continue;
      }
      splitDockWidget(firstView, currentView, Qt::Horizontal);
    }
  }


/**
 * Raises the warningWidget to the front of the tabs. Connected to warning signal from directory.
 */
+5 −1
Original line number Diff line number Diff line
@@ -159,6 +159,9 @@ namespace Isis {
   *                           state can be reset after the IpceMainWindow::show() causes resize and
   *                           move events which in turn cause the project clean flag to be false
   *                           even though the project has just opened.
   *   @history 2018-07-05 Kaitlyn Lee - Added tilViews() and the menu option to tile all docked/undocked
   *                           and tabbed/untabbed views.

   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
@@ -186,6 +189,7 @@ namespace Isis {
      void enterWhatsThisMode();

      void tabViews();
      void tileViews();

      void raiseWarningTab();
      void cleanupViewDockList(QObject *obj);