Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e66c5af1
Commit
e66c5af1
authored
Mar 16, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: preferences: use StackedWidget for advanced layout
parent
46d15dba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+9
-16
modules/gui/qt4/dialogs/preferences.hpp
modules/gui/qt4/dialogs/preferences.hpp
+1
-2
No files found.
modules/gui/qt4/dialogs/preferences.cpp
View file @
e66c5af1
...
...
@@ -62,9 +62,6 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
advanced_tree_panel
=
new
QWidget
;
advanced_tree_panel
->
setLayout
(
new
QVBoxLayout
);
advanced_main_panel
=
new
QWidget
;
advanced_main_panel
->
setLayout
(
new
QHBoxLayout
);
/* Choice for types */
types
=
new
QGroupBox
(
qtr
(
"Show settings"
)
);
types
->
setAlignment
(
Qt
::
AlignHCenter
);
...
...
@@ -83,7 +80,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
tree_filter
=
NULL
;
simple_tree
=
NULL
;
simple_panels_stack
=
new
QStackedWidget
;
advanced_panel
=
NULL
;
advanced_panel
s_stack
=
new
QStackedWidget
;
/* Buttons */
QDialogButtonBox
*
buttonsBox
=
new
QDialogButtonBox
();
...
...
@@ -112,7 +109,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
simple_split_widget
->
layout
()
->
setMargin
(
0
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_tree_panel
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_
main_panel
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_
panels_stack
);
advanced_split_widget
->
layout
()
->
setMargin
(
0
);
/* Layout */
...
...
@@ -175,10 +172,10 @@ void PrefsDialog::setAdvanced()
}
/* If no advanced Panel exist, create one, attach it and show it*/
if
(
!
advanced_panel
)
if
(
advanced_panels_stack
->
count
()
<
1
)
{
advanced_panel
=
new
AdvPrefsPanel
(
advanced_main_panel
);
advanced_
main_panel
->
layout
()
->
addWidget
(
advanced_panel
);
AdvPrefsPanel
*
insert
=
new
AdvPrefsPanel
(
advanced_panels_stack
);
advanced_
panels_stack
->
insertWidget
(
0
,
insert
);
}
/* Select the first Item of the preferences. Maybe you want to select a specified
...
...
@@ -229,17 +226,13 @@ void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item )
if
(
item
==
NULL
)
return
;
PrefsItemData
*
data
=
item
->
data
(
0
,
Qt
::
UserRole
).
value
<
PrefsItemData
*>
();
if
(
advanced_panel
)
if
(
advanced_panel
->
isVisible
()
)
advanced_panel
->
hide
();
if
(
!
data
->
panel
)
{
data
->
panel
=
new
AdvPrefsPanel
(
p_intf
,
advanced_main_panel
,
data
);
advanced_main_panel
->
layout
()
->
addWidget
(
data
->
panel
);
data
->
panel
=
new
AdvPrefsPanel
(
p_intf
,
advanced_panels_stack
,
data
);
advanced_panels_stack
->
insertWidget
(
advanced_panels_stack
->
count
(),
data
->
panel
);
}
advanced_panel
=
data
->
panel
;
advanced_panel
->
show
();
advanced_panels_stack
->
setCurrentWidget
(
data
->
panel
);
}
#if 0
...
...
modules/gui/qt4/dialogs/preferences.hpp
View file @
e66c5af1
...
...
@@ -56,10 +56,9 @@ private:
enum
{
SIMPLE
,
ADVANCED
};
QStackedWidget
*
stack
;
QWidget
*
advanced_main_panel
;
QWidget
*
simple_split_widget
,
*
advanced_split_widget
;
AdvPrefsPanel
*
advanced_panel
;
QStackedWidget
*
advanced_panels_stack
;
QStackedWidget
*
simple_panels_stack
;
SPrefsPanel
*
simple_panels
[
SPrefsMax
];
...
...
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