1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

Assistant: Add subtitle field to the Result class

This allows providers to specify an appropriate subtitle instead of
making that something the UI layer has to figure out. :^)
This commit is contained in:
Andreas Kling 2021-06-29 13:22:35 +02:00
parent ed2bf0a753
commit 3ecd1d603f
3 changed files with 12 additions and 10 deletions

View file

@ -266,14 +266,11 @@ int main(int argc, char** argv)
auto& match = results_container.add<Assistant::ResultRow>();
match.set_image(result->bitmap());
match.set_title(result->title());
match.set_subtitle(result->subtitle());
match.on_selected = [result_copy = result]() {
result_copy->activate();
exit(0);
};
if (result->kind() == Assistant::Result::Kind::Calculator) {
match.set_subtitle("'Enter' will copy to clipboard");
}
}
mark_selected_item();