Commits

Ian Chen  committed f24ffcf

Update layout

  • Participants
  • Parent commits 9092591
  • Branches ian-building

Comments (0)

Files changed (8)

File gazebo/gui/MainWindow.cc

   if (isChecked)
   {
     this->Pause();
-    this->renderWidget->ShowEditor(1);
+    this->renderWidget->ShowEditor(true);
     this->tabWidget->hide();
     this->buildingEditorTabWidget->show();
   }
   else
   {
-    this->renderWidget->ShowEditor(0);
+    this->renderWidget->ShowEditor(false);
     this->tabWidget->show();
     this->buildingEditorTabWidget->hide();
     this->Play();

File gazebo/gui/RenderWidget.cc

   QHBoxLayout *playControlLayout = new QHBoxLayout;
   playControlLayout->setContentsMargins(0, 0, 0, 0);
 
-  QFrame *bottomFrame = new QFrame;
-  bottomFrame->setObjectName("renderBottomFrame");
-  bottomFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
+  this->bottomFrame = new QFrame;
+  this->bottomFrame->setObjectName("renderBottomFrame");
+  this->bottomFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
 
   QFrame *playFrame = new QFrame;
   QToolBar *playToolbar = new QToolBar;
                              QSizePolicy::Minimum));
   bottomPanelLayout->setSpacing(0);
   bottomPanelLayout->setContentsMargins(0, 0, 0, 0);
-  bottomFrame->setLayout(bottomPanelLayout);
+  this->bottomFrame->setLayout(bottomPanelLayout);
 
 
   QWidget *render3DWidget = new QWidget(this);
   splitter->setOrientation(Qt::Vertical);
 
   frameLayout->addWidget(splitter);
-  frameLayout->addWidget(bottomFrame);
+  frameLayout->addWidget(this->bottomFrame);
   frameLayout->setContentsMargins(0, 0, 0, 0);
   frameLayout->setSpacing(0);
 
   this->glWidget->update();
 }
 
-void RenderWidget::ShowEditor(int mode)
+/////////////////////////////////////////////////
+void RenderWidget::ShowEditor(bool _show)
 {
-  if (mode > 0)
+  if (_show)
   {
     this->editorWidget->show();
-    this->editorWidget->SetMode(mode);
+    this->bottomFrame->hide();
   }
   else
+  {
     this->editorWidget->hide();
+    this->bottomFrame->show();
+  }
 
 }
 
+/////////////////////////////////////////////////
 void RenderWidget::RemoveScene(const std::string &_name)
 {
   this->clear = true;
   this->clearName = _name;
 }
 
+/////////////////////////////////////////////////
 void RenderWidget::CreateScene(const std::string &_name)
 {
   this->create = true;

File gazebo/gui/RenderWidget.hh

       public: void RemoveScene(const std::string &_name);
       public: void CreateScene(const std::string &_name);
 
-      public: void ShowEditor(int mode);
+      public: void ShowEditor(bool _mode);
 
       private slots: virtual void update();
 
       private: GLWidget *glWidget;
       private: EditorWidget *editorWidget;
       private: QFrame *mainFrame;
+      private: QFrame *bottomFrame;
       private: QLabel *xyzLabel;
       private: QLineEdit *xPosEdit;
       private: QLineEdit *yPosEdit;

File gazebo/gui/model_editor/BuildingEditorPalette.cc

   connect(discardButton, SIGNAL(clicked()), this, SLOT(OnDiscard()));
   saveButton = new QPushButton(tr("Save As"));
   connect(saveButton, SIGNAL(clicked()), this, SLOT(OnSave()));
-  QPushButton *finishButton = new QPushButton(tr("Finish"));
-  connect(finishButton, SIGNAL(clicked()), this, SLOT(OnFinish()));
+  QPushButton *doneButton = new QPushButton(tr("Done"));
+  connect(doneButton, SIGNAL(clicked()), this, SLOT(OnDone()));
 
   QHBoxLayout *buttonsLayout = new QHBoxLayout;
   buttonsLayout->addWidget(discardButton);
   buttonsLayout->addWidget(saveButton);
-  buttonsLayout->addWidget(finishButton);
+  buttonsLayout->addWidget(doneButton);
   buttonsLayout->setAlignment(Qt::AlignCenter);
 
   mainLayout->addLayout(modelNameLayout);
       "your model? All of your work will\n"
       "be lost."),
       QMessageBox::Discard | QMessageBox::Cancel,
-      QMessageBox::Discard);
+      QMessageBox::Cancel);
 
   switch (ret)
   {
 }
 
 /////////////////////////////////////////////////
-void BuildingEditorPalette::OnFinish()
+void BuildingEditorPalette::OnDone()
 {
   FinishModelDialog dialog(FinishModelDialog::MODEL_FINISH, this);
   dialog.SetModelName(this->modelName);

File gazebo/gui/model_editor/BuildingEditorPalette.hh

       /// \brief On save callback.
       private slots: void OnSave();
 
-      /// \brief On finish callback.
-      private slots: void OnFinish();
+      /// \brief On done callback.
+      private slots: void OnDone();
 
       private: QLabel *modelNameLabel;
 

File gazebo/gui/model_editor/EditorWidget.cc

 {
   return this->buildingEditorWidget;
 }
-
-/////////////////////////////////////////////////
-void EditorWidget::SetMode(int mode)
-{
-  /// TODO: 2 modes, building and model,
-  ///       create enums for these
-  switch (mode)
-  {
-    case 0:
-      this->buildingEditorWidget->hide();
-      break;
-    case 1:
-      this->buildingEditorWidget->show();
-      break;
-    default:
-      break;
-  }
-
-}

File gazebo/gui/model_editor/EditorWidget.hh

 
       public: virtual ~EditorWidget();
 
-      public: void SetMode(int mode);
-
       public: QWidget *GetBuildingEditor() const;
 
       private: QWidget *buildingEditorWidget;

File gazebo/gui/model_editor/FinishModelDialog.cc

   QPushButton *cancelButton = new QPushButton(tr("&Cancel"));
   connect(cancelButton, SIGNAL(clicked()), this, SLOT(OnCancel()));
 
-  std::string finishButtonText = "&Finish";
+  std::string finishButtonText = "&Done";
   if (_mode == MODEL_SAVE)
       finishButtonText = "&Save";