mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Update parts in use category after changes. Fixes #890.
Some checks failed
LeoCAD CI / build-ubuntu (push) Has been cancelled
LeoCAD CI / build-macos (push) Has been cancelled
Some checks failed
LeoCAD CI / build-ubuntu (push) Has been cancelled
LeoCAD CI / build-macos (push) Has been cancelled
This commit is contained in:
parent
dd3ab8990e
commit
72c8e7a6c2
5 changed files with 29 additions and 1 deletions
|
@ -2297,6 +2297,11 @@ void lcMainWindow::UpdateModels()
|
|||
SetCurrentPieceInfo(nullptr);
|
||||
}
|
||||
|
||||
void lcMainWindow::UpdateInUseCategory()
|
||||
{
|
||||
mPartSelectionWidget->UpdateInUseCategory();
|
||||
}
|
||||
|
||||
void lcMainWindow::UpdateCategories()
|
||||
{
|
||||
mPartSelectionWidget->UpdateCategories();
|
||||
|
|
|
@ -272,6 +272,7 @@ public:
|
|||
void UpdateShadingMode();
|
||||
void UpdateSelectionMode();
|
||||
void UpdateModels();
|
||||
void UpdateInUseCategory();
|
||||
void UpdateCategories();
|
||||
void UpdateTitle();
|
||||
void UpdateModified(bool Modified);
|
||||
|
|
|
@ -2355,9 +2355,12 @@ void lcModel::DeleteSelectedObjects()
|
|||
{
|
||||
if (RemoveSelectedObjects())
|
||||
{
|
||||
if (!mIsPreview) {
|
||||
if (!mIsPreview)
|
||||
{
|
||||
gMainWindow->UpdateTimeline(false, false);
|
||||
gMainWindow->UpdateSelectedObjects(true);
|
||||
gMainWindow->UpdateInUseCategory();
|
||||
|
||||
UpdateAllViews();
|
||||
SaveCheckpoint(tr("Deleting"));
|
||||
}
|
||||
|
@ -3182,6 +3185,12 @@ void lcModel::SetObjectsProperty(const std::vector<lcObject*>& Objects, lcObject
|
|||
{
|
||||
gMainWindow->UpdateTimeline(false, true);
|
||||
}
|
||||
|
||||
// todo: fix hacky category update
|
||||
if (PropertyId == lcObjectPropertyId::PieceId)
|
||||
{
|
||||
gMainWindow->UpdateInUseCategory();
|
||||
}
|
||||
}
|
||||
|
||||
bool lcModel::AnyPiecesSelected() const
|
||||
|
|
|
@ -581,6 +581,12 @@ void lcPartSelectionListView::ToggleFixedColor()
|
|||
mListModel->ToggleColorLocked();
|
||||
}
|
||||
|
||||
void lcPartSelectionListView::UpdateInUseCategory()
|
||||
{
|
||||
if (mCategoryType == lcPartCategoryType::PartsInUse)
|
||||
mListModel->SetCurrentModelCategory();
|
||||
}
|
||||
|
||||
void lcPartSelectionListView::UpdateViewMode()
|
||||
{
|
||||
setViewMode(mListModel->GetIconSize() && !mListModel->IsListMode() ? QListView::IconMode : QListView::ListMode);
|
||||
|
@ -1112,6 +1118,11 @@ void lcPartSelectionWidget::RemoveFromPalette()
|
|||
}
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::UpdateInUseCategory()
|
||||
{
|
||||
mPartsWidget->UpdateInUseCategory();
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::UpdateCategories()
|
||||
{
|
||||
QTreeWidgetItem* CurrentItem = mCategoriesWidget->currentItem();
|
||||
|
|
|
@ -177,6 +177,7 @@ public:
|
|||
return mContextInfo;
|
||||
}
|
||||
|
||||
void UpdateInUseCategory();
|
||||
void UpdateViewMode();
|
||||
|
||||
public slots:
|
||||
|
@ -212,6 +213,7 @@ public:
|
|||
void UpdateThumbnails();
|
||||
void SetDefaultPart();
|
||||
void UpdateModels();
|
||||
void UpdateInUseCategory();
|
||||
void UpdateCategories();
|
||||
void LoadState(QSettings& Settings);
|
||||
void SaveState(QSettings& Settings);
|
||||
|
|
Loading…
Reference in a new issue