mirror of https://github.com/procxx/kepka.git
Don't use default title if it doesn't fit.
This commit is contained in:
parent
2379812890
commit
7b44d107c9
|
@ -468,6 +468,10 @@ void CreateIconSelector(
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] QString TrimDefaultTitle(const QString &title) {
|
||||||
|
return (title.size() <= kMaxFilterTitleLength) ? title : QString();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void EditFilterBox(
|
void EditFilterBox(
|
||||||
|
@ -511,7 +515,7 @@ void EditFilterBox(
|
||||||
if (nameEditing->custom) {
|
if (nameEditing->custom) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto title = DefaultTitle(filter);
|
const auto title = TrimDefaultTitle(DefaultTitle(filter));
|
||||||
if (nameEditing->field->getLastText() != title) {
|
if (nameEditing->field->getLastText() != title) {
|
||||||
nameEditing->settingDefault = true;
|
nameEditing->settingDefault = true;
|
||||||
nameEditing->field->setText(title);
|
nameEditing->field->setText(title);
|
||||||
|
|
Loading…
Reference in New Issue