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
4fe7b124
Commit
4fe7b124
authored
Feb 04, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: make playlist widget even a bit more pretty
parent
49f0cd87
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
20 deletions
+38
-20
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+14
-4
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+18
-11
modules/gui/qt4/components/playlist/selector.hpp
modules/gui/qt4/components/playlist/selector.hpp
+2
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+3
-3
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+1
-1
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
4fe7b124
...
...
@@ -50,12 +50,22 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
/* Source Selector */
selector
=
new
PLSelector
(
this
,
p_intf
);
QLabel
*
selLabel
=
new
QLabel
(
"Media Browser"
);
QFont
font
;
font
.
setBold
(
true
);
selLabel
->
setFont
(
font
);
selLabel
->
setMargin
(
5
);
QVBoxLayout
*
selBox
=
new
QVBoxLayout
();
selBox
->
setContentsMargins
(
5
,
5
,
5
,
0
);
selBox
->
setContentsMargins
(
0
,
0
,
0
,
0
);
selBox
->
setSpacing
(
0
);
selBox
->
addWidget
(
selLabel
);
selBox
->
addWidget
(
selector
);
QGroupBox
*
selGroup
=
new
QGroupBox
(
qtr
(
"Media Browser"
)
);
selGroup
->
setLayout
(
selBox
);
leftSplitter
->
addWidget
(
selGroup
);
QWidget
*
mediaBrowser
=
new
QWidget
();
mediaBrowser
->
setLayout
(
selBox
);
leftSplitter
->
addWidget
(
mediaBrowser
);
/* Create a Container for the Art Label
in order to have a beautiful resizing for the selector above it */
...
...
modules/gui/qt4/components/playlist/selector.cpp
View file @
4fe7b124
...
...
@@ -101,9 +101,9 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
setFrameStyle
(
QFrame
::
NoFrame
);
viewport
()
->
setAutoFillBackground
(
false
);
setIconSize
(
QSize
(
24
,
24
)
);
setIndentation
(
1
0
);
setIndentation
(
1
4
);
header
()
->
hide
();
setRootIsDecorated
(
fals
e
);
setRootIsDecorated
(
tru
e
);
setAlternatingRowColors
(
false
);
podcastsParent
=
NULL
;
podcastsParentId
=
-
1
;
...
...
@@ -248,15 +248,10 @@ void PLSelector::createItems()
THEPL
->
p_media_library
);
ml
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_ML
)
);
QTreeWidgetItem
*
msrc
=
addItem
(
CATEGORY_TYPE
,
qtr
(
"Media Sources"
),
false
)
->
treeItem
();
QTreeWidgetItem
*
mfldrs
=
NULL
;
QTreeWidgetItem
*
shouts
=
NULL
;
msrc
->
setExpanded
(
true
);
char
**
ppsz_longnames
;
char
**
ppsz_names
=
vlc_sd_GetNames
(
THEPL
,
&
ppsz_longnames
);
if
(
!
ppsz_names
)
...
...
@@ -272,21 +267,21 @@ void PLSelector::createItems()
SD_IS
(
"frenchtv"
)
||
SD_IS
(
"freebox"
)
)
{
if
(
!
shouts
)
shouts
=
addItem
(
CATEGORY_TYPE
,
qtr
(
"Shoutcast"
),
false
,
msrc
)
->
treeItem
();
false
)
->
treeItem
();
putSDData
(
addItem
(
SD_TYPE
,
*
ppsz_longname
,
false
,
shouts
),
*
ppsz_name
,
*
ppsz_longname
);
}
else
if
(
SD_IS
(
"video_dir"
)
||
SD_IS
(
"audio_dir"
)
||
SD_IS
(
"picture_dir"
)
)
{
if
(
!
mfldrs
)
mfldrs
=
addItem
(
CATEGORY_TYPE
,
qtr
(
"Media Folders"
),
false
,
msrc
)
->
treeItem
();
false
)
->
treeItem
();
putSDData
(
addItem
(
SD_TYPE
,
*
ppsz_longname
,
false
,
mfldrs
),
*
ppsz_name
,
*
ppsz_longname
);
}
else
if
(
SD_IS
(
"podcast"
)
)
{
PLSelItem
*
podItem
=
addItem
(
SD_TYPE
,
qtr
(
"Podcasts"
),
false
,
msrc
);
PLSelItem
*
podItem
=
addItem
(
SD_TYPE
,
qtr
(
"Podcasts"
),
false
);
putSDData
(
podItem
,
*
ppsz_name
,
*
ppsz_longname
);
podItem
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_PODCAST
)
);
podItem
->
addAction
(
ADD_ACTION
,
qtr
(
"Subscribe to a podcast"
)
);
...
...
@@ -296,7 +291,7 @@ void PLSelector::createItems()
}
else
{
putSDData
(
addItem
(
SD_TYPE
,
qtr
(
*
ppsz_longname
),
false
,
msrc
),
putSDData
(
addItem
(
SD_TYPE
,
qtr
(
*
ppsz_longname
),
false
),
*
ppsz_name
,
*
ppsz_longname
);
}
...
...
@@ -468,3 +463,15 @@ PLSelItem * PLSelector::itemWidget( QTreeWidgetItem *item )
return
(
static_cast
<
PLSelItem
*>
(
QTreeWidget
::
itemWidget
(
item
,
0
)
)
);
}
void
PLSelector
::
drawBranches
(
QPainter
*
painter
,
const
QRect
&
rect
,
const
QModelIndex
&
index
)
const
{
if
(
!
model
()
->
hasChildren
(
index
)
)
return
;
QStyleOption
option
;
option
.
initFrom
(
this
);
option
.
rect
=
rect
;
/*option.state = QStyle::State_Children;
if( isExpanded( index ) ) option.state |= QStyle::State_Open;*/
style
()
->
drawPrimitive
(
isExpanded
(
index
)
?
QStyle
::
PE_IndicatorArrowDown
:
QStyle
::
PE_IndicatorArrowRight
,
&
option
,
painter
);
}
modules/gui/qt4/components/playlist/selector.hpp
View file @
4fe7b124
...
...
@@ -108,8 +108,9 @@ protected:
friend
class
PlaylistWidget
;
private:
QStringList
mimeTypes
()
const
;
bool
dropMimeData
(
QTreeWidgetItem
*
parent
,
int
index
,
const
QMimeData
*
data
,
Qt
::
DropAction
a
ction
);
bool
dropMimeData
(
QTreeWidgetItem
*
,
int
,
const
QMimeData
*
,
Qt
::
DropA
ction
);
void
createItems
();
void
drawBranches
(
QPainter
*
,
const
QRect
&
,
const
QModelIndex
&
)
const
;
PLSelItem
*
addItem
(
SelectorItemType
type
,
const
QString
&
str
,
bool
drop
,
QTreeWidgetItem
*
parentItem
=
0
);
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
4fe7b124
...
...
@@ -89,7 +89,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
layout
->
setColumnStretch
(
4
,
2
);
/* Add item to the playlist button */
addButton
=
new
Q
Push
Button
;
addButton
=
new
Q
Tool
Button
;
addButton
->
setIcon
(
QIcon
(
":/buttons/playlist/playlist_add"
)
);
addButton
->
setMaximumWidth
(
30
);
BUTTONACT
(
addButton
,
popupAdd
()
);
...
...
@@ -97,7 +97,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
/* Button to switch views */
QToolButton
*
viewButton
=
new
QToolButton
(
this
);
viewButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_FileDialog
Contents
View
)
);
viewButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_FileDialog
Detailed
View
)
);
layout
->
addWidget
(
viewButton
,
0
,
2
);
/* View selection menu */
...
...
@@ -474,7 +474,7 @@ void LocationBar::setIndex( const QModelIndex &index )
char
*
fb_name
=
input_item_GetTitleFbName
(
item
->
inputItem
()
);
QString
text
=
qfu
(
fb_name
);
free
(
fb_name
);
text
=
QString
(
"
/
"
)
+
metrics
.
elidedText
(
text
,
Qt
::
ElideRight
,
150
);
text
=
QString
(
"
>
"
)
+
metrics
.
elidedText
(
text
,
Qt
::
ElideRight
,
150
);
btn
->
setText
(
text
);
btn
->
setFont
(
font
);
prev
=
insertWidget
(
prev
,
btn
);
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
4fe7b124
...
...
@@ -68,7 +68,7 @@ private:
QWidget
*
parent
;
QLabel
*
title
;
Q
Push
Button
*
addButton
;
Q
Tool
Button
*
addButton
;
QGridLayout
*
layout
;
LocationBar
*
locationBar
;
...
...
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