Commit 7ef18902 authored by Thomas Boquet's avatar Thomas Boquet
Browse files

Better looking Media list

bigger thumnails, no margin
parent 36fa73fd
......@@ -36,9 +36,12 @@ ListViewController::ListViewController( StackViewController* nav ) : m_nav( nav
m_layout->setAlignment( Qt::AlignTop );
m_layout->setSpacing( 0 );
m_layout->setContentsMargins( 0, 0, 0, 0 );
m_container->setLayout( m_layout );
m_scrollArea->setWidget( m_container );
m_scrollArea->setWidgetResizable( true );
m_scrollArea->setAcceptDrops( true );
}
ListViewController::~ListViewController()
......
......@@ -58,7 +58,7 @@ void MediaCellView::setTitle( const QString& title )
void MediaCellView::setThumbnail( const QPixmap& pixmap )
{
m_ui->thumbnail->setScaledContents( false );
m_ui->thumbnail->setPixmap( pixmap.scaled( 48, 48, Qt::KeepAspectRatio ) );
m_ui->thumbnail->setPixmap( pixmap.scaled( 64, 64, Qt::KeepAspectRatio ) );
}
const QPixmap* MediaCellView::getThumbnail() const
......
#include "MediaListViewController.h"
#include <QDebug>
MediaListViewController::MediaListViewController( StackViewController* nav ) :
ListViewController( nav ), m_nav( nav )
{
......@@ -22,3 +24,13 @@ void MediaListViewController::newMediaLoaded( Media* media )
cell->setTitle( media->getFileName() );
addCell(cell);
}
void MediaListViewController::dragEnterEvent( QDragEnterEvent* event )
{
qDebug() << "Drag enter";
}
void MediaListViewController::dropEvent( QDropEvent* event )
{
qDebug() << "Drop";
}
......@@ -18,6 +18,10 @@ public:
private:
StackViewController* m_nav;
protected:
virtual void dragEnterEvent( QDragEnterEvent* event );
virtual void dropEvent( QDropEvent* event );
public slots:
void newMediaLoaded( Media* );
};
......
......@@ -23,8 +23,27 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="thumbnail">
<property name="enabled">
......@@ -38,20 +57,20 @@
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>48</height>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>48</width>
<height>48</height>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="baseSize">
<size>
<width>48</width>
<height>48</height>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
......@@ -69,7 +88,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>10</width>
<height>20</height>
</size>
</property>
......@@ -81,10 +100,16 @@
<widget class="QLabel" name="title">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
......@@ -185,7 +210,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap>../../../Pictures/arrowRight.png</pixmap>
<pixmap>../../../../../../../Pictures/arrowRight.png</pixmap>
</property>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment