1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 06:36:55 +02:00

Use the new Header and ComboBox widgets in the whatshot widget.

This commit is contained in:
Casey Link
2011-08-26 18:44:25 -05:00
parent e43e45cd76
commit ccc8d3b26a
2 changed files with 173 additions and 56 deletions

View File

@@ -46,18 +46,20 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
: QWidget( parent ) : QWidget( parent )
, ui( new Ui::WhatsHotWidget ) , ui( new Ui::WhatsHotWidget )
{ {
tDebug() << "WhatsHot: Hello world!";
ui->setupUi( this ); ui->setupUi( this );
ui->tracksView->setFrameShape( QFrame::NoFrame );
ui->tracksView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
TomahawkUtils::unmarginLayout( layout() ); TomahawkUtils::unmarginLayout( layout() );
TomahawkUtils::unmarginLayout( ui->verticalLayout->layout() );
TomahawkUtils::unmarginLayout( ui->verticalLayout_2->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 = new PlaylistModel( ui->tracksView );
m_tracksModel->setStyle( TrackModel::Short ); m_tracksModel->setStyle( TrackModel::Short );
ui->tracksView->setFrameShape( QFrame::NoFrame );
ui->tracksView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
ui->tracksView->overlay()->setEnabled( false ); ui->tracksView->overlay()->setEnabled( false );
ui->tracksView->setTrackModel( m_tracksModel ); ui->tracksView->setTrackModel( m_tracksModel );
ui->tracksView->setHeaderHidden( true ); ui->tracksView->setHeaderHidden( true );
@@ -73,6 +75,9 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
ui->artistsView->setProxyModel( m_artistsProxy ); ui->artistsView->setProxyModel( m_artistsProxy );
ui->artistsView->setTreeModel( m_artistsModel ); 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 m_artistsProxy->sort( -1 ); // disable sorting, must be called after artistsView->setTreeModel

View File

@@ -10,64 +10,166 @@
<height>513</height> <height>513</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QSplitter" name="splitter"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <widget class="HeaderWidget" name="bg1">
</property> <layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QWidget" name=""> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="ComboBox" name="sourceComobLeft">
<item> <property name="sizeAdjustPolicy">
<widget class="HeaderLabel" name="tracksLabel"> <enum>QComboBox::AdjustToContentsOnFirstShow</enum>
<property name="text"> </property>
<string>Top Tracks</string> <property name="iconSize">
</property> <size>
</widget> <width>0</width>
</item> <height>0</height>
<item> </size>
<widget class="PlaylistView" name="tracksView"> </property>
<property name="minimumSize"> <item>
<size> <property name="text">
<width>320</width> <string>Billboard</string>
<height>0</height> </property>
</size> </item>
</property> <item>
</widget> <property name="text">
</item> <string>Last.fm</string>
</layout> </property>
</widget> </item>
<widget class="QWidget" name=""> <item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <property name="text">
<item> <string>iTunes</string>
<widget class="HeaderLabel" name="artistsLabel"> </property>
<property name="text"> </item>
<string>Top Artists</string> <item>
</property> <property name="text">
</widget> <string/>
</item> </property>
<item> </item>
<widget class="ArtistView" name="artistsView"> </widget>
<property name="minimumSize"> </item>
<size> <item>
<width>320</width> <spacer name="horizontalSpacer">
<height>0</height> <property name="orientation">
</size> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
</layout> <width>40</width>
</widget> <height>5</height>
</widget> </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> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>HeaderLabel</class>
<extends>QLabel</extends>
<header location="global">widgets/HeaderLabel.h</header>
</customwidget>
<customwidget> <customwidget>
<class>PlaylistView</class> <class>PlaylistView</class>
<extends>QTreeView</extends> <extends>QTreeView</extends>
@@ -78,6 +180,16 @@
<extends>QTreeView</extends> <extends>QTreeView</extends>
<header location="global">artistview.h</header> <header location="global">artistview.h</header>
</customwidget> </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> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>