Skip to content

Commit 993a972

Browse files
authored
Merge pull request #16804 from cr7pt0gr4ph7/rtm_trackinfo_coverart
Track Info Dialog: Add tooltip to cover art image
2 parents b37722a + 4921380 commit 993a972

6 files changed

Lines changed: 28 additions & 6 deletions

File tree

src/library/dlgtrackinfo.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ void DlgTrackInfo::init() {
8484
m_propertyWidgets.insert("comment", txtComment);
8585
m_propertyWidgets.insert("color", btnColorPicker);
8686

87-
coverLayout->setAlignment(Qt::AlignRight | Qt::AlignTop);
88-
coverLayout->setSpacing(0);
89-
coverLayout->setContentsMargins(0, 0, 0, 0);
9087
coverLayout->insertWidget(0, m_pWCoverArtLabel.get());
9188

9289
starsLayout->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

src/library/dlgtrackinfo.ui

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,15 @@
101101
<property name="spacing">
102102
<number>0</number>
103103
</property>
104+
<property name="margin">
105+
<number>0</number>
106+
</property>
104107
<property name="sizeConstraint">
105108
<enum>QLayout::SetDefaultConstraint</enum>
106109
</property>
110+
<property name="alignment">
111+
<set>Qt::AlignRight|Qt::AlignVCenter</set>
112+
</property>
107113
</layout>
108114
</widget>
109115
</item>

src/library/dlgtrackinfomulti.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,6 @@ void DlgTrackInfoMulti::init() {
270270
&DlgTrackInfoMulti::slotStarRatingChanged);
271271

272272
// Insert the cover widget
273-
coverLayout->setAlignment(Qt::AlignRight | Qt::AlignTop);
274-
coverLayout->setSpacing(0);
275-
coverLayout->setContentsMargins(0, 0, 0, 0);
276273
coverLayout->insertWidget(0, m_pWCoverArtLabel.get());
277274
CoverArtCache* pCache = CoverArtCache::instance();
278275
if (pCache) {

src/library/dlgtrackinfomulti.ui

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,15 @@
8787
<property name="spacing">
8888
<number>0</number>
8989
</property>
90+
<property name="margin">
91+
<number>0</number>
92+
</property>
9093
<property name="sizeConstraint">
9194
<enum>QLayout::SetDefaultConstraint</enum>
9295
</property>
96+
<property name="alignment">
97+
<set>Qt::AlignRight|Qt::AlignVCenter</set>
98+
</property>
9399
</layout>
94100
</widget>
95101
</item>

src/skin/legacy/tooltips.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,8 @@ void Tooltips::addStandardTooltips() {
10041004
<< tr("Audio Latency Overload Indicator")
10051005
<< tr("Indicates that the audio buffer is too small to do all audio processing.");
10061006

1007+
// Note: Some of the coverart strings below are reused in src/widget/wcoverartlabel.cpp.
1008+
// Please sync changes made here to wcoverartlabel.cpp, and vice versa.
10071009
add("coverart")
10081010
<< tr("Cover Art")
10091011
<< tr("Displays cover artwork of the loaded track.")

src/widget/wcoverartlabel.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ WCoverArtLabel::WCoverArtLabel(QWidget* pParent, WCoverArtMenu* pCoverMenu)
4848
setFrameShape(QFrame::Box);
4949
setAlignment(Qt::AlignCenter);
5050
setPixmapAndResize(m_defaultCover);
51+
52+
// Note: We reuse existing translation strings from src/skin/legacy/tooltips.cpp
53+
// to avoid having to retranslate basically the same content twice.
54+
// Please sync changes made here to tooltips.cpp, and vice versa.
55+
QString tooltip = QString("%1: %2").arg(
56+
tr("Left-click"),
57+
tr("Opens separate artwork viewer."));
58+
if (m_pCoverMenu) {
59+
tooltip += "\n";
60+
tooltip += QString("%1: %2").arg(
61+
tr("Right-click"),
62+
tr("Displays options for editing cover artwork."));
63+
}
64+
setToolTip(tooltip);
5165
}
5266

5367
WCoverArtLabel::~WCoverArtLabel() = default;

0 commit comments

Comments
 (0)