@@ -15,8 +15,7 @@
|
|||||||
<file>schema/schema-12.sql</file>
|
<file>schema/schema-12.sql</file>
|
||||||
<file>schema/device-schema.sql</file>
|
<file>schema/device-schema.sql</file>
|
||||||
<file>style/strawberry.css</file>
|
<file>style/strawberry.css</file>
|
||||||
<file>html/playing-tooltip-plain.html</file>
|
<file>html/playing-tooltip.html</file>
|
||||||
<file>html/playing-tooltip-table.html</file>
|
|
||||||
<file>html/oauthsuccess.html</file>
|
<file>html/oauthsuccess.html</file>
|
||||||
<file>pictures/strawberry.png</file>
|
<file>pictures/strawberry.png</file>
|
||||||
<file>pictures/strawberry-faded.png</file>
|
<file>pictures/strawberry-faded.png</file>
|
||||||
|
|||||||
41
data/html/playing-tooltip.html
Normal file
41
data/html/playing-tooltip.html
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<table cellspacing="5" cellpadding="5">
|
||||||
|
<tr>
|
||||||
|
<td colspan="%columns">
|
||||||
|
<center><h4>%appName</h4></center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
%image
|
||||||
|
<td>
|
||||||
|
<table cellspacing="1" cellpadding="1">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p align="right">%titleKey</p>
|
||||||
|
</td>
|
||||||
|
<td>%titleValue</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p align="right">%artistKey</p>
|
||||||
|
</td>
|
||||||
|
<td>%artistValue</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p align="right">%albumKey</p>
|
||||||
|
</td>
|
||||||
|
<td>%albumValue</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" height="20" />
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p align="right">%lengthKey</p>
|
||||||
|
</td>
|
||||||
|
<td>%lengthValue</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
@@ -63,16 +63,11 @@ QtSystemTrayIcon::QtSystemTrayIcon(QObject *parent)
|
|||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
de_ = Utilities::DesktopEnvironment().toLower();
|
de_ = Utilities::DesktopEnvironment().toLower();
|
||||||
QFile pattern_file;
|
QFile pattern_file(":/html/playing-tooltip.html");
|
||||||
if (de_ == "kde") {
|
if (pattern_file.open(QIODevice::ReadOnly)) {
|
||||||
pattern_file.setFileName(":/html/playing-tooltip-plain.html");
|
pattern_ = QString::fromLatin1(pattern_file.readAll());
|
||||||
|
pattern_file.close();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
pattern_file.setFileName(":/html/playing-tooltip-table.html");
|
|
||||||
}
|
|
||||||
pattern_file.open(QIODevice::ReadOnly);
|
|
||||||
pattern_ = QString::fromLatin1(pattern_file.readAll());
|
|
||||||
pattern_file.close();
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -245,6 +240,11 @@ void QtSystemTrayIcon::SetNowPlaying(const Song &song, const QUrl &cover_url) {
|
|||||||
tray_->setToolTip(song.PrettyTitleWithArtist());
|
tray_->setToolTip(song.PrettyTitleWithArtist());
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
if (de_ == "kde") {
|
||||||
|
tray_->setToolTip(song.PrettyTitleWithArtist());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int columns = cover_url.isEmpty() ? 1 : 2;
|
int columns = cover_url.isEmpty() ? 1 : 2;
|
||||||
|
|
||||||
QString tooltip(pattern_);
|
QString tooltip(pattern_);
|
||||||
@@ -264,12 +264,7 @@ void QtSystemTrayIcon::SetNowPlaying(const Song &song, const QUrl &cover_url) {
|
|||||||
|
|
||||||
if (columns == 2) {
|
if (columns == 2) {
|
||||||
QString final_path = cover_url.isLocalFile() ? cover_url.path() : cover_url.toString();
|
QString final_path = cover_url.isLocalFile() ? cover_url.path() : cover_url.toString();
|
||||||
if (de_ == "kde") {
|
tooltip.replace("%image", " <td> <img src=\"" % final_path % "\" /> </td>");
|
||||||
tooltip.replace("%image", "<img src=\"" % final_path % "\" />");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tooltip.replace("%image", " <td> <img src=\"" % final_path % "\" /> </td>");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tooltip.replace("<td>%image</td>", "");
|
tooltip.replace("<td>%image</td>", "");
|
||||||
|
|||||||
Reference in New Issue
Block a user