From 10cf50c7ce313cc3e191a6b2001b3121fcac408a Mon Sep 17 00:00:00 2001 From: Nico Sonack Date: Tue, 8 Aug 2023 23:51:46 +0200 Subject: [PATCH] feat: Enable tooltips in ArtistLinks menu Just a minor feature that I was missing when I was digging around in Spotify. This enables tooltips on the artist menu such that you can preview the URL you're about to open in your web browser. Signed-off-by: Nico Sonack --- src/menu/artistlinks.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/menu/artistlinks.cpp b/src/menu/artistlinks.cpp index f87c81f3f..7c5f2a094 100644 --- a/src/menu/artistlinks.cpp +++ b/src/menu/artistlinks.cpp @@ -8,6 +8,7 @@ Menu::ArtistLinks::ArtistLinks(const lib::spt::artist &artist, { setIcon(Icon::get("edit-find")); setTitle("Links"); + setToolTipsVisible(true); QMenu::connect(this, &QMenu::aboutToShow, this, &Menu::ArtistLinks::onAboutToShow); @@ -17,6 +18,7 @@ Menu::ArtistLinks::ArtistLinks(const lib::spt::artist &artist, this, &Menu::ArtistLinks::onDuckDuckGo); addSeparator(); + loading = addAction("Searching..."); loading->setEnabled(false); } @@ -43,6 +45,7 @@ void Menu::ArtistLinks::onDuckDuckGo(bool /*checked*/) void Menu::ArtistLinks::addLink(const std::string &title, const std::string &url) { auto *action = addAction(QString::fromStdString(title)); + action->setToolTip(QString::fromStdString(url)); QAction::connect(action, &QAction::triggered, [this, url](bool /*checked*/) { Url::open(url, LinkType::Web, this);