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;
|
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))
|
if (!mPreviewWidget->SetCurrentPiece(PartId, ColorCode))
|
||||||
QMessageBox::information(this, tr("Error"), tr("Part preview for '%1' failed.").arg(PartId));
|
QMessageBox::information(this, tr("Error"), tr("Part preview for '%1' failed.").arg(PartId));
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,7 +355,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ProjectFileChanged(const QString& Path);
|
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);
|
void TogglePreviewWidget(bool Visible);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|
|
@ -733,7 +733,7 @@ void lcPartSelectionListView::PreviewSelection(int InfoIndex)
|
||||||
|
|
||||||
quint32 ColorCode = lcGetColorCode(mListModel->GetColorIndex());
|
quint32 ColorCode = lcGetColorCode(mListModel->GetColorIndex());
|
||||||
|
|
||||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode);
|
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||||
|
|
|
@ -535,7 +535,7 @@ void lcTimelineWidget::PreviewSelection(QTreeWidgetItem* CurrentItem)
|
||||||
if (!Info)
|
if (!Info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gMainWindow->PreviewPiece(Info->mFileName, Piece->mColorCode);
|
gMainWindow->PreviewPiece(Info->mFileName, Piece->mColorCode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcTimelineWidget::UpdateModel()
|
void lcTimelineWidget::UpdateModel()
|
||||||
|
|
|
@ -771,7 +771,7 @@ void lcQPropertiesTree::slotSetValue(int Value)
|
||||||
if (Focus && Focus->IsPiece())
|
if (Focus && Focus->IsPiece())
|
||||||
ColorIndex = ((lcPiece*)Focus)->mColorIndex;
|
ColorIndex = ((lcPiece*)Focus)->mColorIndex;
|
||||||
quint32 ColorCode = lcGetColorCode(ColorIndex);
|
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;
|
ColorIndex = Piece->mColorIndex;
|
||||||
Info = Piece->mPieceInfo;
|
Info = Piece->mPieceInfo;
|
||||||
quint32 ColorCode = lcGetColorCode(ColorIndex);
|
quint32 ColorCode = lcGetColorCode(ColorIndex);
|
||||||
gMainWindow->PreviewPiece(Info->mFileName, ColorCode);
|
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue