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
4016a1a0
Commit
4016a1a0
authored
Aug 25, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flickering of panels in preferences
parent
a8b27f21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
modules/gui/qt4/components/preferences.cpp
modules/gui/qt4/components/preferences.cpp
+6
-4
modules/gui/qt4/components/preferences.hpp
modules/gui/qt4/components/preferences.hpp
+3
-2
modules/gui/qt4/dialogs/prefs_dialog.cpp
modules/gui/qt4/dialogs/prefs_dialog.cpp
+14
-10
No files found.
modules/gui/qt4/components/preferences.cpp
View file @
4016a1a0
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include <QScrollArea>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QHBoxLayout>
#include <QHeaderView>
#define ITEM_HEIGHT 25
#define ITEM_HEIGHT 25
...
@@ -62,6 +63,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
...
@@ -62,6 +63,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
setColumnCount
(
1
);
setColumnCount
(
1
);
setIconSize
(
QSize
(
ITEM_HEIGHT
,
ITEM_HEIGHT
)
);
setIconSize
(
QSize
(
ITEM_HEIGHT
,
ITEM_HEIGHT
)
);
setAlternatingRowColors
(
true
);
setAlternatingRowColors
(
true
);
header
()
->
hide
();
#ifndef WIN32
#ifndef WIN32
// Fixme - A bit UGLY
// Fixme - A bit UGLY
...
@@ -320,7 +322,7 @@ PrefsPanel::PrefsPanel( QWidget *_parent ) : QWidget( _parent )
...
@@ -320,7 +322,7 @@ PrefsPanel::PrefsPanel( QWidget *_parent ) : QWidget( _parent )
{}
{}
PrefsPanel
::
PrefsPanel
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
PrefsPanel
::
PrefsPanel
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
PrefsItemData
*
data
)
:
PrefsItemData
*
data
,
bool
currently_advanced
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
{
module_config_t
*
p_item
;
module_config_t
*
p_item
;
...
@@ -480,7 +482,7 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -480,7 +482,7 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
some_hidden_text
->
setWordWrap
(
true
);
some_hidden_text
->
setWordWrap
(
true
);
setLayout
(
global_layout
);
setLayout
(
global_layout
);
setAdvanced
(
fals
e
);
setAdvanced
(
currently_advanced
,
tru
e
);
}
}
void
PrefsPanel
::
Apply
()
void
PrefsPanel
::
Apply
()
...
@@ -514,10 +516,10 @@ void PrefsPanel::Apply()
...
@@ -514,10 +516,10 @@ void PrefsPanel::Apply()
void
PrefsPanel
::
Clean
()
void
PrefsPanel
::
Clean
()
{}
{}
void
PrefsPanel
::
setAdvanced
(
bool
adv
)
void
PrefsPanel
::
setAdvanced
(
bool
adv
,
bool
force
)
{
{
bool
some_hidden
=
false
;
bool
some_hidden
=
false
;
if
(
adv
==
advanced
)
return
;
if
(
!
force
&&
adv
==
advanced
)
return
;
advanced
=
adv
;
advanced
=
adv
;
QList
<
ConfigControl
*>::
Iterator
i
;
QList
<
ConfigControl
*>::
Iterator
i
;
...
...
modules/gui/qt4/components/preferences.hpp
View file @
4016a1a0
...
@@ -78,7 +78,7 @@ class PrefsPanel : public QWidget
...
@@ -78,7 +78,7 @@ class PrefsPanel : public QWidget
{
{
Q_OBJECT
Q_OBJECT
public:
public:
PrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
PrefsItemData
*
);
PrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
PrefsItemData
*
,
bool
);
PrefsPanel
(
QWidget
*
);
PrefsPanel
(
QWidget
*
);
virtual
~
PrefsPanel
()
{};
virtual
~
PrefsPanel
()
{};
void
Apply
();
void
Apply
();
...
@@ -90,7 +90,8 @@ private:
...
@@ -90,7 +90,8 @@ private:
QVBoxLayout
*
global_layout
;
QVBoxLayout
*
global_layout
;
bool
advanced
;
bool
advanced
;
public
slots
:
public
slots
:
void
setAdvanced
(
bool
);
void
setAdvanced
(
bool
,
bool
);
void
setAdvanced
(
bool
a
)
{
return
setAdvanced
(
a
,
false
);
}
};
};
#endif
#endif
modules/gui/qt4/dialogs/prefs_dialog.cpp
View file @
4016a1a0
...
@@ -37,20 +37,20 @@ PrefsDialog *PrefsDialog::instance = NULL;
...
@@ -37,20 +37,20 @@ PrefsDialog *PrefsDialog::instance = NULL;
PrefsDialog
::
PrefsDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
PrefsDialog
::
PrefsDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
{
{
QGridLayout
*
main_layout
=
new
QGridLayout
();
QGridLayout
*
main_layout
=
new
QGridLayout
(
this
);
setWindowTitle
(
qtr
(
"Preferences"
)
);
setWindowTitle
(
qtr
(
"Preferences"
)
);
resize
(
800
,
450
);
resize
(
800
,
450
);
tree_panel
=
new
QWidget
;
tree_panel
=
new
QWidget
(
0
)
;
tree_panel_l
=
new
QHBoxLayout
;
tree_panel_l
=
new
QHBoxLayout
;
tree_panel
->
setLayout
(
tree_panel_l
);
tree_panel
->
setLayout
(
tree_panel_l
);
main_panel
=
new
QWidget
;
main_panel
=
new
QWidget
(
0
)
;
main_panel_l
=
new
QHBoxLayout
;
main_panel_l
=
new
QHBoxLayout
;
main_panel
->
setLayout
(
main_panel_l
);
main_panel
->
setLayout
(
main_panel_l
);
// Choice for types
// Choice for types
types
=
new
QGroupBox
(
"Show settings"
);
types
=
new
QGroupBox
(
"Show settings"
);
QHBoxLayout
*
tl
=
new
QHBoxLayout
();
QHBoxLayout
*
tl
=
new
QHBoxLayout
(
0
);
tl
->
setSpacing
(
3
);
tl
->
setMargin
(
3
);
tl
->
setSpacing
(
3
);
tl
->
setMargin
(
3
);
small
=
new
QRadioButton
(
"Basic"
,
types
);
tl
->
addWidget
(
small
);
small
=
new
QRadioButton
(
"Basic"
,
types
);
tl
->
addWidget
(
small
);
all
=
new
QRadioButton
(
"All"
,
types
);
tl
->
addWidget
(
all
);
all
=
new
QRadioButton
(
"All"
,
types
);
tl
->
addWidget
(
all
);
...
@@ -58,17 +58,21 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
...
@@ -58,17 +58,21 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
all
->
setChecked
(
true
);
all
->
setChecked
(
true
);
adv_chk
=
new
QCheckBox
(
"Advanced options"
);
adv_chk
=
new
QCheckBox
(
"Advanced options"
);
advanced_tree
=
NULL
;
advanced_tree
=
NULL
;
simple_tree
=
NULL
;
simple_tree
=
NULL
;
simple_panel
=
NULL
;
simple_panel
=
NULL
;
advanced_panel
=
NULL
;
advanced_panel
=
NULL
;
main_layout
->
add
Layout
(
tl
,
0
,
0
,
1
,
1
);
main_layout
->
add
Widget
(
types
,
0
,
0
,
1
,
1
);
main_layout
->
addWidget
(
tree_panel
,
1
,
0
,
1
,
1
);
main_layout
->
addWidget
(
tree_panel
,
1
,
0
,
1
,
1
);
main_layout
->
addWidget
(
adv_chk
,
2
,
0
,
1
,
1
);
main_layout
->
addWidget
(
adv_chk
,
2
,
0
,
1
,
1
);
main_layout
->
addWidget
(
main_panel
,
0
,
1
,
3
,
1
);
main_layout
->
addWidget
(
main_panel
,
0
,
1
,
3
,
1
);
main_layout
->
setColumnMinimumWidth
(
0
,
200
);
main_layout
->
setColumnStretch
(
0
,
1
);
main_layout
->
setColumnStretch
(
1
,
3
);
setAll
();
setAll
();
connect
(
adv_chk
,
SIGNAL
(
toggled
(
bool
)
),
connect
(
adv_chk
,
SIGNAL
(
toggled
(
bool
)
),
...
@@ -95,7 +99,7 @@ void PrefsDialog::setAll()
...
@@ -95,7 +99,7 @@ void PrefsDialog::setAll()
if
(
!
advanced_tree
)
if
(
!
advanced_tree
)
{
{
advanced_tree
=
new
PrefsTree
(
p_intf
,
t
his
);
advanced_tree
=
new
PrefsTree
(
p_intf
,
t
ree_panel
);
connect
(
advanced_tree
,
connect
(
advanced_tree
,
SIGNAL
(
currentItemChanged
(
QTreeWidgetItem
*
,
QTreeWidgetItem
*
)
),
SIGNAL
(
currentItemChanged
(
QTreeWidgetItem
*
,
QTreeWidgetItem
*
)
),
this
,
SLOT
(
changePanel
(
QTreeWidgetItem
*
)
)
);
this
,
SLOT
(
changePanel
(
QTreeWidgetItem
*
)
)
);
...
@@ -109,10 +113,9 @@ void PrefsDialog::setAll()
...
@@ -109,10 +113,9 @@ void PrefsDialog::setAll()
simple_panel
->
hide
();
simple_panel
->
hide
();
}
}
if
(
!
advanced_panel
)
if
(
!
advanced_panel
)
advanced_panel
=
new
PrefsPanel
(
this
);
advanced_panel
=
new
PrefsPanel
(
main_panel
);
main_panel_l
->
addWidget
(
advanced_panel
);
main_panel_l
->
addWidget
(
advanced_panel
);
advanced_panel
->
show
();
advanced_panel
->
show
();
setAdvanced
(
adv_chk
->
isChecked
()
);
}
}
void
PrefsDialog
::
setSmall
()
void
PrefsDialog
::
setSmall
()
...
@@ -153,7 +156,8 @@ void PrefsDialog::changePanel( QTreeWidgetItem *item )
...
@@ -153,7 +156,8 @@ void PrefsDialog::changePanel( QTreeWidgetItem *item )
}
}
if
(
!
data
->
panel
)
if
(
!
data
->
panel
)
{
{
data
->
panel
=
new
PrefsPanel
(
p_intf
,
this
,
data
);
data
->
panel
=
new
PrefsPanel
(
p_intf
,
main_panel
,
data
,
adv_chk
->
isChecked
()
);
}
}
advanced_panel
=
data
->
panel
;
advanced_panel
=
data
->
panel
;
main_panel_l
->
addWidget
(
advanced_panel
);
main_panel_l
->
addWidget
(
advanced_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