Remember current tool box index in draw mode.

--HG--
branch : feature
This commit is contained in:
dismine 2014-01-08 22:45:42 +02:00
parent 777547a59e
commit f948a80c8a
2 changed files with 4 additions and 2 deletions

View File

@ -60,7 +60,7 @@ MainWindow::MainWindow(QWidget *parent)
dialogCutSpline(QSharedPointer<DialogCutSpline>()), dialogCutSplinePath (QSharedPointer<DialogCutSplinePath>()), dialogCutSpline(QSharedPointer<DialogCutSpline>()), dialogCutSplinePath (QSharedPointer<DialogCutSplinePath>()),
dialogUnionDetails(QSharedPointer<DialogUnionDetails>()), dialogCutArc(QSharedPointer<DialogCutArc>()), dialogUnionDetails(QSharedPointer<DialogUnionDetails>()), dialogCutArc(QSharedPointer<DialogCutArc>()),
dialogHistory(0), comboBoxDraws(0), fileName(QString()), changeInFile(false), dialogHistory(0), comboBoxDraws(0), fileName(QString()), changeInFile(false),
mode(Draw::Calculation), currentDrawIndex(0) mode(Draw::Calculation), currentDrawIndex(0), currentToolBoxIndex(0)
{ {
ui->setupUi(this); ui->setupUi(this);
static const char * GENERIC_ICON_TO_CHECK = "document-open"; static const char * GENERIC_ICON_TO_CHECK = "document-open";
@ -900,7 +900,7 @@ void MainWindow::ActionDraw(bool checked)
SetEnableTool(true); SetEnableTool(true);
doc->setCurrentData(); doc->setCurrentData();
ui->toolBox->setCurrentIndex(0); ui->toolBox->setCurrentIndex(currentToolBoxIndex);
} }
else else
{ {
@ -932,6 +932,7 @@ void MainWindow::ActionDetails(bool checked)
mode = Draw::Modeling; mode = Draw::Modeling;
SetEnableTool(true); SetEnableTool(true);
currentToolBoxIndex = ui->toolBox->currentIndex();
ui->toolBox->setCurrentIndex(4); ui->toolBox->setCurrentIndex(4);
} }
else else

View File

@ -510,6 +510,7 @@ private:
*/ */
Draw::Draws mode; Draw::Draws mode;
qint32 currentDrawIndex; qint32 currentDrawIndex;
qint32 currentToolBoxIndex;
/** /**
* @brief ToolBarOption * @brief ToolBarOption
*/ */