extragear/multimedia/amarok/src
Dan Meltzer
hydrogen at notyetimplemented.com
Sat Mar 17 04:13:42 CET 2007
SVN commit 643374 by dmeltzer:
Add spacer between equalizer and search bar. It apparently is not possible to add the same action multiple times, so I cannot reuse the spacer. Does this mean that I need three classes in actionclasses to have three blank spaces?
CCMAIL: amarok-devel at kde.org
M +21 -2 actionclasses.cpp
M +6 -0 actionclasses.h
M +6 -3 amarokui.rc
M +3 -3 playlistwindow.cpp
--- trunk/extragear/multimedia/amarok/src/actionclasses.cpp #643373:643374
@@ -30,6 +30,7 @@
#include <kauthorized.h>
#include <QPixmap>
+#include <QStackedWidget>
#include <QToolTip>
#include <Q3PopupMenu>
@@ -462,8 +463,8 @@
// SearchAction
//////////////////////////////////////////////////////////////////////////////////////////
-SearchAction::SearchAction( KActionCollection *ac ) :
- KAction( 0 ),
+SearchAction::SearchAction( KActionCollection *ac )
+ : KAction( 0 ),
m_searchWidget( 0 )
{
setText( i18n( "Search Bar" ) );
@@ -496,7 +497,25 @@
return searchBox;
}
+
//////////////////////////////////////////////////////////////////////////////////////////
+// SpacerAction
+//////////////////////////////////////////////////////////////////////////////////////////
+SpacerAction::SpacerAction( KActionCollection *ac )
+ : KAction( 0 )
+{
+ ac->addAction( "spacer", this );
+}
+
+QWidget *SpacerAction::createWidget( QWidget *w )
+{
+ QStackedWidget *spacer = new QStackedWidget();
+ QSpacerItem *spacerItem = new QSpacerItem( 0, 0 );
+ spacer->layout()->addItem( spacerItem );
+
+ return spacer;
+}
+//////////////////////////////////////////////////////////////////////////////////////////
// RandomAction
//////////////////////////////////////////////////////////////////////////////////////////
RandomAction::RandomAction( KActionCollection *ac ) :
--- trunk/extragear/multimedia/amarok/src/actionclasses.h #643373:643374
@@ -106,6 +106,12 @@
KLineEdit *m_searchWidget;
};
+ class SpacerAction : public KAction
+ {
+ public:
+ SpacerAction( KActionCollection * );
+ virtual QWidget* createWidget( QWidget * );
+ };
class ToggleAction : public KToggleAction
{
--- trunk/extragear/multimedia/amarok/src/amarokui.rc #643373:643374
@@ -8,14 +8,17 @@
<Action name="stop" />
<Action name="next" />
- <Separator lineSeparator="true"/>
+ <Action name="spacer" />
<Action name="toolbar_volume"/>
- <Separator lineSeparator="true"/>
+ <Action name="spacer" />
+
<Action name="toolbar_analyzer" />
- <Separator />
+
+ <Action name="spacer" />
+
<Action name="search_bar" />
</ToolBar>
--- trunk/extragear/multimedia/amarok/src/playlistwindow.cpp #643373:643374
@@ -199,9 +199,6 @@
#ifndef Q_WS_MAC
m_toolbar->setShown( AmarokConfig::showToolbar() );
#endif
-// connect( filterButton, SIGNAL( clicked() ), SLOT( slotEditFilter() ) );
- //END MainToolBar
- }
Amarok::StatusBar *statusbar = new Amarok::StatusBar( this );
QAction* repeatAction = Amarok::actionCollection()->action( "repeat" );
connect( repeatAction, SIGNAL( activated( int ) ), playlist, SLOT( slotRepeatTrackToggled( int ) ) );
@@ -1165,6 +1162,9 @@
new Amarok::FavorAction( ac );
new Amarok::VolumeAction( ac );
new Amarok::SearchAction( ac );
+ new Amarok::SpacerAction( ac );
+ new Amarok::SpacerAction( ac );
+ new Amarok::SpacerAction( ac );
if( K3bExporter::isAvailable() )
new Amarok::BurnMenuAction( ac );
More information about the Amarok-devel
mailing list