diff --git a/src/lay/lay/CustomizeMenuConfigPage.ui b/src/lay/lay/CustomizeMenuConfigPage.ui
index 1f3629b22..67995fb53 100644
--- a/src/lay/lay/CustomizeMenuConfigPage.ui
+++ b/src/lay/lay/CustomizeMenuConfigPage.ui
@@ -19,10 +19,7 @@
Settings
-
-
- 6
-
+
9
@@ -35,35 +32,7 @@
9
- -
-
-
-
- 1
- 0
-
-
-
- true
-
-
-
- Path
-
-
-
-
- Title
-
-
-
-
- Shortcut
-
-
-
-
- -
+
-
QFrame::NoFrame
@@ -171,6 +140,91 @@ For special keys:
+ -
+
+
+
+ 1
+ 0
+
+
+
+ true
+
+
+
+ Path
+
+
+
+
+ Title
+
+
+
+
+ Shortcut
+
+
+
+
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 328
+ 20
+
+
+
+
+ -
+
+
+
+
+
+ :/find.png
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
@@ -181,6 +235,8 @@ For special keys:
-
+
+
+
diff --git a/src/lay/lay/layMainConfigPages.cc b/src/lay/lay/layMainConfigPages.cc
index a48efd29c..6da219bd4 100644
--- a/src/lay/lay/layMainConfigPages.cc
+++ b/src/lay/lay/layMainConfigPages.cc
@@ -408,6 +408,9 @@ CustomizeMenuConfigPage::CustomizeMenuConfigPage (QWidget *parent)
mp_ui->binding_le->setEnabled (false);
mp_ui->binding_le->set_clear_button_enabled (true);
connect (mp_ui->binding_le, SIGNAL (textChanged (QString)), this, SLOT (text_changed ()));
+
+ mp_ui->filter->set_clear_button_enabled (true);
+ connect (mp_ui->filter, SIGNAL (textChanged (QString)), this, SLOT (filter_changed ()));
}
CustomizeMenuConfigPage::~CustomizeMenuConfigPage ()
@@ -455,6 +458,11 @@ CustomizeMenuConfigPage::reset_clicked ()
void
CustomizeMenuConfigPage::apply (const std::vector > &key_bindings, const std::vector > &hidden)
{
+ // clears the filter
+ mp_ui->filter->blockSignals (true);
+ mp_ui->filter->clear ();
+ mp_ui->filter->blockSignals (false);
+
// build the path to item table and the alias table
m_item_for_path.clear ();
m_paths_for_action.clear ();
@@ -532,13 +540,16 @@ CustomizeMenuConfigPage::apply (const std::vectorfirst == tl_menu) {
QTreeWidgetItem *item = new QTreeWidgetItem (top_level_item);
lay::Action action = lay::MainWindow::instance ()->menu ()->action (cb->first);
+ item->setData (0, Qt::ToolTipRole, tl::to_qstring (rem_path));
item->setData (0, Qt::DisplayRole, tl::to_qstring (rem_path));
+ item->setData (1, Qt::ToolTipRole, tl::to_qstring (action.get_title ()));
item->setData (1, Qt::DisplayRole, tl::to_qstring (action.get_title ()));
item->setData (2, Qt::DisplayRole, tl::to_qstring (sc));
item->setData (2, Qt::ForegroundRole, palette ().color (is_default ? QPalette::Disabled : QPalette::Normal, QPalette::Text));
item->setData (0, Qt::UserRole, tl::to_qstring (path));
item->setFlags (item->flags () | Qt::ItemIsUserCheckable);
item->setCheckState (0, hidden ? Qt::Unchecked : Qt::Checked);
+ item->setHidden (false);
m_item_for_path[path] = item;
if (action.qaction ()) {
m_paths_for_action[action.qaction ()].push_back (path);
@@ -626,6 +637,31 @@ CustomizeMenuConfigPage::text_changed ()
}
}
+void
+CustomizeMenuConfigPage::filter_changed ()
+{
+ mp_ui->bindings_list->clearSelection ();
+ current_changed (0, mp_ui->bindings_list->currentItem ());
+
+ QString filter = mp_ui->filter->text ();
+
+ for (int i = 0; i < mp_ui->bindings_list->topLevelItemCount (); ++i) {
+ QTreeWidgetItem *tl_item = mp_ui->bindings_list->topLevelItem (i);
+ bool any = false;
+ for (int j = 0; j < tl_item->childCount (); ++j) {
+ QTreeWidgetItem *item = tl_item->child (j);
+ QString path = item->data (0, Qt::DisplayRole).toString ();
+ QString title = item->data (1, Qt::DisplayRole).toString ();
+ bool matches = path.indexOf (filter, 0, Qt::CaseInsensitive) >= 0 || title.indexOf (filter, 0, Qt::CaseInsensitive) >= 0;
+ item->setHidden (!matches);
+ if (matches) {
+ any = true;
+ }
+ }
+ tl_item->setHidden (!any);
+ }
+}
+
void
CustomizeMenuConfigPage::update_list_item (QTreeWidgetItem *item)
{
diff --git a/src/lay/lay/layMainConfigPages.h b/src/lay/lay/layMainConfigPages.h
index d973e4797..74b351e08 100644
--- a/src/lay/lay/layMainConfigPages.h
+++ b/src/lay/lay/layMainConfigPages.h
@@ -199,6 +199,7 @@ private slots:
void current_changed (QTreeWidgetItem *current, QTreeWidgetItem *previous);
void item_changed (QTreeWidgetItem *, int);
void text_changed ();
+ void filter_changed ();
void reset_clicked ();
private: