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
46d15dba
Commit
46d15dba
authored
Mar 16, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: preferences: use StackedWidget for simple layout
parent
d4af177c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
28 deletions
+16
-28
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+14
-26
modules/gui/qt4/dialogs/preferences.hpp
modules/gui/qt4/dialogs/preferences.hpp
+2
-2
No files found.
modules/gui/qt4/dialogs/preferences.cpp
View file @
46d15dba
...
...
@@ -62,9 +62,6 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
advanced_tree_panel
=
new
QWidget
;
advanced_tree_panel
->
setLayout
(
new
QVBoxLayout
);
simple_main_panel
=
new
QWidget
;
simple_main_panel
->
setLayout
(
new
QHBoxLayout
);
advanced_main_panel
=
new
QWidget
;
advanced_main_panel
->
setLayout
(
new
QHBoxLayout
);
...
...
@@ -85,7 +82,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
advanced_tree
=
NULL
;
tree_filter
=
NULL
;
simple_tree
=
NULL
;
current_simple_panel
=
NULL
;
simple_panels_stack
=
new
QStackedWidget
;
advanced_panel
=
NULL
;
/* Buttons */
...
...
@@ -111,7 +108,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
stack
->
insertWidget
(
ADVANCED
,
advanced_split_widget
);
simple_split_widget
->
layout
()
->
addWidget
(
simple_tree_panel
);
simple_split_widget
->
layout
()
->
addWidget
(
simple_
main_panel
);
simple_split_widget
->
layout
()
->
addWidget
(
simple_
panels_stack
);
simple_split_widget
->
layout
()
->
setMargin
(
0
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_tree_panel
);
...
...
@@ -128,7 +125,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
/* Margins */
simple_tree_panel
->
layout
()
->
setMargin
(
1
);
simple_
main_panel
->
layout
()
->
setContentsMargins
(
6
,
0
,
0
,
3
);
simple_
panels_stack
->
layout
()
->
setContentsMargins
(
6
,
0
,
0
,
3
);
b_small
=
(
p_intf
->
p_sys
->
i_screenHeight
<
750
);
if
(
b_small
)
msg_Dbg
(
p_intf
,
"Small Resolution"
);
...
...
@@ -180,7 +177,7 @@ void PrefsDialog::setAdvanced()
/* If no advanced Panel exist, create one, attach it and show it*/
if
(
!
advanced_panel
)
{
advanced_panel
=
new
AdvPrefsPanel
(
simple
_main_panel
);
advanced_panel
=
new
AdvPrefsPanel
(
advanced
_main_panel
);
advanced_main_panel
->
layout
()
->
addWidget
(
advanced_panel
);
}
...
...
@@ -207,13 +204,8 @@ void PrefsDialog::setSmall()
simple_tree_panel
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Preferred
);
}
if
(
!
current_simple_panel
)
{
current_simple_panel
=
new
SPrefsPanel
(
p_intf
,
simple_main_panel
,
SPrefsDefaultCat
,
b_small
);
simple_panels
[
SPrefsDefaultCat
]
=
current_simple_panel
;
simple_main_panel
->
layout
()
->
addWidget
(
current_simple_panel
);
}
if
(
!
simple_panels
[
SPrefsDefaultCat
]
)
changeSimplePanel
(
SPrefsDefaultCat
);
small
->
setChecked
(
true
);
stack
->
setCurrentIndex
(
SIMPLE
);
...
...
@@ -222,18 +214,13 @@ void PrefsDialog::setSmall()
/* Switching from on simple panel to another */
void
PrefsDialog
::
changeSimplePanel
(
int
number
)
{
if
(
current_simple_panel
)
if
(
current_simple_panel
->
isVisible
()
)
current_simple_panel
->
hide
();
current_simple_panel
=
simple_panels
[
number
];
if
(
!
current_simple_panel
)
if
(
!
simple_panels
[
number
]
)
{
current_simple_panel
=
new
SPrefsPanel
(
p_intf
,
simple_main_panel
,
number
,
b_small
)
;
simple_panels
[
number
]
=
current_simple_panel
;
simple_
main_panel
->
layout
()
->
addWidget
(
current_simple_panel
)
;
SPrefsPanel
*
insert
=
new
SPrefsPanel
(
p_intf
,
simple_panels_stack
,
number
,
b_small
)
;
simple_panels
_stack
->
insertWidget
(
number
,
insert
)
;
simple_
panels
[
number
]
=
insert
;
}
current_simple_panel
->
show
();
simple_panels_stack
->
setCurrentWidget
(
simple_panels
[
number
]
);
}
/* Changing from one Advanced Panel to another */
...
...
@@ -247,7 +234,7 @@ void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item )
if
(
!
data
->
panel
)
{
data
->
panel
=
new
AdvPrefsPanel
(
p_intf
,
simple_main_panel
,
data
);
data
->
panel
=
new
AdvPrefsPanel
(
p_intf
,
advanced_main_panel
,
data
);
advanced_main_panel
->
layout
()
->
addWidget
(
data
->
panel
);
}
...
...
@@ -296,7 +283,8 @@ void PrefsDialog::save()
{
msg_Dbg
(
p_intf
,
"Saving the simple preferences"
);
for
(
int
i
=
0
;
i
<
SPrefsMax
;
i
++
){
if
(
simple_panels
[
i
]
)
simple_panels
[
i
]
->
apply
();
if
(
simple_panels_stack
->
widget
(
i
)
)
qobject_cast
<
SPrefsPanel
*>
(
simple_panels_stack
->
widget
(
i
))
->
apply
();
}
}
else
if
(
all
->
isChecked
()
&&
advanced_tree
->
isVisible
()
)
...
...
modules/gui/qt4/dialogs/preferences.hpp
View file @
46d15dba
...
...
@@ -56,11 +56,11 @@ private:
enum
{
SIMPLE
,
ADVANCED
};
QStackedWidget
*
stack
;
QWidget
*
simple_main_panel
,
*
advanced_main_panel
;
QWidget
*
advanced_main_panel
;
QWidget
*
simple_split_widget
,
*
advanced_split_widget
;
AdvPrefsPanel
*
advanced_panel
;
SPrefsPanel
*
current_simple_panel
;
QStackedWidget
*
simple_panels_stack
;
SPrefsPanel
*
simple_panels
[
SPrefsMax
];
QWidget
*
simple_tree_panel
;
...
...
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