summaryrefslogtreecommitdiff
path: root/Userland/Applications/Assistant/Providers.h
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-11-25 10:34:10 -0500
committerAndreas Kling <kling@serenityos.org>2022-11-26 18:11:51 +0100
commit518964e7c750513ee1394ebd5f46ed18aa85a7cc (patch)
tree30245afd27f5542c74d385f696d93058aeb507b1 /Userland/Applications/Assistant/Providers.h
parentae3ffdd521a7c7d1fd4b47f9bbfbfaf20da5a14d (diff)
downloadserenity-518964e7c750513ee1394ebd5f46ed18aa85a7cc.zip
Assistant: Convert ResultRows to Coolbar Buttons
This gives search results a more tactile look and feel, consistent with other iconified widgets across the system. Custom provider subtitles now appear as tooltips.
Diffstat (limited to 'Userland/Applications/Assistant/Providers.h')
-rw-r--r--Userland/Applications/Assistant/Providers.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Applications/Assistant/Providers.h b/Userland/Applications/Assistant/Providers.h
index f9aed96648..8acaa756ed 100644
--- a/Userland/Applications/Assistant/Providers.h
+++ b/Userland/Applications/Assistant/Providers.h
@@ -27,33 +27,33 @@ public:
virtual Gfx::Bitmap const* bitmap() const = 0;
String const& title() const { return m_title; }
- String const& subtitle() const { return m_subtitle; }
+ String const& tooltip() const { return m_tooltip; }
int score() const { return m_score; }
bool equals(Result const& other) const
{
return typeid(this) == typeid(&other)
&& title() == other.title()
- && subtitle() == other.subtitle();
+ && tooltip() == other.tooltip();
}
protected:
- Result(String title, String subtitle, int score = 0)
+ Result(String title, String tooltip, int score = 0)
: m_title(move(title))
- , m_subtitle(move(subtitle))
+ , m_tooltip(move(tooltip))
, m_score(score)
{
}
private:
String m_title;
- String m_subtitle;
+ String m_tooltip;
int m_score { 0 };
};
class AppResult final : public Result {
public:
- AppResult(RefPtr<Gfx::Bitmap> bitmap, String title, String subtitle, NonnullRefPtr<Desktop::AppFile> af, int score)
- : Result(move(title), move(subtitle), score)
+ AppResult(RefPtr<Gfx::Bitmap> bitmap, String title, String tooltip, NonnullRefPtr<Desktop::AppFile> af, int score)
+ : Result(move(title), move(tooltip), score)
, m_app_file(move(af))
, m_bitmap(move(bitmap))
{
@@ -71,7 +71,7 @@ private:
class CalculatorResult final : public Result {
public:
explicit CalculatorResult(String title)
- : Result(move(title), "'Enter' will copy to clipboard"sv, 100)
+ : Result(move(title), "Copy to Clipboard"sv, 100)
, m_bitmap(GUI::Icon::default_icon("app-calculator"sv).bitmap_for_size(16))
{
}
@@ -115,7 +115,7 @@ private:
class URLResult final : public Result {
public:
explicit URLResult(const URL& url)
- : Result(url.to_string(), "'Enter' will open this URL in the browser"sv, 50)
+ : Result(url.to_string(), "Open URL in Browser"sv, 50)
, m_bitmap(GUI::Icon::default_icon("app-browser"sv).bitmap_for_size(16))
{
}