Skip to content

Commit

Permalink
use QLabel for passthrough text on overview
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Mar 30, 2020
1 parent 9a155b8 commit 6160a63
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/widget/woverview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <QMouseEvent>
#include <QPaintEvent>
#include <QPainter>
#include <QPixmap>
#include <QUrl>
#include <QtDebug>

Expand Down Expand Up @@ -94,6 +93,17 @@ WOverview::WOverview(
this, &WOverview::onTrackAnalyzerProgress);

connect(m_pCueMenuPopup.get(), &WCueMenuPopup::aboutToHide, this, &WOverview::slotCueMenuPopupAboutToHide);

m_pPassthroughLabel = new QLabel(this);
m_pPassthroughLabel->setObjectName("PassthroughLabel");
m_pPassthroughLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
m_pPassthroughLabel->setText("Passthrough");
m_pPassthroughLabel->hide();
m_pPassThroughLayout = new QVBoxLayout(this);
m_pPassThroughLayout->setContentsMargins(0,0,0,0);
m_pPassThroughLayout->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
m_pPassThroughLayout->addWidget(m_pPassthroughLabel);
setLayout(m_pPassThroughLayout);
}

void WOverview::setup(const QDomNode& node, const SkinContext& context) {
Expand Down Expand Up @@ -564,8 +574,10 @@ void WOverview::paintEvent(QPaintEvent* pEvent) {
}

if (m_bPassthroughEnabled) {
paintText(tr("Passthrough"), &painter);
m_pPassthroughLabel->show();
return;
} else {
m_pPassthroughLabel->hide();
}

if (m_pCurrentTrack) {
Expand Down
2 changes: 2 additions & 0 deletions src/widget/woverview.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class WOverview : public WWidget, public TrackDropTarget {
QColor m_labelTextColor;
QColor m_labelBackgroundColor;
QColor m_endOfTrackColor;
QLabel* m_pPassthroughLabel;
QVBoxLayout* m_pPassThroughLayout;

// All WaveformMarks
WaveformMarkSet m_marks;
Expand Down

0 comments on commit 6160a63

Please sign in to comment.