Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
970cadc8
Commit
970cadc8
authored
Feb 04, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: iconView, make the item higher
parent
4819ff70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
modules/gui/qt4/components/playlist/icon_view.cpp
modules/gui/qt4/components/playlist/icon_view.cpp
+9
-8
No files found.
modules/gui/qt4/components/playlist/icon_view.cpp
View file @
970cadc8
...
...
@@ -34,14 +34,15 @@
#include "assert.h"
#define RECT_SIZE 100
#define RECT_SIZE_W 100
#define RECT_SIZE_H 105
#define ART_SIZE 64
#define OFFSET (RECT_SIZE-64)/2
#define OFFSET (RECT_SIZE
_W
-64)/2
#define ITEMS_SPACING 10
#define ART_RADIUS 5
static
const
QRect
drawRect
=
QRect
(
0
,
0
,
RECT_SIZE
,
RECT_SIZE
);
static
const
QRect
drawRect
=
QRect
(
0
,
0
,
RECT_SIZE
_W
,
RECT_SIZE_H
);
static
const
QRect
artRect
=
drawRect
.
adjusted
(
OFFSET
-
1
,
2
,
-
OFFSET
,
-
OFFSET
*
2
);
void
PlListViewItemDelegate
::
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
...
...
@@ -99,7 +100,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
artPix
=
artPix
.
scaled
(
ART_SIZE
,
ART_SIZE
,
Qt
::
KeepAspectRatioByExpanding
);
pix
=
QPixmap
(
RECT_SIZE
,
RECT_SIZE
);
pix
=
QPixmap
(
RECT_SIZE
_W
,
RECT_SIZE_H
);
pix
.
fill
(
Qt
::
transparent
);
QPainter
*
pixpainter
=
new
QPainter
(
&
pix
);
...
...
@@ -113,7 +114,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
pixpainter
->
save
();
pixpainter
->
setOpacity
(
0.2
);
pixpainter
->
setBrush
(
QBrush
(
Qt
::
gray
)
);
pixpainter
->
drawRoundedRect
(
0
,
0
,
RECT_SIZE
,
RECT_SIZE
,
ART_RADIUS
,
ART_RADIUS
);
pixpainter
->
drawRoundedRect
(
0
,
0
,
RECT_SIZE
_W
,
RECT_SIZE_H
,
ART_RADIUS
,
ART_RADIUS
);
pixpainter
->
restore
();
}
...
...
@@ -142,7 +143,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
pixpainter
->
setFont
(
font
);
QFontMetrics
fm
=
pixpainter
->
fontMetrics
();
QRect
textRect
=
drawRect
.
adjusted
(
1
,
ART_SIZE
+
4
,
0
,
-
1
);
textRect
.
setHeight
(
fm
.
height
()
+
2
);
textRect
.
setHeight
(
fm
.
height
()
+
1
);
pixpainter
->
drawText
(
textRect
,
fm
.
elidedText
(
title
,
Qt
::
ElideRight
,
textRect
.
width
()
),
...
...
@@ -172,7 +173,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QSize
PlListViewItemDelegate
::
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
{
return
QSize
(
RECT_SIZE
,
RECT_SIZE
);
return
QSize
(
RECT_SIZE
_W
,
RECT_SIZE_H
);
}
...
...
@@ -182,7 +183,7 @@ PlIconView::PlIconView( PLModel *model, QWidget *parent ) : QListView( parent )
setViewMode
(
QListView
::
IconMode
);
setMovement
(
QListView
::
Static
);
setResizeMode
(
QListView
::
Adjust
);
setGridSize
(
QSize
(
RECT_SIZE
,
RECT_SIZE
)
);
setGridSize
(
QSize
(
RECT_SIZE
_W
,
RECT_SIZE_H
)
);
setUniformItemSizes
(
true
);
setSpacing
(
ITEMS_SPACING
);
setWrapping
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment