rpms/amarok/F-10 amarok.cv.weirdness.patch, NONE, 1.1 amarok.elide.highcpu.patch, NONE, 1.1 .cvsignore, 1.39, 1.40 amarok.spec, 1.126, 1.127 sources, 1.39, 1.40
Rex Dieter
rdieter at fedoraproject.org
Mon Dec 8 14:52:15 UTC 2008
- Previous message (by thread): rpms/bluez-gnome/F-10 0001-Another-GPS-device-from-Holux.patch, NONE, 1.1 0002-Add-no-name-GPS-device.patch, NONE, 1.1 bluez-gnome.spec, 1.72, 1.73
- Next message (by thread): rpms/eigen2/devel .cvsignore, 1.3, 1.4 eigen2.spec, 1.2, 1.3 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: rdieter
Update of /cvs/pkgs/rpms/amarok/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6548
Modified Files:
.cvsignore amarok.spec sources
Added Files:
amarok.cv.weirdness.patch amarok.elide.highcpu.patch
Log Message:
* Fri Dec 05 2008 Rex Dieter <rdieter at fedoraproject.org> - 2.0-1
- amarok-2.0 (final, first cut)
amarok.cv.weirdness.patch:
--- NEW FILE amarok.cv.weirdness.patch ---
diff --git a/src/context/ContextView.cpp b/src/context/ContextView.cpp
index bab9cb4..8ee9425 100644
--- a/src/context/ContextView.cpp
+++ b/src/context/ContextView.cpp
@@ -296,11 +296,11 @@ ContextView::zoomIn( Plasma::Containment* toContainment )
containment->setZoomLevel( Plasma::DesktopZoom );
if ( m_zoomLevel == Plasma::GroupZoom )
- {
+ {
m_zoomLevel = Plasma::DesktopZoom;
qreal factor = Plasma::scalingFactor( m_zoomLevel ) / matrix().m11();
scale( factor, factor );
- updateContainmentsGeometry();
+
int count = contextScene()->containments().size();
for( int i = 0; i < count; i++ )
{
@@ -309,7 +309,14 @@ ContextView::zoomIn( Plasma::Containment* toContainment )
{
containment->hideTitle();
}
- }
+ }
+
+ updateContainmentsGeometry();
+
+ qreal left, top, right, bottom;
+ containment->getContentsMargins( &left, &top, &right, &bottom );
+ setSceneRect( containment->geometry().adjusted( left, top, -right, -bottom ) );
+
}
}
@@ -320,19 +327,17 @@ ContextView::zoomOut( Plasma::Containment* fromContainment )
DEBUG_BLOCK
Q_UNUSED( fromContainment )
if ( m_zoomLevel == Plasma::DesktopZoom )
- {
-
- int count = contextScene()->containments().size();
+ {
+ int count = contextScene()->containments().size();
for( int i = 0; i < count; i++ )
- {
+ {
Containment* containment = qobject_cast< Containment* >( contextScene()->containments()[i] );
if( containment )
{
containment->showTitle();
- containment->setZoomLevel( Plasma::GroupZoom );
+ containment->setZoomLevel( Plasma::GroupZoom);
}
- }
- updateContainmentsGeometry( true );
+ }
m_zoomLevel = Plasma::GroupZoom;
debug() << "Scaling factor: " << Plasma::scalingFactor( m_zoomLevel );
qreal factor = Plasma::scalingFactor( m_zoomLevel ) - 0.05;
@@ -467,33 +472,38 @@ void ContextView::resizeEvent( QResizeEvent* event )
void
-ContextView::updateContainmentsGeometry( bool updateAll )
+ContextView::updateContainmentsGeometry()
{
DEBUG_BLOCK
-
+
+ debug() << "cv rect: " << rect();
+ int x,y;
+ const int last = contextScene()->containments().size() - 1;
const int width = rect().width();
const int height = rect().height();
-
+
if( m_zoomLevel == Plasma::DesktopZoom )
{
- qreal left, top, right, bottom;
- containment()->getContentsMargins( &left, &top, &right, &bottom );
- if( updateAll )
+ for( int i = last; i >= 0; i-- )
{
- foreach( Plasma::Containment *cont, contextScene()->containments() )
- {
- cont->resize( width + left + right, height + top + bottom );
- cont->updateConstraints();
- }
- }
- else
- {
- containment()->resize( width + left + right, height + top + bottom );
- containment()->updateConstraints();
- QRectF contRect( containment()->geometry() );
- setSceneRect( contRect.adjusted( left, top, -right, -bottom ) );
- }
+ Plasma::Containment *cont = contextScene()->containments()[i];
+
+ x = ( width + 25 ) * ( i % 2 );
+ y = ( height + 65 )* ( i / 2 );
+ debug() << "width: " << width;
+ debug() << "height: " << height;
+ cont->resize( width + 20, height + 60 );
+ cont->setPos( rect().topLeft().x() + x, rect().topLeft().y() + y );
+
+ debug() << "newPos: " << rect().topLeft().x() + x << "," << rect().topLeft().y() + y;
+ cont->updateConstraints();
+ debug() << "containment geometry:" << cont->geometry();
+ }
+ qreal left, top, right, bottom;
+ containment()->getContentsMargins( &left, &top, &right, &bottom );
+ QRectF contRect( containment()->geometry() );
+ setSceneRect( contRect.adjusted( left, top, -right, -bottom ) );
}
}
@@ -522,11 +532,19 @@ ContextView::addContainment( const QVariantList& args )
Plasma::Containment *c = corona->addContainment( "context", args );
c->setScreen( 0 );
c->setFormFactor( Plasma::Planar );
- qreal left, top, right, bottom;
- containment()->getContentsMargins( &left, &top, &right, &bottom );
- QSizeF newSize( rect().width() + left + right, rect().height() + top + bottom );
+ const int x = ( rect().width() + 25 ) * ( size % 2 );
+ const int y = ( rect().height() + 65 ) * ( size / 2 );
+
+ debug() << "x: " << x;
+ debug() << "y: " << y;
+
+ QSizeF newSize( rect().width() + 20, rect().height() + 60 );
+ QPointF newPos( rect().topLeft().x() + x, rect().topLeft().y() + y );
+ debug() << "new size: " << newSize;
+ debug() << "new pos: " << newPos;
c->resize( newSize );
+ c->setPos( newPos );
c->updateConstraints();
connectContainment( c );
Containment *amarokContainment = qobject_cast< Containment * >( c );
@@ -577,54 +595,57 @@ ContextView::disconnectContainment( Plasma::Containment* containment )
}
void
-ContextView::setContainment( Plasma::Containment* newContainment )
+ContextView::setContainment( Plasma::Containment* containment )
{
DEBUG_BLOCK
- if( newContainment->isContainment() )
+ if( containment != this->containment() )
{
- if( newContainment != containment() )
+ DEBUG_LINE_INFO
+// disconnectContainment( this->containment() );
+ if( containment->isContainment() )
{
-
if( m_startupFinished )
+ m_startPos = this->containment()->geometry();
+
+ m_containment = containment;
+
+ //resize the containment and the scene to an appropriate size
+ qreal left, top, right, bottom;
+ containment->getContentsMargins( &left, &top, &right, &bottom );
+
+ QSizeF correctSize( rect().size().width() + left - right , rect().size().height() + top - bottom );
+ if( m_zoomLevel == Plasma::DesktopZoom )
+ {
+ containment->resize( correctSize );
+ setSceneRect( containment->contentsRect() );
+ }
+ else
{
- //Resize the containment first because it probably had a wrong geometry.
- //Be aware that plasma automatically change all other containments position so they don't overlap.
- newContainment->resize( containment()->size() );
- newContainment->updateConstraints();
-
- //Plasma changes the containments placement but not inmediately so we can't rely on it yet
- const QList< Plasma::Containment* > containments = contextScene()->containments();
- int fromIndex = containments.indexOf( containment() );
- qreal width = containment()->size().width();
- qreal height = containment()->size().height();
- qreal x = width * ( fromIndex % CONTAINMENT_COLUMNS );
- qreal y = height * ( fromIndex / CONTAINMENT_COLUMNS );
- m_startPos = QRectF( QPointF( x, y ), QSizeF( width, height ) );
-
- if( m_zoomLevel == Plasma::DesktopZoom )
- {
-
- int toIndex = containments.indexOf( newContainment );
- x = width * ( toIndex % CONTAINMENT_COLUMNS );
- y = height * ( toIndex / CONTAINMENT_COLUMNS );
- m_destinationPos = QRectF( QPointF( x, y ), QSizeF( width, height ) );
-
- Containment* amarokContainment = qobject_cast<Containment*>( newContainment );
- if( amarokContainment )
- amarokContainment->setZoomLevel( Plasma::DesktopZoom );
-
- connect( Plasma::Animator::self(), SIGNAL( customAnimationFinished( int ) ),
- this, SLOT( animateContainmentChangeFinished( int ) ) );
-
- Plasma::Animator::self()->customAnimation( m_startPos.width() / 30, 250,
- Plasma::Animator::EaseInOutCurve,
- this, "animateContainmentChange" );
- }
+ containment->resize( correctSize );
+ debug() << "correct size: " << correctSize;
+ QRectF correctRect( 0, 0,
+ mapToScene( rect() ).boundingRect().width(),
+ mapToScene( rect() ).boundingRect().height() );
+ setSceneRect( correctRect );
+ debug() << "setSceneRect: " << mapToScene( rect() ).boundingRect() ;
+ }
+
+ if( m_startupFinished && m_zoomLevel == Plasma::DesktopZoom )
+ {
+ m_destinationPos = containment->geometry();
+
+ Containment* amarokContainment = qobject_cast<Containment*>( containment );
+ if( amarokContainment )
+ amarokContainment->setZoomLevel( Plasma::DesktopZoom );
+
+ Plasma::Animator::self()->customAnimation( m_startPos.width() / 30, 250,
+ Plasma::Animator::EaseInOutCurve,
+ this, "animateContainmentChange" );
+ debug() << "startPos: " << m_startPos;
+ debug() << "destinationPos: " << m_destinationPos;
}
- m_containment = newContainment;
}
}
-
}
@@ -706,7 +727,7 @@ void
ContextView::animateContainmentChange( qreal progress, int id )
{
Q_UNUSED( id )
- DEBUG_BLOCK
+
qreal incrementX;
qreal incrementY;
@@ -719,39 +740,30 @@ ContextView::animateContainmentChange( qreal progress, int id )
if( m_startPos.left() < m_destinationPos.left() )
{
- incrementX = progress * ( m_destinationPos.width() + left + INTER_CONTAINMENT_MARGIN );
+ incrementX = progress * ( m_destinationPos.width() + left + 5 );
x = m_startPos.left() + incrementX;
}
else if ( m_startPos.left() > m_destinationPos.left() )
{
- incrementX = progress * ( m_destinationPos.width() );
+ incrementX = progress * ( m_destinationPos.width() + 5 );
x = m_startPos.left() - incrementX;
}
if( m_startPos.top() < m_destinationPos.top() )
{
- incrementY = progress * ( m_destinationPos.height() + top + INTER_CONTAINMENT_MARGIN );
+ incrementY = progress * ( m_destinationPos.height() + top + 5 );
y = m_startPos.top() + incrementY;
}
else if( m_startPos.top() > m_destinationPos.top() )
{
- incrementY = progress * ( m_destinationPos.height() );
+ incrementY = progress * ( m_destinationPos.height() + 5 );
y = m_startPos.top() - incrementY;
}
- debug() << "( "<<x << ", " << y << " ) ";
+
QRectF visibleRect( QPointF( x, y ), m_destinationPos.size() );
setSceneRect( visibleRect );
}
void
-ContextView::animateContainmentChangeFinished( int id )
-{
- Q_UNUSED( id )
- updateContainmentsGeometry( true );
- disconnect( Plasma::Animator::self(), SIGNAL( customAnimationFinished( int ) ),
- this, SLOT( animateContainmentChangeFinished( int ) ) );
-}
-
-void
ContextView::findContainmentForApplet( QString pluginName, int rowSpan )
{
DEBUG_BLOCK
@@ -774,6 +786,12 @@ ContextView::findContainmentForApplet( QString pluginName, int rowSpan )
amarokContainment->addApplet( pluginName );
setContainment( amarokContainment );
+ if( m_zoomLevel == Plasma::DesktopZoom )
+ {
+ //HACK alert!
+ resize( size().width()+1, size().height() );
+ resize( size().width()-1, size().height() );
+ }
placeFound = true;
}
diff --git a/src/context/ContextView.h b/src/context/ContextView.h
index 3f02620..efbde78 100644
--- a/src/context/ContextView.h
+++ b/src/context/ContextView.h
@@ -33,14 +33,10 @@
#include <QGraphicsView>
-
class QPixmap;
namespace Context
{
-
-static const int INTER_CONTAINMENT_MARGIN = 6;
-static const int CONTAINMENT_COLUMNS = 2;
class ContextScene;
class ControlBox;
@@ -130,11 +126,9 @@ private:
void disconnectContainment( Plasma::Containment* containment );
/**
- * Set the current containment or all containments geometry in the scene with the same geometry as the
- * Context View widget.
- * @arg updateAll if true updates all containments else only the current containment.
+ * Set all containments geometry in the scene with the same geometry as the Context View widget
*/
- void updateContainmentsGeometry( bool updateAll = false );
+ void updateContainmentsGeometry();
void centerOnZoom( qreal factor, Plasma::ZoomDirection direction );
@@ -165,12 +159,6 @@ private slots:
void zoomInFinished( int id );
void zoomOutFinished( int id );
void animateContainmentChange( qreal progress, int id );
-
- /**
- * Correct containments geometries after containment change animation has finished
- * @arg id the id of the custom animation
- */
- void animateContainmentChangeFinished( int id );
};
} // Context namespace
amarok.elide.highcpu.patch:
--- NEW FILE amarok.elide.highcpu.patch ---
diff --git a/src/context/widgets/ToolBoxIcon.cpp b/src/context/widgets/ToolBoxIcon.cpp
index e4e689a..ab01b5d 100644
--- a/src/context/widgets/ToolBoxIcon.cpp
+++ b/src/context/widgets/ToolBoxIcon.cpp
@@ -93,7 +93,6 @@ ToolBoxIcon::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, Q
const QFontMetricsF fm( m_text->font() );
m_text->setPos( PADDING, size().height() / 2 - fm.boundingRect( m_text->text() ).height() / 2 );
- m_text->setText( fm.elidedText ( m_text->text(), Qt::ElideRight, size().width() - 20 ) );
painter->save();
QColor color = KColorScheme( QPalette::Active, KColorScheme::Window,
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/amarok/F-10/.cvsignore,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- .cvsignore 21 Nov 2008 16:19:45 -0000 1.39
+++ .cvsignore 8 Dec 2008 14:51:44 -0000 1.40
@@ -1 +1 @@
-amarok-1.98.tar.bz2
+amarok-2.0.tar.bz2
Index: amarok.spec
===================================================================
RCS file: /cvs/pkgs/rpms/amarok/F-10/amarok.spec,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -r1.126 -r1.127
--- amarok.spec 21 Nov 2008 16:19:45 -0000 1.126
+++ amarok.spec 8 Dec 2008 14:51:44 -0000 1.127
@@ -1,15 +1,19 @@
Name: amarok
Summary: Media player
-Version: 1.98
+Version: 2.0
Release: 1%{?dist}
Group: Applications/Multimedia
License: GPLv2+
Url: http://amarok.kde.org/
-Source0: http://download.kde.org/unstable/amarok/%{version}/src/amarok-%{version}.tar.bz2
+Source0: http://download.kde.org/stable/amarok/%{version}/src/amarok-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# upstream patches
+Patch100: amarok.elide.highcpu.patch
+Patch101: amarok.cv.weirdness.patch
+
BuildRequires: curl-devel
BuildRequires: desktop-file-utils
BuildRequires: gettext
@@ -48,6 +52,9 @@
%prep
%setup -q
+%patch100 -p1 -b .elide_highcpu
+%patch101 -p1 -b .cv_wierdness
+
%build
mkdir -p %{_target_platform}
@@ -113,6 +120,9 @@
%changelog
+* Fri Dec 05 2008 Rex Dieter <rdieter at fedoraproject.org> - 2.0-1
+- amarok-2.0 (final, first cut)
+
* Fri Nov 21 2008 Rex Dieter <rdieter at fedoraproject.org> - 1.98-1
- amarok-1.98 (2rc1)
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/amarok/F-10/sources,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- sources 21 Nov 2008 16:19:45 -0000 1.39
+++ sources 8 Dec 2008 14:51:45 -0000 1.40
@@ -1 +1 @@
-410863050e5de95df82106cc9dfe486a amarok-1.98.tar.bz2
+05d95c3f4ef589353c1e2c2ece0e3cec amarok-2.0.tar.bz2
- Previous message (by thread): rpms/bluez-gnome/F-10 0001-Another-GPS-device-from-Holux.patch, NONE, 1.1 0002-Add-no-name-GPS-device.patch, NONE, 1.1 bluez-gnome.spec, 1.72, 1.73
- Next message (by thread): rpms/eigen2/devel .cvsignore, 1.3, 1.4 eigen2.spec, 1.2, 1.3 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list