From c7ca8abdd37d247446b067b3ee4986fcc43a0cc0 Mon Sep 17 00:00:00 2001 From: Ivan Efremov Date: Wed, 20 Jan 2021 19:12:38 +0300 Subject: [PATCH] UI: fix the maximum search length of Hotkeys Filter The "fullName" property was filled only in case of exceeding TRUNCATE_TEXT_LENGTH. Also search function had worked only with item->text() what was the reason of maximum search length in Hotkeys Filter(Setting->Hotkeys). The following changes allow to search in filter without the length limit of string along with the current functionality. --- UI/window-basic-settings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index d0ee1a1d6..efcf1bab1 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -2583,8 +2583,9 @@ LayoutHotkey(obs_hotkey_id id, obs_hotkey_t *key, Func &&fun, auto *label = new OBSHotkeyLabel; QString text = QT_UTF8(obs_hotkey_get_description(key)); + label->setProperty("fullName", text); + if (text.length() > TRUNCATE_TEXT_LENGTH) { - label->setProperty("fullName", text); text = text.left(TRUNCATE_TEXT_LENGTH); text += "...'"; } @@ -2722,7 +2723,10 @@ void OBSBasicSettings::LoadHotkeySettings(obs_hotkey_id ignoreKey) qobject_cast( label->widget()); if (item) { - if (item->text().toLower().contains( + QString fullname = + item->property("fullName") + .value(); + if (fullname.toLower().contains( text.toLower())) setRowVisible(i, true, label); else