- Layer dialog updates:

* switched back to the original qtoolbar style for windows os
* an expanded item on the layer dialog now remains expanded
* layer dialog will be shown only when all the files have been loaded
This commit is contained in:
Guido Ranzuglia granzuglia 2014-02-17 14:12:29 +00:00
parent d5ae803b88
commit 4a25f8bdb8
3 changed files with 9 additions and 12 deletions

View File

@ -470,7 +470,7 @@ void LayerDialog::adaptLayout(QTreeWidgetItem * item)
int meshId = mItem->m->id();
bool ok;
int tagId = mItem->text(2).toInt(&ok);
if(ok && tagId >=0 )
if(!ok || tagId < 0 )
//MeshTreeWidgetItems don't have a tag id, so we use -1
updateExpandedMap(meshId, -1, item->isExpanded());
}
@ -480,7 +480,7 @@ void LayerDialog::adaptLayout(QTreeWidgetItem * item)
int meshId = parent->m->id();
bool ok;
int tagId = item->text(2).toInt(&ok);
if(ok)
if(!ok)
updateExpandedMap(meshId, tagId, item->isExpanded());
}
}

View File

@ -511,14 +511,10 @@ void MainWindow::createActions()
void MainWindow::createToolBars()
{
this->setStyleSheet("QToolBar {\
spacing: 0px; \
}\
QToolButton { /* all types of tool button */\
border: 0px solid #8f8f91;\
border-radius: 0px;\
}");
mainToolBar = addToolBar(tr("Standard"));
#if defined(Q_OS_MAC)
this->setStyleSheet("QToolBar {spacing: 0px; } QToolButton {border: 0px solid #8f8f91;border-radius: 0px;}");
#endif
mainToolBar = addToolBar(tr("Standard"));
// mainToolBar->setIconSize(QSize(32,32));
mainToolBar->addAction(this->newProjectAct);
mainToolBar->addAction(this->openProjectAct);

View File

@ -2349,6 +2349,8 @@ bool MainWindow::importMesh(QString fileName)
QTime allFileTime;
allFileTime.start();
bool layervisi = layerDialog->isVisible();
showLayerDlg(false);
foreach(fileName,fileNameList)
{
QFileInfo fi(fileName);
@ -2389,8 +2391,6 @@ bool MainWindow::importMesh(QString fileName)
postOpenDialog.exec();
pCurrentIOPlugin->applyOpenParameter(extension, *mm, par);
}
if (meshDoc()->size() > 1)
showLayerDlg(true);
}
else
{
@ -2398,6 +2398,7 @@ bool MainWindow::importMesh(QString fileName)
GLA()->Logf(0,"Warning: Mesh %s has not been opened",qPrintable(fileName));
}
}// end foreach file of the input list
showLayerDlg(meshDoc()->size() > 1 || layervisi);
GLA()->Logf(0,"All files opened in %i msec",allFileTime.elapsed());
this->currentViewContainer()->resetAllTrackBall();