Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
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
Show 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 @@
#include <QToolButton>
#include <QFontMetrics>
#include <QPainter>
#include <QStackedLayout>
#include <assert.h>
...
...
@@ -69,6 +70,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
iconView
=
NULL
;
treeView
=
NULL
;
listView
=
NULL
;
viewStack
=
new
QStackedLayout
();
layout
->
addLayout
(
viewStack
,
1
,
0
,
1
,
-
1
);
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
currentRootId
=
-
1
;
...
...
@@ -271,7 +274,7 @@ void StandardPLPanel::createIconView()
CONNECT
(
iconView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
iconView
->
installEventFilter
(
this
);
layout
->
addWidget
(
iconView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
iconView
);
}
void
StandardPLPanel
::
createListView
()
...
...
@@ -283,7 +286,7 @@ void StandardPLPanel::createListView()
CONNECT
(
listView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
listView
->
installEventFilter
(
this
);
layout
->
addWidget
(
listView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
listView
);
}
...
...
@@ -346,7 +349,7 @@ void StandardPLPanel::createTreeView()
this
,
toggleColumnShown
(
int
)
);
/* Finish the layout */
layout
->
addWidget
(
treeView
,
1
,
0
,
1
,
-
1
);
viewStack
->
addWidget
(
treeView
);
}
void
StandardPLPanel
::
showView
(
int
i_view
)
...
...
@@ -357,40 +360,28 @@ void StandardPLPanel::showView( int i_view )
{
if
(
treeView
==
NULL
)
createTreeView
();
if
(
iconView
)
iconView
->
hide
();
if
(
listView
)
listView
->
hide
();
treeView
->
show
();
currentView
=
treeView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
}
case
ICON_VIEW
:
{
if
(
iconView
==
NULL
)
createIconView
();
if
(
treeView
)
treeView
->
hide
();
if
(
listView
)
listView
->
hide
();
iconView
->
show
();
currentView
=
iconView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
}
case
LIST_VIEW
:
{
if
(
listView
==
NULL
)
createListView
();
if
(
treeView
)
treeView
->
hide
();
if
(
iconView
)
iconView
->
hide
();
listView
->
show
();
currentView
=
listView
;
viewActions
[
i_view
]
->
setChecked
(
true
);
break
;
}
default:
return
;
}
viewStack
->
setCurrentWidget
(
currentView
);
viewActions
[
i_view
]
->
setChecked
(
true
);
browseInto
();
gotoPlayingItem
();
}
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
40969236
...
...
@@ -45,6 +45,7 @@ class PLModel;
class
QPushButton
;
class
QKeyEvent
;
class
QWheelEvent
;
class
QStackedLayout
;
class
PlIconView
;
class
PlListView
;
class
LocationBar
;
...
...
@@ -82,6 +83,7 @@ private:
PlIconView
*
iconView
;
PlListView
*
listView
;
QAbstractItemView
*
currentView
;
QStackedLayout
*
viewStack
;
QAction
*
viewActions
[
VIEW_COUNT
];
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