Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
df7f74e3
Commit
df7f74e3
authored
Jan 05, 2010
by
Ludovic Fauvet
Browse files
Settings panel cleanup.
Contributed (with a non-applicable patch) by j-b.
parent
e6ef4148
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/GUI/settings/Panel.cpp
View file @
df7f74e3
...
...
@@ -35,9 +35,7 @@
const
int
Panel
::
M_ICON_HEIGHT
=
64
;
Panel
::
Panel
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_layout
(
0
)
Panel
::
Panel
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
m_layout
=
new
QVBoxLayout
(
this
);
m_buttons
=
new
QButtonGroup
(
this
);
...
...
@@ -48,16 +46,10 @@ Panel::Panel( QWidget* parent )
m_layout
->
insertSpacerItem
(
1
,
new
QSpacerItem
(
1
,
1
,
QSizePolicy
::
Minimum
,
QSizePolicy
::
Expanding
)
);
connect
(
m_buttons
,
SIGNAL
(
buttonPressed
(
int
)
),
this
,
S
LOT
(
switch
Panel
(
int
)
)
);
this
,
S
IGNAL
(
change
Panel
(
int
)
)
);
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
setLayout
(
m_layout
);
}
Panel
::~
Panel
()
{
}
void
Panel
::
addButton
(
const
QString
&
label
,
...
...
@@ -86,12 +78,6 @@ void Panel::addButton( const QString& label,
void
Panel
::
showEvent
(
QShowEvent
*
event
)
{
// Reset the selection when the dialog is shown.
if
(
!
event
->
spontaneous
()
&&
!
m_buttons
->
buttons
().
isEmpty
()
)
if
(
!
event
->
spontaneous
()
&&
!
m_buttons
->
buttons
().
isEmpty
()
)
m_buttons
->
buttons
().
first
()
->
setChecked
(
true
);
}
void
Panel
::
switchPanel
(
int
index
)
{
emit
changePanel
(
index
);
}
src/GUI/settings/Panel.h
View file @
df7f74e3
...
...
@@ -34,25 +34,23 @@ class Panel : public QWidget
{
Q_OBJECT
Q_DISABLE_COPY
(
Panel
)
public:
Panel
(
QWidget
*
parent
=
0
);
virtual
~
Panel
();
void
addButton
(
const
QString
&
label
,
const
QIcon
&
icon
,
int
index
);
public:
Panel
(
QWidget
*
parent
=
0
);
virtual
~
Panel
()
{
}
private:
virtual
void
showEvent
(
QShowEvent
*
);
QVBoxLayout
*
m_layout
;
QButtonGroup
*
m_buttons
;
static
const
int
M_ICON_HEIGHT
;
void
addButton
(
const
QString
&
label
,
const
QIcon
&
icon
,
int
index
);
private
slots
:
void
switchPanel
(
int
index
);
private:
virtual
void
showEvent
(
QShowEvent
*
);
QVBoxLayout
*
m_layout
;
QButtonGroup
*
m_buttons
;
static
const
int
M_ICON_HEIGHT
;
signals:
void
changePanel
(
int
index
);
signals:
void
changePanel
(
int
index
);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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