From ca059446c328e23572d02834e6bf360a47f52450 Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 23 Apr 2021 18:31:03 +0200 Subject: [PATCH] Don't draw BB editor inside Song Editor (#5988) * Don't draw BB editor inside Song Editor Currently, a small BB editor is drawn inside the Song Editor at high zoom levels. As discussed in #3060 this is unintuitive and appears broken (I've seen several other reports of this as a bug). This PR removes this behavior. * Make removal optional --- include/PatternView.h | 2 ++ src/gui/PatternView.cpp | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/PatternView.h b/include/PatternView.h index 00215bf59..6c2243e72 100644 --- a/include/PatternView.h +++ b/include/PatternView.h @@ -92,6 +92,8 @@ private: QColor m_mutedNoteBorderColor; QStaticText m_staticTextName; + + bool m_legacySEBB; } ; diff --git a/src/gui/PatternView.cpp b/src/gui/PatternView.cpp index c3ad3d2f0..9de17fd8b 100644 --- a/src/gui/PatternView.cpp +++ b/src/gui/PatternView.cpp @@ -28,6 +28,7 @@ #include #include +#include "ConfigManager.h" #include "DeprecationHelper.h" #include "GuiApplication.h" #include "InstrumentTrack.h" @@ -41,7 +42,8 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) : m_noteFillColor(255, 255, 255, 220), m_noteBorderColor(255, 255, 255, 220), m_mutedNoteFillColor(100, 100, 100, 220), - m_mutedNoteBorderColor(100, 100, 100, 220) + m_mutedNoteBorderColor(100, 100, 100, 220), + m_legacySEBB(ConfigManager::inst()->value("ui","legacysebb","0").toInt()) { connect( gui->pianoRoll(), SIGNAL( currentPatternChanged() ), this, SLOT( update() ) ); @@ -180,10 +182,11 @@ void PatternView::constructContextMenu( QMenu * _cm ) void PatternView::mousePressEvent( QMouseEvent * _me ) { + bool displayBB = fixedTCOs() || (pixelsPerBar() >= 96 && m_legacySEBB); if( _me->button() == Qt::LeftButton && - m_pat->m_patternType == Pattern::BeatPattern && - ( fixedTCOs() || pixelsPerBar() >= 96 ) && - _me->y() > height() - s_stepBtnOff->height() ) + m_pat->m_patternType == Pattern::BeatPattern && + displayBB && _me->y() > height() - s_stepBtnOff->height() ) + // when mouse button is pressed in beat/bassline -mode @@ -386,6 +389,7 @@ void PatternView::paintEvent( QPaintEvent * ) const int x_base = TCO_BORDER_WIDTH; + bool displayBB = fixedTCOs() || (pixelsPerBar >= 96 && m_legacySEBB); // melody pattern paint event NoteVector const & noteCollection = m_pat->m_notes; if( m_pat->m_patternType == Pattern::MelodyPattern && !noteCollection.empty() ) @@ -501,9 +505,8 @@ void PatternView::paintEvent( QPaintEvent * ) p.restore(); } - // beat pattern paint event - else if( beatPattern && ( fixedTCOs() || pixelsPerBar >= 96 ) ) + else if( beatPattern && displayBB ) { QPixmap stepon0; QPixmap stepon200; @@ -610,4 +613,4 @@ void PatternView::paintEvent( QPaintEvent * ) } painter.drawPixmap( 0, 0, m_paintPixmap ); -} \ No newline at end of file +}