0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

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.
This commit is contained in:
Ivan Efremov 2021-01-20 19:12:38 +03:00 committed by Jim
parent 54207a0d60
commit c7ca8abdd3

View File

@ -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<OBSHotkeyLabel *>(
label->widget());
if (item) {
if (item->text().toLower().contains(
QString fullname =
item->property("fullName")
.value<QString>();
if (fullname.toLower().contains(
text.toLower()))
setRowVisible(i, true, label);
else