Merge branch 'stable-1.1' of git@github.com:LMMS/lmms.git
Conflicts: src/gui/MainWindow.cpp src/gui/plugin_browser.cpp
This commit is contained in:
@@ -94,7 +94,7 @@ MainWindow::MainWindow() :
|
||||
splitter->setChildrenCollapsible( false );
|
||||
|
||||
QString wdir = ConfigManager::inst()->workingDir();
|
||||
sideBar->appendTab( new pluginBrowser( splitter ) );
|
||||
sideBar->appendTab( new PluginBrowser( splitter ) );
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
ConfigManager::inst()->userProjectsDir() + "*" +
|
||||
ConfigManager::inst()->factoryProjectsDir(),
|
||||
|
||||
@@ -43,7 +43,7 @@ bool pluginBefore( const Plugin::Descriptor& d1, const Plugin::Descriptor& d2 )
|
||||
|
||||
|
||||
|
||||
pluginBrowser::pluginBrowser( QWidget * _parent ) :
|
||||
PluginBrowser::PluginBrowser( QWidget * _parent ) :
|
||||
SideBarWidget( tr( "Instrument plugins" ),
|
||||
embed::getIconPixmap( "plugins" ).transformed( QTransform().rotate( 90 ) ), _parent )
|
||||
{
|
||||
@@ -65,29 +65,20 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) :
|
||||
m_view );
|
||||
hint->setFont( pointSize<8>( hint->font() ) );
|
||||
hint->setWordWrap( true );
|
||||
view_layout->addWidget( hint );
|
||||
|
||||
Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
qSort( m_pluginDescriptors.begin(), m_pluginDescriptors.end(), pluginBefore );
|
||||
QScrollArea* scrollarea = new QScrollArea( m_view );
|
||||
PluginDescList* descList = new PluginDescList( m_view );
|
||||
scrollarea->setWidget(descList);
|
||||
scrollarea->setWidgetResizable(true);
|
||||
|
||||
for( Plugin::DescriptorList::ConstIterator it = m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
{
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
pluginDescWidget * p = new pluginDescWidget( *it, m_view );
|
||||
p->show();
|
||||
view_layout->addWidget( p );
|
||||
}
|
||||
}
|
||||
view_layout->addStretch();
|
||||
show();
|
||||
view_layout->addWidget(hint);
|
||||
view_layout->addWidget(scrollarea);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
pluginBrowser::~pluginBrowser()
|
||||
PluginBrowser::~PluginBrowser()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -96,8 +87,36 @@ pluginBrowser::~pluginBrowser()
|
||||
|
||||
|
||||
|
||||
PluginDescList::PluginDescList(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
pluginDescWidget::pluginDescWidget( const Plugin::Descriptor & _pd,
|
||||
Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
std::sort(m_pluginDescriptors.begin(), m_pluginDescriptors.end(), pluginBefore);
|
||||
|
||||
|
||||
for(Plugin::DescriptorList::const_iterator it = m_pluginDescriptors.constBegin();
|
||||
it != m_pluginDescriptors.constEnd(); it++)
|
||||
{
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
PluginDescWidget* p = new PluginDescWidget( *it, this );
|
||||
p->show();
|
||||
layout->addWidget(p);
|
||||
}
|
||||
}
|
||||
|
||||
setLayout(layout);
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PluginDescWidget::PluginDescWidget( const Plugin::Descriptor & _pd,
|
||||
QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_updateTimer( this ),
|
||||
@@ -115,14 +134,14 @@ pluginDescWidget::pluginDescWidget( const Plugin::Descriptor & _pd,
|
||||
|
||||
|
||||
|
||||
pluginDescWidget::~pluginDescWidget()
|
||||
PluginDescWidget::~PluginDescWidget()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
void PluginDescWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
const QColor fill_color = m_mouseOver ? QColor( 224, 224, 224 ) :
|
||||
QColor( 192, 192, 192 );
|
||||
@@ -152,7 +171,7 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
QRect br;
|
||||
p.drawText( 10 + logo_size.width(), 20, width() - 58 - 5, 999,
|
||||
Qt::TextWordWrap,
|
||||
pluginBrowser::tr( m_pluginDescriptor.description ),
|
||||
PluginBrowser::tr( m_pluginDescriptor.description ),
|
||||
&br );
|
||||
if( m_mouseOver )
|
||||
{
|
||||
@@ -165,7 +184,7 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::enterEvent( QEvent * _e )
|
||||
void PluginDescWidget::enterEvent( QEvent * _e )
|
||||
{
|
||||
m_mouseOver = true;
|
||||
m_targetHeight = height() + 1;
|
||||
@@ -176,7 +195,7 @@ void pluginDescWidget::enterEvent( QEvent * _e )
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::leaveEvent( QEvent * _e )
|
||||
void PluginDescWidget::leaveEvent( QEvent * _e )
|
||||
{
|
||||
m_mouseOver = false;
|
||||
m_targetHeight = 24;
|
||||
@@ -187,7 +206,7 @@ void pluginDescWidget::leaveEvent( QEvent * _e )
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::mousePressEvent( QMouseEvent * _me )
|
||||
void PluginDescWidget::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton )
|
||||
{
|
||||
@@ -200,7 +219,7 @@ void pluginDescWidget::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::updateHeight()
|
||||
void PluginDescWidget::updateHeight()
|
||||
{
|
||||
if( m_targetHeight > height() )
|
||||
{
|
||||
|
||||
@@ -1279,7 +1279,14 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
subWin->setWindowFlags( flags );
|
||||
subWin->setWindowIcon( embed::getIconPixmap( "instrument_track" ) );
|
||||
|
||||
// Hide the Size and Maximize options from the system menu
|
||||
// since the dialog size is fixed.
|
||||
QMenu * systemMenu = subWin->systemMenu();
|
||||
systemMenu->actions().at( 2 )->setVisible( false ); // Size
|
||||
systemMenu->actions().at( 4 )->setVisible( false ); // Maximize
|
||||
|
||||
subWin->setWindowIcon( embed::getIconPixmap( "instrument_track" ) );
|
||||
subWin->setFixedSize( subWin->size() );
|
||||
subWin->hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user