Skip to content

Commit

Permalink
Enable tooltips in ArtistLinks menu (#227)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herrhotzenplotz authored Oct 14, 2023
1 parent a00aa87 commit a5aacee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/menu/artistlinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -43,6 +44,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);
Expand Down

0 comments on commit a5aacee

Please sign in to comment.