Commit a37f81fb authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Made some visual changes to ipce and fixed the problem of a project's size not...

Made some visual changes to ipce and fixed the problem of a project's size not restoring when opening from the command line.
parent 5faa6a26
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -80,17 +80,6 @@ namespace Isis {
      QMainWindow(parent) {
    m_maxThreadCount = -1;

    //  Set the initialize size of the mainwindow to fullscreen so that created views do not
    //  get squished.  Saved projects with view had the internal widgets squished because the
    //  initial size of this mainwindow was small and it does not get restored to the saved project
    //  size until after views are created.  For instance, the viewports within a CubeDnView were
    //  restored to a small size based on the original mainwindow size.  If the internal state
    //  of the views such as the viewport sizes, zooms, etc get serialized, this code will not be
    //  needed.
    QDesktopWidget deskTop;
    QRect mainScreenSize = deskTop.availableGeometry(deskTop.primaryScreen());
    resize(mainScreenSize.width(), mainScreenSize.height());

    QWidget *centralWidget = new QWidget;
    setCentralWidget(centralWidget);
    setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::South);
@@ -99,7 +88,7 @@ namespace Isis {
    setDockNestingEnabled(true);

    //  Set the splitter frames to a reasonable color/size for resizing the docks.
    setStyleSheet("QMainWindow::separator {background: gray; width: 10; height: 10px;}");
    setStyleSheet("QMainWindow::separator {background: black; width: 3; height: 3px;}");

    try {
      m_directory = new Directory(this);
@@ -529,7 +518,12 @@ namespace Isis {
    QSettings globalSettings(FileName("$HOME/.Isis/" + appName + "/ipce.config").expanded(),
        QSettings::NativeFormat);

    if (project->isTemporaryProject()) {
    // If no config file exists and a user immediately opens a project,
    // the project's geometry will be saved as a default for when ipce is
    // opened again. Previously, the ipce's default size was small,
    // until a user opened ipce (but not a project) and resized to how they
    // wanted it to be sized, then closed ipce.
    if (project->isTemporaryProject() || !globalSettings.contains("geometry")) {
      globalSettings.setValue("geometry", QVariant(geometry()));
    }

+8 −1
Original line number Diff line number Diff line
@@ -167,6 +167,13 @@ namespace Isis {
   *                           project was in fullscreen or not when saved. If not, we call showNormal()
   *                           to restore the poject's window size. This also fixes the warning/history tabs
   *                           being misplaced when opening a project. Fixes #5175.
   *   @history 2018-07-12 Kaitlyn Lee - Removed code that makes the window fullscreen in memory, since this
   *                           was causing a project's window size to not be restored when opening from the
   *                           command line. Decreased the size and changed the color of the splitter.
   *                           In writeGlobalSettings(), check to see if the geometry value does not exist
   *                           in the config file. This allows the geometry to be saved if the config file
   *                           does not exist and a user opens a project. Before, it would not save the
   *                           geometry because the opened project was not temporary. References #5433
   */
  class IpceMainWindow : public QMainWindow {
      Q_OBJECT
+7 −5
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@

#include <QAction>
#include <QDebug>
#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QList>
#include <QMainWindow>
#include <QRect>
#include <QSizePolicy>
#include <QWidget>

@@ -64,11 +66,11 @@ namespace Isis {
   */
  QSize AbstractProjectItemView::sizeHint() const {

    //  Size hint is make ridiculously large as a hack to have the views fill the available dock
    //  Size hint is made ridiculously large as a hack to have the views fill the available dock
    //  space. SizePolicy alone did not work.
    // TODO:  There should be a better way to do this.
    //return QSize(800, 600);
    return QSize(3000, 1500);
    QDesktopWidget deskTop;
    QRect availableSpace = deskTop.availableGeometry(deskTop.primaryScreen());
    return QSize( .89 * availableSpace.width(), .5 * availableSpace.height() );
  }


+3 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ namespace Isis {
   *                           sizeHint() is because using sizePolicy with a reasonable sizeHint did
   *                           not work to have views fill the available space in the dock area.
   *                           References #5433.
   *   @history 2018-07-12 Kaitlyn Lee - Changed the sizeHint to be calculated based on the deskTop size,
   *                           instead of being hard-coded. The percentages chosen allow for 2 CubeDnViews
   *                           to be opened at once, since CubeDnView has an internal size policy. References #5433
   */
  class AbstractProjectItemView : public QMainWindow {

+19 −10
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@
#include "ProjectItemTreeView.h"

#include <QAbstractItemView>
#include <QDesktopWidget>
#include <QEvent>
#include <QObject>
#include <QRect>
#include <QTreeView>
#include <QVBoxLayout>
#include <QWidget>
@@ -53,7 +55,7 @@ namespace Isis {
    setCentralWidget(m_treeView);

    //This works so that it cannot be shrunk, only grown
    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    //  Currently set all items on view to un-editable
    //m_treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
@@ -62,8 +64,15 @@ namespace Isis {
  }


  /**
   * Returns the suggested size
   *
   * @return @b QSize The size hint
   */
  QSize ProjectItemTreeView::sizeHint() const {
    return QSize(350,1200);
    QDesktopWidget deskTop;
    QRect availableSpace = deskTop.availableGeometry(deskTop.primaryScreen());
    return QSize(.11 * availableSpace.width(), .5 * availableSpace.height());
  }


Loading