Merge branch 'variable-tab-widget'

This commit is contained in:
Johannes Lorenz
2019-07-17 22:21:47 +02:00
51 changed files with 85 additions and 53 deletions

View File

@@ -68,7 +68,7 @@ public:
virtual PluginView * instantiateView( QWidget * _parent )
{
return new InstrumentView( this, _parent );
return new InstrumentViewFixedSize( this, _parent );
}
} ;

View File

@@ -32,11 +32,12 @@
class InstrumentTrackWindow;
//! Instrument view with variable size
class LMMS_EXPORT InstrumentView : public PluginView
{
public:
InstrumentView( Instrument * _instrument, QWidget * _parent );
virtual ~InstrumentView();
~InstrumentView() override;
Instrument * model()
{
@@ -48,11 +49,25 @@ public:
return( castModel<Instrument>() );
}
virtual void setModel( Model * _model, bool = false );
void setModel( Model * _model, bool = false ) override;
InstrumentTrackWindow * instrumentTrackWindow();
} ;
//! Instrument view with fixed LMMS-default size
class LMMS_EXPORT InstrumentViewFixedSize : public InstrumentView
{
QSize sizeHint() const override { return QSize(250, 250); }
QSize minimumSizeHint() const override { return sizeHint(); }
public:
using InstrumentView::InstrumentView;
~InstrumentViewFixedSize() override;
} ;
#endif

View File

@@ -78,6 +78,7 @@ protected:
virtual void resizeEvent( QResizeEvent * _re );
virtual void wheelEvent( QWheelEvent * _we );
virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;
private:
struct widgetDesc

View File

@@ -457,7 +457,7 @@ public:
FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );

View File

@@ -111,7 +111,7 @@ private:
} ;
class FreeBoyInstrumentView : public InstrumentView
class FreeBoyInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -922,7 +922,7 @@ public:
GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
GigInstrument * k = castModel<GigInstrument>();

View File

@@ -334,7 +334,7 @@ signals:
class GigInstrumentView : public InstrumentView
class GigInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -681,7 +681,7 @@ void OpulenzInstrument::loadFile( const QString& file ) {
OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
#define KNOB_GEN(knobname, hinttext, hintunit,xpos,ypos) \

View File

@@ -142,7 +142,7 @@ private:
class OpulenzInstrumentView : public InstrumentView
class OpulenzInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -274,7 +274,7 @@ public:
XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) :
InstrumentView(_instrument, _parent)
InstrumentViewFixedSize(_instrument, _parent)
{
const int COL_KNOBS = 194;

View File

@@ -139,7 +139,7 @@ private:
} ;
class XpressiveView : public InstrumentView
class XpressiveView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -449,7 +449,7 @@ QPixmap * AudioFileProcessorView::s_artwork = NULL;
AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
if( s_artwork == NULL )
{

View File

@@ -111,7 +111,7 @@ private:
class AudioFileProcessorWaveView;
class AudioFileProcessorView : public InstrumentView
class AudioFileProcessorView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -326,7 +326,7 @@ PluginView * bitInvader::instantiateView( QWidget * _parent )
bitInvaderView::bitInvaderView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -108,7 +108,7 @@ private:
class bitInvaderView : public InstrumentView
class bitInvaderView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -460,7 +460,7 @@ void CarlaInstrument::sampleRateChanged()
// -------------------------------------------------------------------
CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWidget* const parent)
: InstrumentView(instrument, parent),
: InstrumentViewFixedSize(instrument, parent),
fHandle(instrument->fHandle),
fDescriptor(instrument->fDescriptor),
fTimerId(fHandle != NULL && fDescriptor->ui_idle != NULL ? startTimer(30) : 0)

View File

@@ -99,7 +99,7 @@ private:
friend class CarlaInstrumentView;
};
class CarlaInstrumentView : public InstrumentView
class CarlaInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT

View File

@@ -267,7 +267,7 @@ public:
kickerInstrumentView::kickerInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
const int ROW1 = 14;
const int ROW2 = ROW1 + 56;

View File

@@ -94,7 +94,7 @@ private:
class kickerInstrumentView : public InstrumentView
class kickerInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -803,7 +803,7 @@ PluginView * lb302Synth::instantiateView( QWidget * _parent )
lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
// GUI
m_vcfCutKnob = new Knob( knobBright_26, this );

View File

@@ -256,7 +256,7 @@ private:
} ;
class lb302SynthView : public InstrumentView
class lb302SynthView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -1447,7 +1447,7 @@ void MonstroInstrument::updateSlope2()
MonstroView::MonstroView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_operatorsView = setupOperatorsView( this );
setWidgetBackground( m_operatorsView, "artwork_op" );

View File

