mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
Use the new Header and ComboBox widgets in the whatshot widget.
This commit is contained in:
parent
e43e45cd76
commit
ccc8d3b26a
@ -46,18 +46,20 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, ui( new Ui::WhatsHotWidget )
|
||||
{
|
||||
tDebug() << "WhatsHot: Hello world!";
|
||||
ui->setupUi( this );
|
||||
ui->tracksView->setFrameShape( QFrame::NoFrame );
|
||||
ui->tracksView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
|
||||
TomahawkUtils::unmarginLayout( layout() );
|
||||
TomahawkUtils::unmarginLayout( ui->verticalLayout->layout() );
|
||||
TomahawkUtils::unmarginLayout( ui->verticalLayout_2->layout() );
|
||||
TomahawkUtils::unmarginLayout( ui->horizontalLayout->layout() );
|
||||
TomahawkUtils::unmarginLayout( ui->horizontalLayout_3->layout() );
|
||||
|
||||
|
||||
m_tracksModel = new PlaylistModel( ui->tracksView );
|
||||
m_tracksModel->setStyle( TrackModel::Short );
|
||||
|
||||
ui->tracksView->setFrameShape( QFrame::NoFrame );
|
||||
ui->tracksView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
ui->tracksView->overlay()->setEnabled( false );
|
||||
ui->tracksView->setTrackModel( m_tracksModel );
|
||||
ui->tracksView->setHeaderHidden( true );
|
||||
@ -73,6 +75,9 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
|
||||
ui->artistsView->setProxyModel( m_artistsProxy );
|
||||
ui->artistsView->setTreeModel( m_artistsModel );
|
||||
ui->artistsView->setFrameShape( QFrame::NoFrame );
|
||||
ui->artistsView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
|
||||
|
||||
m_artistsProxy->sort( -1 ); // disable sorting, must be called after artistsView->setTreeModel
|
||||
|
||||
|
@ -10,64 +10,166 @@
|
||||
<height>513</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="HeaderLabel" name="tracksLabel">
|
||||
<property name="text">
|
||||
<string>Top Tracks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PlaylistView" name="tracksView">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="HeaderLabel" name="artistsLabel">
|
||||
<property name="text">
|
||||
<string>Top Artists</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ArtistView" name="artistsView">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="HeaderWidget" name="bg1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="ComboBox" name="sourceComobLeft">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Billboard</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Last.fm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>iTunes</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>5</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ComboBox" name="typeComboLeft">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top 100 Tracks</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PlaylistView" name="tracksView">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="HeaderWidget" name="bg2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="ComboBox" name="sourceComboRight">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Billboard</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Last.fm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>iTunes</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>5</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ComboBox" name="typeComboRight">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top 100 Tracks</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ArtistView" name="artistsView">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>HeaderLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header location="global">widgets/HeaderLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>PlaylistView</class>
|
||||
<extends>QTreeView</extends>
|
||||
@ -78,6 +180,16 @@
|
||||
<extends>QTreeView</extends>
|
||||
<header location="global">artistview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header location="global">widgets/combobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HeaderWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">widgets/HeaderWidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user