mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Show preview widget when double clicking. Fixes #589.
This commit is contained in:
parent
176b238faa
commit
f9c025f3b9
5 changed files with 9 additions and 6 deletions
|
@ -785,8 +785,11 @@ lcView* lcMainWindow::CreateView(lcModel* Model)
|
|||
return NewView;
|
||||
}
|
||||
|
||||
void lcMainWindow::PreviewPiece(const QString& PartId, int ColorCode)
|
||||
void lcMainWindow::PreviewPiece(const QString& PartId, int ColorCode, bool ShowPreview)
|
||||
{
|
||||
if (ShowPreview)
|
||||
mPreviewToolBar->show();
|
||||
|
||||
if (!mPreviewWidget->SetCurrentPiece(PartId, ColorCode))
|
||||
QMessageBox::information(this, tr("Error"), tr("Part preview for '%1' failed.").arg(PartId));
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void ProjectFileChanged(const QString& Path);
|
||||
void PreviewPiece(const QString& PartId, int ColorCode);
|
||||
void PreviewPiece(const QString& PartId, int ColorCode, bool ShowPreview);
|
||||
void TogglePreviewWidget(bool Visible);
|
||||
|
||||
protected slots:
|
||||
|
|
|
@ -733,7 +733,7 @@ void lcPartSelectionListView::PreviewSelection(int InfoIndex)
|
|||
|
||||
quint32 ColorCode = lcGetColorCode(mListModel->GetColorIndex());
|
||||
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, true);
|
||||
}
|
||||
|
||||
lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||
|
|
|
@ -535,7 +535,7 @@ void lcTimelineWidget::PreviewSelection(QTreeWidgetItem* CurrentItem)
|
|||
if (!Info)
|
||||
return;
|
||||
|
||||
gMainWindow->PreviewPiece(Info->mFileName, Piece->mColorCode);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, Piece->mColorCode, false);
|
||||
}
|
||||
|
||||
void lcTimelineWidget::UpdateModel()
|
||||
|
|
|
@ -771,7 +771,7 @@ void lcQPropertiesTree::slotSetValue(int Value)
|
|||
if (Focus && Focus->IsPiece())
|
||||
ColorIndex = ((lcPiece*)Focus)->mColorIndex;
|
||||
quint32 ColorCode = lcGetColorCode(ColorIndex);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -947,7 +947,7 @@ void lcQPropertiesTree::SetPiece(const lcArray<lcObject*>& Selection, lcObject*
|
|||
ColorIndex = Piece->mColorIndex;
|
||||
Info = Piece->mPieceInfo;
|
||||
quint32 ColorCode = lcGetColorCode(ColorIndex);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode);
|
||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue