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
2d3a9f2e
Commit
2d3a9f2e
authored
Jan 24, 2011
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: in iconview, allways center the album art even if bold font has different size than normal
parent
e697532e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
modules/gui/qt4/components/playlist/views.cpp
modules/gui/qt4/components/playlist/views.cpp
+5
-5
No files found.
modules/gui/qt4/components/playlist/views.cpp
View file @
2d3a9f2e
...
...
@@ -82,6 +82,7 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QFontMetrics
fm
=
painter
->
fontMetrics
();
int
averagewidth
=
fm
.
averageCharWidth
();
QSize
rectSize
=
option
.
rect
.
size
();
int
art_width
=
averagewidth
*
ICON_SCALER
;
int
art_height
=
averagewidth
*
ICON_SCALER
;
...
...
@@ -91,8 +92,8 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
painter
->
save
();
QRect
artRect
(
option
.
rect
.
x
()
+
averagewidth
*
2
+
(
art_width
-
artPix
.
width
()
)
/
2
,
option
.
rect
.
y
()
+
averagewidth
+
(
art_height
-
artPix
.
height
()
)
/
2
,
QRect
artRect
(
option
.
rect
.
x
()
+
(
rectSize
.
width
()
-
artPix
.
width
()
)
/
2
,
option
.
rect
.
y
()
-
averagewidth
*
3
+
(
rectSize
.
height
()
-
artPix
.
height
()
)
/
2
,
artPix
.
width
(),
artPix
.
height
()
);
// Draw the drop shadow
...
...
@@ -137,9 +138,8 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
// Draw title
font
.
setItalic
(
true
);
fm
=
painter
->
fontMetrics
();
QRect
textRect
=
option
.
rect
.
adjusted
(
1
,
art_height
+
10
,
0
,
-
1
);
textRect
.
setHeight
(
fm
.
height
()
);
QRect
textRect
;
textRect
.
setRect
(
option
.
rect
.
x
()
,
artRect
.
bottom
()
+
fm
.
height
()
/
2
,
option
.
rect
.
width
(),
fm
.
height
()
);
painter
->
drawText
(
textRect
,
fm
.
elidedText
(
title
,
Qt
::
ElideRight
,
textRect
.
width
()
),
...
...
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