Skip to content

Commit

Permalink
Update pluginviewwidget.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Apr 20, 2024
1 parent bd6a62b commit 2eb8c8c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/pluginviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ PluginViewWidget::PluginViewWidget(QWidget *parent,

_pluginGroupLabel = new QLabel(tr("Group"), this);
_pluginGroupLabel->setObjectName("PluginViewGroupLabel");
_pluginGroupLabel->setOpenExternalLinks(true);

_installButton = new QPushButton(tr("Install"), this);
_removeButton = new QPushButton(tr("Remove"), this);
Expand Down Expand Up @@ -165,9 +166,19 @@ void PluginViewWidget::showPlugin(const QString &id)
_pluginTitleLabel->setText(plugin.label);

if (!plugin.repo.label.isEmpty()) {
_pluginGroupLabel->setText(QString("%1 <span style=\"font-weight: normal; font-size: small;\">(%2)</span>")
.arg(plugin.group,
plugin.repo.label));
QString repoSpan = "<span style=\"font-weight: normal; font-size: small;\">";
QString repoHtml = "%1 %2%3</span>";
if (!plugin.repo.url.isEmpty()) {
repoHtml = "%1 %2<a href=\"%3\">%4</a></span>";
_pluginGroupLabel->setText(repoHtml.arg(plugin.group,
repoSpan,
plugin.repo.url.toString(),
plugin.repo.label));
} else {
_pluginGroupLabel->setText(repoHtml.arg(plugin.group,
repoSpan,
plugin.repo.label));
}
} else {
_pluginGroupLabel->setText(plugin.group);
}
Expand Down

0 comments on commit 2eb8c8c

Please sign in to comment.