mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Merge remote branch 'origin' into phonon
This commit is contained in:
@@ -74,8 +74,10 @@ function deplib_change
|
||||
install_name_tool -change /usr/local/Cellar/flac/1.2.1/lib/libFLAC.8.dylib @executable_path/libFLAC.8.dylib $1
|
||||
install_name_tool -change $ORIGROOT/src/libtomahawk/libtomahawklib.dylib @executable_path/libtomahawklib.dylib $1
|
||||
install_name_tool -change $ORIGROOT/libsip_jabber.dylib @executable_path/libsip_jabber.dylib $1
|
||||
install_name_tool -change $ORIGROOT/libsip_twitter.dylib @executable_path/libsip_twitter.dylib $1
|
||||
install_name_tool -change $ORIGROOT/libsip_zeroconf.dylib @executable_path/libsip_zeroconf.dylib $1
|
||||
install_name_tool -change $ORIGROOT/thirdparty/jdns/libtomahawk_jdns.dylib @executable_path/libtomahawk_jdns.dylib $1
|
||||
install_name_tool -change $ORIGROOT/thirdparty/qtweetlib/libtomahawk_qtweetlib.dylib @executable_path/libtomahawk_qtweetlib.dylib $1
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -104,18 +106,22 @@ import_lib /usr/local/lib/libechonest.1.1.dylib
|
||||
import_lib /usr/local/Cellar/clucene/0.9.21/lib/libclucene.0.dylib
|
||||
|
||||
import_lib ../../libsip_jabber.dylib
|
||||
import_lib ../../libsip_twitter.dylib
|
||||
import_lib ../../libsip_zeroconf.dylib
|
||||
import_lib ../../src/libtomahawk/libtomahawklib.dylib
|
||||
import_lib ../../thirdparty/jdns/libtomahawk_jdns.dylib
|
||||
import_lib ../../thirdparty/qtweetlib/libtomahawk_qtweetlib.dylib
|
||||
|
||||
deposx_change MacOS/libqjson.0.dylib
|
||||
deposx_change MacOS/liblastfm.0.dylib
|
||||
deposx_change MacOS/libclucene.0.dylib
|
||||
deposx_change MacOS/libechonest.1.1.dylib
|
||||
deposx_change MacOS/libsip_jabber.dylib
|
||||
deposx_change MacOS/libsip_twitter.dylib
|
||||
deposx_change MacOS/libsip_zeroconf.dylib
|
||||
deposx_change MacOS/libtomahawklib.dylib
|
||||
deposx_change MacOS/libtomahawk_jdns.dylib
|
||||
deposx_change MacOS/libtomahawk_qtweetlib.dylib
|
||||
|
||||
# now Qt
|
||||
for x in $QTLIBS
|
||||
|
@@ -201,36 +201,14 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
|
||||
|
||||
m_fadingIndexes = QPixmap::grabWidget( this, fadingRect ); // but all values we use to grab the widgetr have to be in scrollarea coords :(
|
||||
m_fadingPointAnchor = QPoint( 0, fadingRectViewport.topLeft().y() );
|
||||
|
||||
|
||||
// get the background
|
||||
m_bg = QPixmap( m_fadingIndexes.size() );
|
||||
m_bg.fill( Qt::white );
|
||||
QPainter p( &m_bg );
|
||||
QStyleOptionViewItemV4 opt = viewOptions();
|
||||
// code taken from QTreeViewPrivate::paintAlternatingRowColors
|
||||
if( alternatingRowColors() ) {
|
||||
m_fadebg = !style()->styleHint( QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, &opt );
|
||||
qDebug() << "PAINTING ALTERNATING ROW BG!: " << fadingRectViewport;
|
||||
int rowHeight = itemDelegate()->sizeHint( opt, QModelIndex() ).height();
|
||||
int y = m_fadingIndexes.rect().topLeft().y();
|
||||
int current = startRow;
|
||||
while( y <= m_fadingIndexes.rect().bottomLeft().y() ) {
|
||||
opt.rect.setRect(0, y, viewport()->width(), rowHeight);
|
||||
qDebug() << "Painting a row from " << y << "to" << y + rowHeight << ":" << opt.rect;
|
||||
if( current & 1 ) {
|
||||
opt.features |= QStyleOptionViewItemV2::Alternate;
|
||||
} else {
|
||||
opt.features &= ~QStyleOptionViewItemV2::Alternate;
|
||||
}
|
||||
++current;
|
||||
style()->drawPrimitive( QStyle::PE_PanelItemViewRow, &opt, &p );
|
||||
y += rowHeight;
|
||||
}
|
||||
}
|
||||
m_bg = backgroundBetween( m_fadingIndexes.rect(), startRow );
|
||||
|
||||
m_fadeOutAnim.start();
|
||||
|
||||
qDebug() << "Grabbed fading indexes from rect:" << fadingRect << m_fadingIndexes.size();
|
||||
|
||||
|
||||
if( !justFade ) {
|
||||
/// sanity checks. make sure we have all the rows we need
|
||||
int firstSlider = startRow + realNum;
|
||||
@@ -242,8 +220,7 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
|
||||
firstSlider = proxyModel()->rowCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
topLeft = proxyModel()->index( startRow + realNum, 0, QModelIndex() );
|
||||
bottomRight = proxyModel()->index( startRow + realNum + numToKeep - 1, proxyModel()->columnCount( QModelIndex() ) - 1, QModelIndex() );
|
||||
QRect slidingRect = visualRegionForSelection( QItemSelection( topLeft, bottomRight ) ).boundingRect();
|
||||
@@ -255,12 +232,12 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
|
||||
m_bottomAnchor = QPoint( 0, slidingRectViewport.topLeft().y() );
|
||||
m_bottomOfAnim = QPoint( 0, slidingRectViewport.bottomLeft().y() );
|
||||
qDebug() << "Grabbed sliding index from rect:" << slidingRect << m_slidingIndex.size();
|
||||
|
||||
|
||||
// slide from the current position to the new one
|
||||
int frameRange = fadingRect.topLeft().y() - slidingRect.topLeft().y();
|
||||
m_slideAnim.setDuration( SLIDE_LENGTH + frameRange * LONG_MULT );
|
||||
m_slideAnim.setFrameRange( slidingRectViewport.topLeft().y(), fadingRectViewport.topLeft().y() );
|
||||
|
||||
|
||||
QTimer::singleShot( SLIDE_OFFSET, &m_slideAnim, SLOT( start() ) );
|
||||
}
|
||||
|
||||
@@ -274,6 +251,35 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
|
||||
proxyModel()->removeIndexes( todel );
|
||||
}
|
||||
|
||||
QPixmap
|
||||
DynamicView::backgroundBetween( QRect rect, int rowStart )
|
||||
{
|
||||
QPixmap bg = QPixmap( rect.size() );
|
||||
bg.fill( Qt::white );
|
||||
QPainter p( &bg );
|
||||
QStyleOptionViewItemV4 opt = viewOptions();
|
||||
// code taken from QTreeViewPrivate::paintAlternatingRowColors
|
||||
m_fadebg = !style()->styleHint( QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, &opt );
|
||||
// qDebug() << "PAINTING ALTERNATING ROW BG!: " << fadingRectViewport;
|
||||
int rowHeight = itemDelegate()->sizeHint( opt, QModelIndex() ).height() + 1;
|
||||
int y = 0;
|
||||
int current = rowStart;
|
||||
while( y <= rect.bottomLeft().y() ) {
|
||||
opt.rect.setRect(0, y, viewport()->width(), rowHeight);
|
||||
// qDebug() << "PAINTING BG ROW IN RECT" << y << "to" << y + rowHeight << ":" << opt.rect;
|
||||
if( current & 1 ) {
|
||||
opt.features |= QStyleOptionViewItemV2::Alternate;
|
||||
} else {
|
||||
opt.features &= ~QStyleOptionViewItemV2::Alternate;
|
||||
}
|
||||
++current;
|
||||
style()->drawPrimitive( QStyle::PE_PanelItemViewRow, &opt, &p );
|
||||
y += rowHeight;
|
||||
}
|
||||
|
||||
return bg;
|
||||
}
|
||||
|
||||
void
|
||||
DynamicView::animFinished()
|
||||
{
|
||||
@@ -294,7 +300,6 @@ DynamicView::paintEvent( QPaintEvent* event )
|
||||
bg.moveTo( m_fadingPointAnchor ); // cover up the background
|
||||
if( m_fadebg ) {
|
||||
p.save();
|
||||
p.fillRect( bg, Qt::white );
|
||||
|
||||
p.setOpacity( 1 - m_fadeOutAnim.currentValue() );
|
||||
}
|
||||
@@ -302,19 +307,13 @@ DynamicView::paintEvent( QPaintEvent* event )
|
||||
if( m_fadebg ) {
|
||||
p.restore();
|
||||
}
|
||||
|
||||
// qDebug() << "FAST SETOPACITY:" << p.paintEngine()->hasFeature(QPaintEngine::ConstantOpacity);
|
||||
// qDebug() << "FAST SETOPACITY:" << p.paintEngine()->hasFeature(QPaintEngine::ConstantOpacity);
|
||||
p.setOpacity( 1 - m_fadeOutAnim.currentValue() );
|
||||
p.drawPixmap( m_fadingPointAnchor, m_fadingIndexes );
|
||||
|
||||
p.restore();
|
||||
|
||||
if( m_slideAnim.state() == QTimeLine::Running ) {
|
||||
// draw the collapsing entry
|
||||
QRect bg = m_slidingIndex.rect();
|
||||
bg.moveTo( m_bottomAnchor );
|
||||
bg.setBottom( m_bottomOfAnim.y() );
|
||||
p.fillRect( bg, Qt::white );
|
||||
p.drawPixmap( 0, m_slideAnim.currentFrame(), m_slidingIndex );
|
||||
} else if( m_fadeOutAnim.state() == QTimeLine::Running ) {
|
||||
p.drawPixmap( 0, m_bottomAnchor.y(), m_slidingIndex );
|
||||
|
@@ -63,6 +63,8 @@ private slots:
|
||||
void animFinished();
|
||||
|
||||
private:
|
||||
QPixmap backgroundBetween( QRect rect, int rowStart );
|
||||
|
||||
DynamicModel* m_model;
|
||||
QString m_title;
|
||||
QString m_body;
|
||||
|
@@ -36,6 +36,7 @@ target_link_libraries( sip_jabber
|
||||
${QT_LIBRARIES}
|
||||
${GLOOX_LIBRARIES}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
tomahawklib
|
||||
)
|
||||
|
||||
IF( APPLE )
|
||||
|
@@ -43,6 +43,7 @@ ENDIF( WIN32 )
|
||||
target_link_libraries( sip_twitter
|
||||
${QT_LIBRARIES}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
tomahawklib
|
||||
)
|
||||
|
||||
IF( APPLE )
|
||||
|
@@ -34,6 +34,7 @@ ENDIF( WIN32 )
|
||||
target_link_libraries( sip_zeroconf
|
||||
${QT_LIBRARIES}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
tomahawklib
|
||||
)
|
||||
|
||||
IF( APPLE )
|
||||
|
Reference in New Issue
Block a user