Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f8aeca6a
Commit
f8aeca6a
authored
Mar 03, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: show folder icon for non-leaf nodes in iconView and listView
close #3343
parent
3fbf9b48
Changes
4
Hide 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 @
f8aeca6a
...
...
@@ -160,6 +160,21 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QFont
font
(
index
.
data
(
Qt
::
FontRole
).
value
<
QFont
>
()
);
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
font
.
setItalic
(
true
);
painter
->
setFont
(
font
);
...
...
@@ -254,6 +269,15 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
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
,
fm
.
elidedText
(
title
,
Qt
::
ElideRight
,
textRect
.
width
()
),
textOpt
);
...
...
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
f8aeca6a
...
...
@@ -354,7 +354,19 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
return
QVariant
(
QBrush
(
Qt
::
gray
)
);
}
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
();
}
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
f8aeca6a
...
...
@@ -55,7 +55,8 @@ friend class PLItem;
public:
enum
{
IsCurrentRole
=
Qt
::
UserRole
IsCurrentRole
=
Qt
::
UserRole
,
IsLeafNodeRole
};
PLModel
(
playlist_t
*
,
intf_thread_t
*
,
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
f8aeca6a
...
...
@@ -406,7 +406,7 @@ void StandardPLPanel::cycleViews()
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
{
if
(
model
->
hasChildren
(
index
)
)
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
(
)
)
{
if
(
currentView
!=
treeView
)
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