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
40969236
Commit
40969236
authored
Apr 06, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: use QStackedLayout for playlist views
parent
bf60a1b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+8
-17
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+2
-0
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
40969236
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
#include <QToolButton>
#include <QToolButton>
#include <QFontMetrics>
#include <QFontMetrics>
#include <QPainter>
#include <QPainter>
#include <QStackedLayout>
#include <assert.h>
#include <assert.h>
...
@@ -69,6 +70,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -69,6 +70,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
iconView
=
NULL
;
iconView
=
NULL
;
treeView
=
NULL
;
treeView
=
NULL
;
listView
=
NULL
;
listView
=
NULL
;
viewStack
=
new
QStackedLayout
();
layout
->
addLayout
(
viewStack
,
1
,
0
,
1
,
-
1
);
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
currentRootId
=
-
1
;
currentRootId
=
-
1
;
...
@@ -271,7 +274,7 @@ void StandardPLPanel::createIconView()
...
@@ -271,7 +274,7 @@ void StandardPLPanel::createIconView()
CONNECT
(
iconView
,
activated
(
const
QModelIndex
&
),
CONNECT
(
iconView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
this
,
activate
(
const
QModelIndex
&
)
);
iconView
->
installEventFilter
(
this
);
iconView
->
installEventFilter
(
this
);
layout
->
addWidget
(
iconView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
iconView
);
}
}
void
StandardPLPanel
::
createListView
()
void
StandardPLPanel
::
createListView
()
...
@@ -283,7 +286,7 @@ void StandardPLPanel::createListView()
...
@@ -283,7 +286,7 @@ void StandardPLPanel::createListView()
CONNECT
(
listView
,
activated
(
const
QModelIndex
&
),
CONNECT
(
listView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
this
,
activate
(
const
QModelIndex
&
)
);
listView
->
installEventFilter
(
this
);
listView
->
installEventFilter
(
this
);
layout
->
addWidget
(
listView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
listView
);
}
}
...
@@ -346,7 +349,7 @@ void StandardPLPanel::createTreeView()
...
@@ -346,7 +349,7 @@ void StandardPLPanel::createTreeView()
this
,
toggleColumnShown
(
int
)
);
this
,
toggleColumnShown
(
int
)
);
/* Finish the layout */
/* Finish the layout */
layout
->
addWidget
(
treeView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
treeView
);
}
}
void
StandardPLPanel
::
showView
(
int
i_view
)
void
StandardPLPanel
::
showView
(
int
i_view
)
...
@@ -357,40 +360,28 @@ void StandardPLPanel::showView( int i_view )
...
@@ -357,40 +360,28 @@ void StandardPLPanel::showView( int i_view )
{
{
if
(
treeView
==
NULL
)
if
(
treeView
==
NULL
)
createTreeView
();
createTreeView
();
if
(
iconView
)
iconView
->
hide
();
if
(
listView
)
listView
->
hide
();
treeView
->
show
();
currentView
=
treeView
;
currentView
=
treeView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
break
;
}
}
case
ICON_VIEW
:
case
ICON_VIEW
:
{
{
if
(
iconView
==
NULL
)
if
(
iconView
==
NULL
)
createIconView
();
createIconView
();
if
(
treeView
)
treeView
->
hide
();
if
(
listView
)
listView
->
hide
();
iconView
->
show
();
currentView
=
iconView
;
currentView
=
iconView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
break
;
}
}
case
LIST_VIEW
:
case
LIST_VIEW
:
{
{
if
(
listView
==
NULL
)
if
(
listView
==
NULL
)
createListView
();
createListView
();
if
(
treeView
)
treeView
->
hide
();
if
(
iconView
)
iconView
->
hide
();
listView
->
show
();
currentView
=
listView
;
currentView
=
listView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
break
;
}
}
default:
return
;
default:
return
;
}
}
viewStack
->
setCurrentWidget
(
currentView
);
viewActions
[
i_view
]
->
setChecked
(
true
);
browseInto
();
browseInto
();
gotoPlayingItem
();
gotoPlayingItem
();
}
}
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
40969236
...
@@ -45,6 +45,7 @@ class PLModel;
...
@@ -45,6 +45,7 @@ class PLModel;
class
QPushButton
;
class
QPushButton
;
class
QKeyEvent
;
class
QKeyEvent
;
class
QWheelEvent
;
class
QWheelEvent
;
class
QStackedLayout
;
class
PlIconView
;
class
PlIconView
;
class
PlListView
;
class
PlListView
;
class
LocationBar
;
class
LocationBar
;
...
@@ -82,6 +83,7 @@ private:
...
@@ -82,6 +83,7 @@ private:
PlIconView
*
iconView
;
PlIconView
*
iconView
;
PlListView
*
listView
;
PlListView
*
listView
;
QAbstractItemView
*
currentView
;
QAbstractItemView
*
currentView
;
QStackedLayout
*
viewStack
;
QAction
*
viewActions
[
VIEW_COUNT
];
QAction
*
viewActions
[
VIEW_COUNT
];
QAction
*
iconViewAction
,
*
treeViewAction
;
QAction
*
iconViewAction
,
*
treeViewAction
;
...
...
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