mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
Show search and artist pages as temporary pages in sidebar
Remove margins and spacing from searchwidget Remove "Cancel" button as no other view pages have cancel buttons, and we can't delete a page if we show it as a temporary page anymore
This commit is contained in:
@@ -73,6 +73,7 @@ public:
|
|||||||
virtual QString longDescription() const { return m_longDescription; }
|
virtual QString longDescription() const { return m_longDescription; }
|
||||||
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
|
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
|
||||||
|
|
||||||
|
virtual bool isTemporaryPage() const { return true; }
|
||||||
virtual bool showStatsBar() const { return false; }
|
virtual bool showStatsBar() const { return false; }
|
||||||
|
|
||||||
virtual bool jumpToCurrentTrack() { return false; }
|
virtual bool jumpToCurrentTrack() { return false; }
|
||||||
|
@@ -43,14 +43,17 @@ SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
|||||||
ui->resultsView->overlay()->setEnabled( false );
|
ui->resultsView->overlay()->setEnabled( false );
|
||||||
ui->resultsView->sortByColumn( PlaylistModel::Score, Qt::DescendingOrder );
|
ui->resultsView->sortByColumn( PlaylistModel::Score, Qt::DescendingOrder );
|
||||||
|
|
||||||
|
TomahawkUtils::unmarginLayout( ui->verticalLayout );
|
||||||
|
ui->resultsView->setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
ui->resultsView->setFrameShape( QFrame::NoFrame );
|
||||||
|
ui->resultsView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
m_queries << Tomahawk::Query::get( search, uuid() );
|
m_queries << Tomahawk::Query::get( search, uuid() );
|
||||||
|
|
||||||
foreach ( const Tomahawk::query_ptr& query, m_queries )
|
foreach ( const Tomahawk::query_ptr& query, m_queries )
|
||||||
{
|
{
|
||||||
connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ), SLOT( onResultsFound( QList<Tomahawk::result_ptr> ) ) );
|
connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ), SLOT( onResultsFound( QList<Tomahawk::result_ptr> ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( cancel() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -94,11 +97,3 @@ SearchWidget::onResultsFound( const QList<Tomahawk::result_ptr>& results )
|
|||||||
m_resultsModel->append( q );
|
m_resultsModel->append( q );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
SearchWidget::cancel()
|
|
||||||
{
|
|
||||||
emit destroyed( this );
|
|
||||||
deleteLater();
|
|
||||||
}
|
|
||||||
|
@@ -46,6 +46,7 @@ public:
|
|||||||
|
|
||||||
virtual QWidget* widget() { return this; }
|
virtual QWidget* widget() { return this; }
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
||||||
|
virtual bool isTemporaryPage() const { return true; }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Search" ); }
|
virtual QString title() const { return tr( "Search" ); }
|
||||||
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
|
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
|
||||||
@@ -63,8 +64,6 @@ signals:
|
|||||||
private slots:
|
private slots:
|
||||||
void onResultsFound( const QList<Tomahawk::result_ptr>& results );
|
void onResultsFound( const QList<Tomahawk::result_ptr>& results );
|
||||||
|
|
||||||
void cancel();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SearchWidget *ui;
|
Ui::SearchWidget *ui;
|
||||||
|
|
||||||
|
@@ -14,16 +14,12 @@
|
|||||||
<enum>Qt::TabFocus</enum>
|
<enum>Qt::TabFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="PlaylistView" name="resultsView"/>
|
<widget class="PlaylistView" name="resultsView"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Reference in New Issue
Block a user