Renamed part selection events.

This commit is contained in:
Leonardo Zide 2024-07-25 17:56:29 -07:00
parent b2074a7c0a
commit 82463473d5
6 changed files with 23 additions and 22 deletions

View file

@ -707,8 +707,8 @@ void lcMainWindow::CreateToolBars()
addDockWidget(Qt::RightDockWidgetArea, mPartsToolBar);
connect(mPartsToolBar, &QDockWidget::dockLocationChanged, mPartSelectionWidget, &lcPartSelectionWidget::DockLocationChanged);
connect(mPartSelectionWidget, &lcPartSelectionWidget::PartDoubleClicked, this, &lcMainWindow::PartListDoubleClicked);
connect(mPartSelectionWidget, &lcPartSelectionWidget::PartChanged, this, &lcMainWindow::SetCurrentPieceInfo);
connect(mPartSelectionWidget, &lcPartSelectionWidget::PartPicked, this, &lcMainWindow::PartListPicked);
connect(mPartSelectionWidget, &lcPartSelectionWidget::CurrentPartChanged, this, &lcMainWindow::SetCurrentPieceInfo);
mColorsToolBar = new QDockWidget(tr("Colors"), this);
mColorsToolBar->setObjectName("ColorsToolbar");
@ -1108,14 +1108,14 @@ void lcMainWindow::ColorChanged(int ColorIndex)
SetColorIndex(ColorIndex);
}
void lcMainWindow::PartListDoubleClicked(PieceInfo* Info)
void lcMainWindow::PartListPicked(PieceInfo* Info)
{
if (!Info)
return;
quint32 ColorCode = lcGetColorCode(mPartSelectionWidget->GetColorIndex());
gMainWindow->PreviewPiece(Info->mFileName, ColorCode, true);
PreviewPiece(Info->mFileName, ColorCode, true);
}
void lcMainWindow::ColorButtonClicked()

View file

@ -303,7 +303,7 @@ protected slots:
void ClipboardChanged();
void ActionTriggered();
void ColorChanged(int ColorIndex);
void PartListDoubleClicked(PieceInfo* Info);
void PartListPicked(PieceInfo* Info);
void ColorButtonClicked();
void Print(QPrinter* Printer);
void EnableWindowFlags(bool);

View file

@ -773,6 +773,7 @@ void lcPartSelectionWidget::SetCurrentPart(PieceInfo* Info)
{
mCategoriesWidget->setCurrentItem(mAllPartsCategoryItem);
mPartsWidget->SetCurrentPart(Info);
mPartsWidget->setFocus();
}
void lcPartSelectionWidget::SetOrientation(Qt::Orientation Orientation)
@ -880,7 +881,7 @@ void lcPartSelectionWidget::PartViewSelectionChanged(const QModelIndex& Current,
Q_UNUSED(Current);
Q_UNUSED(Previous);
emit PartChanged(mPartsWidget->GetCurrentPart());
emit CurrentPartChanged(mPartsWidget->GetCurrentPart());
}
void lcPartSelectionWidget::PartViewDoubleClicked(const QModelIndex& Index)
@ -888,7 +889,7 @@ void lcPartSelectionWidget::PartViewDoubleClicked(const QModelIndex& Index)
PieceInfo* Info = mPartsWidget->GetListModel()->GetPieceInfo(Index.row());
if (Info)
emit PartDoubleClicked(Info);
emit PartPicked(Info);
}
void lcPartSelectionWidget::OptionsMenuAboutToShow()
@ -954,7 +955,7 @@ void lcPartSelectionWidget::OptionsMenuAboutToShow()
ListMode->setCheckable(true);
ListMode->setChecked(ListModel->IsListMode());
QAction* FixedColor = Menu->addAction(tr("Lock Preview Color"), mPartsWidget, SLOT(ToggleFixedColor()));
QAction* FixedColor = Menu->addAction(tr("Lock Color"), mPartsWidget, SLOT(ToggleFixedColor()));
FixedColor->setCheckable(true);
FixedColor->setChecked(ListModel->IsColorLocked());
}

View file

@ -240,8 +240,8 @@ public:
}
signals:
void PartDoubleClicked(PieceInfo* Info);
void PartChanged(PieceInfo* Info);
void PartPicked(PieceInfo* Info);
void CurrentPartChanged(PieceInfo* Info);
public slots:
void AddToPalette();
@ -267,14 +267,14 @@ protected:
void resizeEvent(QResizeEvent* Event) override;
bool event(QEvent* Event) override;
QTreeWidget* mCategoriesWidget;
QLineEdit* mFilterCategoriesWidget;
QAction* mFilterCategoriesAction;
QAction* mFilterCaseAction;
QLineEdit* mFilterWidget;
QAction* mFilterAction;
lcPartSelectionListView* mPartsWidget;
QSplitter* mSplitter;
QTreeWidgetItem* mAllPartsCategoryItem;
QTreeWidget* mCategoriesWidget = nullptr;
QLineEdit* mFilterCategoriesWidget = nullptr;
QAction* mFilterCategoriesAction = nullptr;
QAction* mFilterCaseAction = nullptr;
QLineEdit* mFilterWidget = nullptr;
QAction* mFilterAction = nullptr;
lcPartSelectionListView* mPartsWidget = nullptr;
QSplitter* mSplitter = nullptr;
QTreeWidgetItem* mAllPartsCategoryItem = nullptr;
std::vector<lcPartPalette> mPartPalettes;
};

View file

@ -181,7 +181,7 @@ lcPieceIdPickerPopup::lcPieceIdPickerPopup(PieceInfo* Current, QWidget* Parent)
mPartSelectionWidget->setMinimumWidth(450);
connect(mPartSelectionWidget, &lcPartSelectionWidget::PartDoubleClicked, this, &lcPieceIdPickerPopup::PartDoubleClicked);
connect(mPartSelectionWidget, &lcPartSelectionWidget::PartPicked, this, &lcPieceIdPickerPopup::PartPicked);
QDialogButtonBox* ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
Layout->addWidget(ButtonBox);
@ -212,7 +212,7 @@ void lcPieceIdPickerPopup::Reject()
Close();
}
void lcPieceIdPickerPopup::PartDoubleClicked(PieceInfo* Info)
void lcPieceIdPickerPopup::PartPicked(PieceInfo* Info)
{
emit PieceIdSelected(Info);

View file

@ -180,7 +180,7 @@ signals:
protected slots:
void Accept();
void Reject();
void PartDoubleClicked(PieceInfo* Info);
void PartPicked(PieceInfo* Info);
protected:
void showEvent(QShowEvent* ShowEvent) override;