mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-18 02:42:59 +00:00
Show all frame tags on "Go to frame" by default
This commit is contained in:
parent
7156c4ae98
commit
08c70cc6ab
@ -158,19 +158,31 @@ private:
|
|||||||
: m_frameTags(frameTags) {
|
: m_frameTags(frameTags) {
|
||||||
setEditable(true);
|
setEditable(true);
|
||||||
getEntryWidget()->Change.connect(&TagsEntry::onEntryChange, this);
|
getEntryWidget()->Change.connect(&TagsEntry::onEntryChange, this);
|
||||||
|
fill(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onEntryChange() {
|
void fill(bool all) {
|
||||||
removeAllItems();
|
removeAllItems();
|
||||||
closeListBox();
|
|
||||||
|
|
||||||
MatchWords match(getEntryWidget()->text());
|
MatchWords match(getEntryWidget()->text());
|
||||||
|
|
||||||
|
bool matchAny = false;
|
||||||
for (const auto& frameTag : m_frameTags) {
|
for (const auto& frameTag : m_frameTags) {
|
||||||
if (match(frameTag->name()))
|
if (match(frameTag->name())) {
|
||||||
|
matchAny = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const auto& frameTag : m_frameTags) {
|
||||||
|
if (all || !matchAny || match(frameTag->name()))
|
||||||
addItem(frameTag->name());
|
addItem(frameTag->name());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void onEntryChange() {
|
||||||
|
closeListBox();
|
||||||
|
fill(false);
|
||||||
if (getItemCount() > 0)
|
if (getItemCount() > 0)
|
||||||
openListBox();
|
openListBox();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user