Add match case button
This commit is contained in:
@@ -734,7 +734,7 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||
CategoriesGroupWidget->setLayout(CategoriesLayout);
|
||||
|
||||
QHBoxLayout* FilterCategoriesLayout = new QHBoxLayout();
|
||||
FilterCategoriesLayout->setContentsMargins(0, 0, 6, 0);
|
||||
FilterCategoriesLayout->setContentsMargins(0, 0, 0, 0);
|
||||
CategoriesLayout->addLayout(FilterCategoriesLayout);
|
||||
|
||||
mFilterCategoriesWidget = new QLineEdit(CategoriesGroupWidget);
|
||||
@@ -743,6 +743,17 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent)
|
||||
connect(mFilterCategoriesAction, SIGNAL(triggered()), this, SLOT(FilterCategoriesTriggered()));
|
||||
FilterCategoriesLayout->addWidget(mFilterCategoriesWidget);
|
||||
|
||||
mFilterCaseAction = new QAction();
|
||||
mFilterCaseAction->setIcon(QIcon(":/resources/case.png"));
|
||||
mFilterCaseAction->setToolTip(tr("Match Case"));
|
||||
mFilterCaseAction->setCheckable(true);
|
||||
mFilterCaseAction->setChecked(false);
|
||||
connect(mFilterCaseAction, SIGNAL(triggered()), this, SLOT(FilterCaseTriggered()));
|
||||
|
||||
QToolButton* FilterCaseButton = new QToolButton();
|
||||
FilterCaseButton->setDefaultAction(mFilterCaseAction);
|
||||
FilterCategoriesLayout->addWidget(FilterCaseButton);
|
||||
|
||||
mCategoriesWidget = new QTreeWidget(mSplitter);
|
||||
mCategoriesWidget->setHeaderHidden(true);
|
||||
mCategoriesWidget->setUniformRowHeights(true);
|
||||
@@ -885,12 +896,13 @@ void lcPartSelectionWidget::FilterCategoriesChanged(const QString& Text)
|
||||
}
|
||||
|
||||
bool Hide = true;
|
||||
Qt::CaseSensitivity MatchCase = mFilterCaseAction->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;
|
||||
mCategoriesWidget->setUpdatesEnabled(false);
|
||||
for (int CategoryIdx = 0; CategoryIdx < mCategoriesWidget->topLevelItemCount(); CategoryIdx++)
|
||||
{
|
||||
QTreeWidgetItem* CategoryItem = mCategoriesWidget->topLevelItem(CategoryIdx);
|
||||
Hide = false;
|
||||
if (!CategoryItem->text(0).contains(Text, Qt::CaseInsensitive))
|
||||
if (!CategoryItem->text(0).contains(Text, MatchCase))
|
||||
Hide = true;
|
||||
CategoryItem->setHidden(Hide);
|
||||
}
|
||||
@@ -916,6 +928,12 @@ void lcPartSelectionWidget::FilterCategoriesTriggered()
|
||||
mFilterCategoriesWidget->clear();
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::FilterCaseTriggered()
|
||||
{
|
||||
if (!mFilterCategoriesWidget->text().isEmpty())
|
||||
FilterCategoriesChanged(mFilterCategoriesWidget->text());
|
||||
}
|
||||
|
||||
void lcPartSelectionWidget::FilterTriggered()
|
||||
{
|
||||
mFilterWidget->clear();
|
||||
|
||||
@@ -232,6 +232,7 @@ protected slots:
|
||||
void FilterChanged(const QString& Text);
|
||||
void FilterCategoriesChanged(const QString& Text);
|
||||
void FilterTriggered();
|
||||
void FilterCaseTriggered();
|
||||
void FilterCategoriesTriggered();
|
||||
void CategoryChanged(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);
|
||||
void PartChanged(const QModelIndex& Current, const QModelIndex& Previous);
|
||||
@@ -248,6 +249,7 @@ protected:
|
||||
QTreeWidget* mCategoriesWidget;
|
||||
QLineEdit* mFilterCategoriesWidget;
|
||||
QAction* mFilterCategoriesAction;
|
||||
QAction* mFilterCaseAction;
|
||||
QLineEdit* mFilterWidget;
|
||||
QAction* mFilterAction;
|
||||
lcPartSelectionListView* mPartsWidget;
|
||||
|
||||
+3
-2
@@ -78,7 +78,6 @@
|
||||
<file>resources/file_print.png</file>
|
||||
<file>resources/file_print_preview.png</file>
|
||||
<file>resources/file_save.png</file>
|
||||
<file>resources/filter.png</file>
|
||||
<file>resources/time_first.png</file>
|
||||
<file>resources/time_last.png</file>
|
||||
<file>resources/time_next.png</file>
|
||||
@@ -135,7 +134,9 @@
|
||||
<file>resources/shaders/unlit_vertex_color_vs.glsl</file>
|
||||
<file>resources/shaders/unlit_view_sphere_ps.glsl</file>
|
||||
<file>resources/shaders/unlit_view_sphere_vs.glsl</file>
|
||||
<file>resources/gear_in.png</file>
|
||||
<file>resources/case.png</file>
|
||||
<file>resources/filter.png</file>
|
||||
<file>resources/flexible.png</file>
|
||||
<file>resources/gear_in.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user