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
bcd6bf01
Commit
bcd6bf01
authored
Dec 09, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt, playlist: change the layout. This should help MacOS layout
parent
77edd1d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+19
-19
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/components/playlist/playlist.hpp
+2
-1
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
bcd6bf01
...
...
@@ -45,7 +45,7 @@
**********************************************************************/
PlaylistWidget
::
PlaylistWidget
(
intf_thread_t
*
_p_i
,
QWidget
*
_par
)
:
Q
Splitter
(
_par
),
p_intf
(
_p_i
)
:
Q
Widget
(
_par
),
p_intf
(
_p_i
)
{
#ifndef Q_WS_MAC
setContentsMargins
(
3
,
3
,
3
,
3
);
...
...
@@ -53,6 +53,8 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
setContentsMargins
(
0
,
3
,
0
,
3
);
#endif
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
/*******************
* Left *
*******************/
...
...
@@ -90,10 +92,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
playlist_item_t
*
p_root
=
THEPL
->
p_playing
;
PL_UNLOCK
;
QWidget
*
rightPanel
=
new
QWidget
(
this
);
QGridLayout
*
layout
=
new
QGridLayout
(
rightPanel
);
layout
->
setSpacing
(
0
);
layout
->
setMargin
(
0
);
setMinimumWidth
(
300
);
setMinimumWidth
(
350
);
PLModel
*
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
mainView
=
new
StandardPLPanel
(
this
,
p_intf
,
p_root
,
selector
,
model
);
...
...
@@ -101,7 +100,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
/* Location Bar */
locationBar
=
new
LocationBar
(
model
);
locationBar
->
setSizePolicy
(
QSizePolicy
::
Ignored
,
QSizePolicy
::
Preferred
);
layout
->
addWidget
(
locationBar
,
0
,
0
);
layout
->
addWidget
(
locationBar
,
0
,
0
,
1
,
2
);
layout
->
setColumnStretch
(
0
,
5
);
CONNECT
(
locationBar
,
invoked
(
const
QModelIndex
&
),
mainView
,
browseInto
(
const
QModelIndex
&
)
);
...
...
@@ -110,7 +109,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
QToolButton
*
viewButton
=
new
QToolButton
(
this
);
viewButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_FileDialogDetailedView
)
);
viewButton
->
setToolTip
(
qtr
(
"Change playlistview"
)
);
layout
->
addWidget
(
viewButton
,
0
,
1
);
layout
->
addWidget
(
viewButton
,
0
,
2
);
/* View selection menu */
QSignalMapper
*
viewSelectionMapper
=
new
QSignalMapper
(
this
);
...
...
@@ -136,42 +135,43 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
searchEdit
=
new
SearchLineEdit
(
this
);
searchEdit
->
setMaximumWidth
(
250
);
searchEdit
->
setMinimumWidth
(
80
);
layout
->
addWidget
(
searchEdit
,
0
,
2
);
layout
->
addWidget
(
searchEdit
,
0
,
3
);
CONNECT
(
searchEdit
,
textEdited
(
const
QString
&
),
mainView
,
search
(
const
QString
&
)
);
CONNECT
(
searchEdit
,
searchDelayedChanged
(
const
QString
&
),
mainView
,
searchDelayed
(
const
QString
&
)
);
CONNECT
(
mainView
,
viewChanged
(
const
QModelIndex
&
),
this
,
changeView
(
const
QModelIndex
&
)
);
layout
->
setColumnStretch
(
2
,
3
);
layout
->
setColumnStretch
(
3
,
3
);
/* Connect the activation of the selector to a redefining of the PL */
DCONNECT
(
selector
,
activated
(
playlist_item_t
*
),
mainView
,
setRoot
(
playlist_item_t
*
)
);
layout
->
addWidget
(
mainView
,
1
,
0
,
1
,
-
1
);
split
=
new
QSplitter
(
this
);
/* Add the two sides of the QSplitter */
addWidget
(
leftSplitter
);
addWidget
(
rightPanel
);
split
->
addWidget
(
leftSplitter
);
split
->
addWidget
(
mainView
);
QList
<
int
>
sizeList
;
sizeList
<<
180
<<
420
;
setSizes
(
sizeList
);
//setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding
);
s
etStretchFactor
(
0
,
0
);
s
etStretchFactor
(
1
,
3
);
s
plit
->
s
etSizes
(
sizeList
);
split
->
setStretchFactor
(
0
,
0
);
s
plit
->
setStretchFactor
(
1
,
3
);
s
plit
->
setCollapsible
(
1
,
false
);
leftSplitter
->
setMaximumWidth
(
250
);
setCollapsible
(
1
,
false
);
/* In case we want to keep the splitter information */
// components shall never write there setting to a fixed location, may infer
// with other uses of the same component...
getSettings
()
->
beginGroup
(
"Playlist"
);
restoreState
(
getSettings
()
->
value
(
"splitterSizes"
).
toByteArray
());
split
->
restoreState
(
getSettings
()
->
value
(
"splitterSizes"
).
toByteArray
());
leftSplitter
->
restoreState
(
getSettings
()
->
value
(
"leftSplitterGeometry"
).
toByteArray
()
);
getSettings
()
->
endGroup
();
layout
->
addWidget
(
split
,
1
,
0
,
1
,
-
1
);
setAcceptDrops
(
true
);
setWindowTitle
(
qtr
(
"Playlist"
)
);
setWindowRole
(
"vlc-playlist"
);
...
...
@@ -181,7 +181,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
PlaylistWidget
::~
PlaylistWidget
()
{
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
setValue
(
"splitterSizes"
,
saveState
()
);
getSettings
()
->
setValue
(
"splitterSizes"
,
s
plit
->
s
aveState
()
);
getSettings
()
->
setValue
(
"leftSplitterGeometry"
,
leftSplitter
->
saveState
()
);
getSettings
()
->
endGroup
();
msg_Dbg
(
p_intf
,
"Playlist Destroyed"
);
...
...
modules/gui/qt4/components/playlist/playlist.hpp
View file @
bcd6bf01
...
...
@@ -46,7 +46,7 @@ class QSignalMapper;
class
SearchLineEdit
;
class
QModelIndex
;
class
PlaylistWidget
:
public
Q
Splitter
class
PlaylistWidget
:
public
Q
Widget
{
Q_OBJECT
public:
...
...
@@ -58,6 +58,7 @@ public:
private:
QSplitter
*
leftSplitter
;
QSplitter
*
split
;
StandardPLPanel
*
mainView
;
QAction
*
viewActions
[
4
/* StandardPLPanel::VIEW_COUNT*/
];
...
...
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