Commit 21145c14 authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Added tabbing capabilities for detached views.

parent b79a47be
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@
#include <QDateTime>
#include <QTreeView>
#include <QVariant>
#include <QTabWidget>


#include "AbstractProjectItemView.h"
#include "Directory.h"
@@ -85,6 +87,8 @@ namespace Isis {

    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);
    setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
    //setDockOptions(GroupedDragging | AllowTabbedDocks);
    //centralWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    //centralWidget->hide();
    setDockNestingEnabled(true);
@@ -344,7 +348,7 @@ namespace Isis {
    m_permToolBarActions.append(exitAction);

    QAction *tabViewsAction = new QAction("Tab Views", this);
    connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabAllViews()) );
    connect( tabViewsAction, SIGNAL(triggered()), this, SLOT(tabViews()) );
    m_viewMenuActions.append(tabViewsAction);

    QAction *saveNet = new QAction("&Save Active Control Network", this);
@@ -493,7 +497,7 @@ namespace Isis {
   * from an internal list of QActions and the Directory.
   */
  void IpceMainWindow::createToolBars() {
    m_permToolBar = new QToolBar(this);
    m_permToolBar = new QToolBar("Permanent Toolbar", this);
    m_activeToolBar = new QToolBar(this);
    m_toolPad = new QToolBar(this);

@@ -813,11 +817,18 @@ namespace Isis {


  /**
   * Tabs all views inside of the main window.
   * Tabs all open attached/detached views
   */
  void IpceMainWindow::tabAllViews() {
  void IpceMainWindow::tabViews() {
    // tabifyDockWidget() takes two widgets and tabs them, so an easy way to do
    // this is to grab the first view and tab 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 tabbed. If it is attached,
      // this will have no affect.
      currentView->setFloating(false);

      if (currentView == firstView) {
        continue;
      }
+9 −1
Original line number Diff line number Diff line
@@ -141,6 +141,14 @@ namespace Isis {
   *   @history 2018-06-15 Tracie Sucharski - Fixed break to recent projects.  The readSettings
   *                           must be called before initializeActions to get the recent projects
   *                           from the config file.
   *   @history 2018-06-19 Kaitlyn Lee - Added tabViews() and the menu option under the View menu to
   *                           tab the views. Currently, this can tab all attached/detached views. I
   *                           left the line setting dock options to allow grouped dragging, but tabbing
   *                           views does not always work with this enabled. With this option enabled, the
   *                           type of a view will randomly change and setting its type has no effect.
   *                           Use windowType() to get the type. Also added the toolbar title in the
   *                           permanent toolbar constructor. 
   *
   *
   */
  class IpceMainWindow : public QMainWindow {
@@ -166,7 +174,7 @@ namespace Isis {
      void configureThreadLimit();
      void enterWhatsThisMode();

      void tabAllViews();
      void tabViews();

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