@@ -569,7 +569,7 @@ private:
};
class MonstroView : public InstrumentView
class MonstroView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -731,7 +731,7 @@ QPixmap * NesInstrumentView::s_artwork = NULL;
NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent ) :
InstrumentView( instrument, parent )
InstrumentViewFixedSize( instrument, parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -294,7 +294,7 @@ private:
};
class NesInstrumentView : public InstrumentView
class NesInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -417,7 +417,7 @@ public:
organicInstrumentView::organicInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
m_oscKnobs( NULL )
{
organicInstrument * oi = castModel<organicInstrument>();

View File

@@ -173,7 +173,7 @@ private slots:
} ;
class organicInstrumentView : public InstrumentView
class organicInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -443,7 +443,7 @@ PluginView * patmanInstrument::instantiateView( QWidget * _parent )
PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
m_pi( NULL )
{
setAutoFillBackground( true );

View File

@@ -116,7 +116,7 @@ signals:
class PatmanView : public InstrumentView
class PatmanView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -859,7 +859,7 @@ public:
sf2InstrumentView::sf2InstrumentView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
// QVBoxLayout * vl = new QVBoxLayout( this );
// QHBoxLayout * hl = new QHBoxLayout();

View File

@@ -187,7 +187,7 @@ public:
class sf2InstrumentView : public InstrumentView
class sf2InstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -600,7 +600,7 @@ public:
sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
srand(time(NULL));
setAutoFillBackground( true );

View File

@@ -223,7 +223,7 @@ private:
class sfxrInstrumentView : public InstrumentView
class sfxrInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -483,7 +483,7 @@ public:
sidInstrumentView::sidInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );

View File

@@ -132,7 +132,7 @@ private:
class sidInstrumentView : public InstrumentView
class sidInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -384,7 +384,7 @@ PluginView * malletsInstrument::instantiateView( QWidget * _parent )
malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_modalBarWidget = setupModalBarControls( this );
setWidgetBackground( m_modalBarWidget, "artwork" );

View File

@@ -187,7 +187,7 @@ private:
} ;
class malletsInstrumentView: public InstrumentView
class malletsInstrumentView: public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -419,7 +419,7 @@ public:
TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -136,7 +136,7 @@ private:
class TripleOscillatorView : public InstrumentView
class TripleOscillatorView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -468,7 +468,7 @@ PluginView * vestigeInstrument::instantiateView( QWidget * _parent )
VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent ),
InstrumentViewFixedSize( _instrument, _parent ),
lastPosInMenu (0)
{
if( s_artwork == NULL )
@@ -900,7 +900,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrument,
QWidget * _parent, vestigeInstrument * m_vi2 ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
m_vi = m_vi2;
m_vi->m_scrollArea = new QScrollArea( this );

View File

@@ -97,7 +97,7 @@ private:
} ;
class manageVestigeInstrumentView : public InstrumentView
class manageVestigeInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:
@@ -133,7 +133,7 @@ private:
} ;
class VestigeInstrumentView : public InstrumentView
class VestigeInstrumentView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -349,7 +349,7 @@ PluginView * vibed::instantiateView( QWidget * _parent )
vibedView::vibedView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -82,7 +82,7 @@ private:
class vibedView : public InstrumentView
class vibedView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -666,7 +666,7 @@ void WatsynInstrument::updateWaveB2()
WatsynView::WatsynView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -293,7 +293,7 @@ private:
};
class WatsynView : public InstrumentView
class WatsynView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -497,7 +497,7 @@ PluginView * ZynAddSubFxInstrument::instantiateView( QWidget * _parent )
ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) :
InstrumentView( _instrument, _parent )
InstrumentViewFixedSize( _instrument, _parent )
{
setAutoFillBackground( true );
QPalette pal;

View File

@@ -132,7 +132,7 @@ signals:
class ZynAddSubFxView : public InstrumentView
class ZynAddSubFxView : public InstrumentViewFixedSize
{
Q_OBJECT
public:

View File

@@ -36,6 +36,7 @@ EffectControlDialog::EffectControlDialog( EffectControls * _controls ) :
m_effectControls( _controls )
{
setWindowTitle( m_effectControls->effect()->displayName() );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
}

View File

@@ -70,3 +70,10 @@ InstrumentTrackWindow * InstrumentView::instrumentTrackWindow( void )
parentWidget()->parentWidget() ) );
}
InstrumentViewFixedSize::~InstrumentViewFixedSize()
{
}

View File

@@ -1,4 +1,4 @@
/*
/*
* SubWindow.cpp - Implementation of QMdiSubWindow that correctly tracks
* the geometry that windows should be restored to.
* Workaround for https://bugreports.qt.io/browse/QTBUG-256
@@ -349,10 +349,10 @@ void SubWindow::focusChanged( QMdiSubWindow *subWindow )
/**
* @brief SubWindow::resizeEvent
*
* On every rezise event we have to adjust our title label.
*
* At next we give the event to QMdiSubWindow::resizeEvent() which handles
* At first we give the event to QMdiSubWindow::resizeEvent() which handles
* the event on its behavior.
*
* On every resize event we have to adjust our title label.
*
* At last we store the current size into m_trackedNormalGeom. This size
* will be saved with the project because of an Qt bug wich doesn't

View File

@@ -333,6 +333,14 @@ QSize TabWidget::minimumSizeHint() const
QSize TabWidget::sizeHint() const
{
return minimumSizeHint();
}
// Return the color to be used to draw a TabWidget's title text (if any)
QColor TabWidget::tabTitleText() const
{