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
523ef9f8
Commit
523ef9f8
authored
Jun 11, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: StandardPLPanel: show dropzone on views
parent
442bad11
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+31
-1
modules/gui/qt4/pixmaps/playlist/dropzone.png
modules/gui/qt4/pixmaps/playlist/dropzone.png
+0
-0
modules/gui/qt4/vlc.qrc
modules/gui/qt4/vlc.qrc
+1
-0
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
523ef9f8
...
...
@@ -46,6 +46,7 @@
#include <QStackedLayout>
#include <QSignalMapper>
#include <QSettings>
#include <QStylePainter>
#include <assert.h>
...
...
@@ -235,7 +236,7 @@ void StandardPLPanel::wheelEvent( QWheelEvent *e )
e
->
accept
();
}
bool
StandardPLPanel
::
eventFilter
(
QObject
*
,
QEvent
*
event
)
bool
StandardPLPanel
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
KeyPress
)
{
...
...
@@ -247,6 +248,32 @@ bool StandardPLPanel::eventFilter ( QObject *, QEvent * event )
return
true
;
}
}
else
if
(
event
->
type
()
==
QEvent
::
Paint
)
{
/* Warn! Don't filter events from anything else than views ! */
if
(
model
->
rowCount
()
==
0
&&
p_selector
->
getCurrentItemCategory
()
==
PL_ITEM_TYPE
)
{
QWidget
*
viewport
=
qobject_cast
<
QWidget
*>
(
obj
);
QStylePainter
painter
(
viewport
);
QPixmap
dropzone
(
":/dropzone"
);
QRect
rect
=
viewport
->
geometry
();
QSize
size
=
rect
.
size
()
/
2
-
dropzone
.
size
()
/
2
;
rect
.
adjust
(
0
,
size
.
height
(),
0
,
0
);
painter
.
drawItemPixmap
(
rect
,
Qt
::
AlignHCenter
,
dropzone
);
/* now select the zone just below the drop zone and let Qt center
the text by itself */
rect
.
adjust
(
0
,
dropzone
.
size
().
height
()
+
10
,
0
,
0
);
rect
.
setRight
(
viewport
->
geometry
().
width
()
);
rect
.
setLeft
(
0
);
painter
.
drawItemText
(
rect
,
Qt
::
AlignHCenter
,
palette
(),
true
,
qtr
(
"Playlist is currently Empty
\n
"
"Drop a file here or select a "
"media source from the left"
),
QPalette
::
Text
);
}
}
return
false
;
}
...
...
@@ -266,6 +293,7 @@ void StandardPLPanel::createIconView()
CONNECT
(
iconView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
iconView
->
installEventFilter
(
this
);
iconView
->
viewport
()
->
installEventFilter
(
this
);
viewStack
->
addWidget
(
iconView
);
}
...
...
@@ -278,6 +306,7 @@ void StandardPLPanel::createListView()
CONNECT
(
listView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
listView
->
installEventFilter
(
this
);
listView
->
viewport
()
->
installEventFilter
(
this
);
viewStack
->
addWidget
(
listView
);
}
...
...
@@ -326,6 +355,7 @@ void StandardPLPanel::createTreeView()
CONNECT
(
treeView
,
customContextMenuRequested
(
const
QPoint
&
),
this
,
popupPlView
(
const
QPoint
&
)
);
treeView
->
installEventFilter
(
this
);
treeView
->
viewport
()
->
installEventFilter
(
this
);
/* SignalMapper for columns */
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
...
...
modules/gui/qt4/pixmaps/playlist/dropzone.png
0 → 100644
View file @
523ef9f8
5.51 KB
modules/gui/qt4/vlc.qrc
View file @
523ef9f8
...
...
@@ -98,6 +98,7 @@
<file alias="new.png">pixmaps/profile_new.png</file>
<file alias="lock">pixmaps/lock.png</file>
<file alias="search_clear">pixmaps/search_clear.png</file>
<file alias="dropzone">pixmaps/playlist/dropzone.png</file>
</qresource>
<qresource prefix="/prefsmenu">
<file alias="cone_audio_64">pixmaps/prefs/spref_cone_Audio_64.png</file>
...
...
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