Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
778a6f07
Commit
778a6f07
authored
Mar 03, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.videolan.org:vlc
parents
8d76c39a
f8aeca6a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
modules/gui/qt4/components/playlist/icon_view.cpp
modules/gui/qt4/components/playlist/icon_view.cpp
+24
-0
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+12
-0
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+2
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+1
-1
No files found.
modules/gui/qt4/components/playlist/icon_view.cpp
View file @
778a6f07
...
@@ -160,6 +160,21 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
...
@@ -160,6 +160,21 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QFont
font
(
index
.
data
(
Qt
::
FontRole
).
value
<
QFont
>
()
);
QFont
font
(
index
.
data
(
Qt
::
FontRole
).
value
<
QFont
>
()
);
font
.
setPointSize
(
7
);
font
.
setPointSize
(
7
);
//Draw children indicator
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
()
)
{
painter
->
setOpacity
(
0.75
);
QRect
r
(
option
.
rect
);
r
.
setSize
(
QSize
(
25
,
25
)
);
r
.
translate
(
5
,
5
);
painter
->
fillRect
(
r
,
option
.
palette
.
color
(
QPalette
::
Mid
)
);
painter
->
setOpacity
(
1.0
);
QPixmap
dirPix
(
":/type/node"
);
QRect
r2
(
dirPix
.
rect
()
);
r2
.
moveCenter
(
r
.
center
()
);
painter
->
drawPixmap
(
r2
,
dirPix
);
}
// Draw title
// Draw title
font
.
setItalic
(
true
);
font
.
setItalic
(
true
);
painter
->
setFont
(
font
);
painter
->
setFont
(
font
);
...
@@ -254,6 +269,15 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
...
@@ -254,6 +269,15 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
textRect
.
moveBottom
(
option
.
rect
.
center
().
y
()
-
1
);
textRect
.
moveBottom
(
option
.
rect
.
center
().
y
()
-
1
);
}
}
//Draw children indicator
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
()
)
{
QPixmap
dirPix
=
QPixmap
(
":/type/node"
);
painter
->
drawPixmap
(
QPoint
(
textRect
.
x
(),
textRect
.
center
().
y
()
-
dirPix
.
height
()
/
2
),
dirPix
);
textRect
.
setLeft
(
textRect
.
x
()
+
dirPix
.
width
()
+
5
);
}
painter
->
drawText
(
textRect
,
painter
->
drawText
(
textRect
,
fm
.
elidedText
(
title
,
Qt
::
ElideRight
,
textRect
.
width
()
),
fm
.
elidedText
(
title
,
Qt
::
ElideRight
,
textRect
.
width
()
),
textOpt
);
textOpt
);
...
...
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
778a6f07
...
@@ -354,7 +354,19 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
...
@@ -354,7 +354,19 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
return
QVariant
(
QBrush
(
Qt
::
gray
)
);
return
QVariant
(
QBrush
(
Qt
::
gray
)
);
}
}
else
if
(
role
==
IsCurrentRole
)
return
QVariant
(
isCurrent
(
index
)
);
else
if
(
role
==
IsCurrentRole
)
return
QVariant
(
isCurrent
(
index
)
);
else
if
(
role
==
IsLeafNodeRole
)
{
QVariant
isLeaf
;
PL_LOCK
;
playlist_item_t
*
plItem
=
playlist_ItemGetById
(
p_playlist
,
item
->
i_id
);
if
(
plItem
)
isLeaf
=
plItem
->
i_children
==
-
1
;
PL_UNLOCK
;
return
isLeaf
;
}
return
QVariant
();
return
QVariant
();
}
}
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
778a6f07
...
@@ -55,7 +55,8 @@ friend class PLItem;
...
@@ -55,7 +55,8 @@ friend class PLItem;
public:
public:
enum
{
enum
{
IsCurrentRole
=
Qt
::
UserRole
IsCurrentRole
=
Qt
::
UserRole
,
IsLeafNodeRole
};
};
PLModel
(
playlist_t
*
,
intf_thread_t
*
,
PLModel
(
playlist_t
*
,
intf_thread_t
*
,
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
778a6f07
...
@@ -406,7 +406,7 @@ void StandardPLPanel::cycleViews()
...
@@ -406,7 +406,7 @@ void StandardPLPanel::cycleViews()
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
{
{
if
(
model
->
hasChildren
(
index
)
)
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
(
)
)
{
{
if
(
currentView
!=
treeView
)
if
(
currentView
!=
treeView
)
browseInto
(
index
);
browseInto
(
index
);
...
...
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