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
df98cd39
Commit
df98cd39
authored
Jan 21, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: possibility of having a small Qt dialog for preferences on small screens like EEE-PC and TVs.
parent
1f71a52e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
14 deletions
+33
-14
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+21
-7
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+2
-2
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+8
-5
modules/gui/qt4/dialogs/preferences.hpp
modules/gui/qt4/dialogs/preferences.hpp
+2
-0
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
df98cd39
...
...
@@ -38,18 +38,18 @@
#include <QToolButton>
#include <QButtonGroup>
#include <QVBoxLayout>
#include <QScrollArea>
#include <QtAlgorithms>
#include <string>
#define ICON_HEIGHT 64
#define BUTTON_HEIGHT 74
/*********************************************************************
* The List of categories
*********************************************************************/
SPrefsCatList
::
SPrefsCatList
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
SPrefsCatList
::
SPrefsCatList
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
bool
small
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
QVBoxLayout
*
layout
=
new
QVBoxLayout
();
...
...
@@ -59,13 +59,15 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) :
CONNECT
(
buttonGroup
,
buttonClicked
(
int
),
this
,
switchPanel
(
int
)
);
short
icon_height
=
small
?
ICON_HEIGHT
/
2
:
ICON_HEIGHT
;
#define ADD_CATEGORY( button, label, icon, numb ) \
QToolButton * button = new QToolButton( this ); \
button->setIcon( QIcon( ":/pixmaps/prefs/" #icon ) ); \
button->setIconSize( QSize( ICON_HEIGHT , ICON_HEIGHT ) ); \
button->setText( label ); \
button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); \
button->resize( BUTTON_HEIGHT , BUTTON_HEIGHT); \
button->setIconSize( QSize( icon_height, icon_height ) ); \
button->resize( icon_height + 6 , icon_height + 6 ); \
button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding) ; \
button->setAutoRaise( true ); \
button->setCheckable( true ); \
...
...
@@ -100,7 +102,7 @@ void SPrefsCatList::switchPanel( int i )
* The Panels
*********************************************************************/
SPrefsPanel
::
SPrefsPanel
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
int
_number
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
int
_number
,
bool
small
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
module_config_t
*
p_config
;
ConfigControl
*
control
;
...
...
@@ -556,8 +558,20 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
panel_layout
->
addWidget
(
panel_label
);
panel_layout
->
addWidget
(
title_line
);
panel_layout
->
addWidget
(
panel
);
if
(
number
!=
SPrefsHotkeys
)
panel_layout
->
addStretch
(
2
);
if
(
small
)
{
QScrollArea
*
scroller
=
new
QScrollArea
;
scroller
->
setWidget
(
panel
);
scroller
->
setWidgetResizable
(
true
);
scroller
->
setFrameStyle
(
QFrame
::
NoFrame
);
panel_layout
->
addWidget
(
scroller
);
}
else
{
panel_layout
->
addWidget
(
panel
);
if
(
number
!=
SPrefsHotkeys
)
panel_layout
->
addStretch
(
2
);
}
setLayout
(
panel_layout
);
}
...
...
modules/gui/qt4/components/simple_preferences.hpp
View file @
df98cd39
...
...
@@ -94,7 +94,7 @@ class SPrefsCatList : public QWidget
{
Q_OBJECT
;
public:
SPrefsCatList
(
intf_thread_t
*
,
QWidget
*
);
SPrefsCatList
(
intf_thread_t
*
,
QWidget
*
,
bool
);
virtual
~
SPrefsCatList
()
{};
private:
intf_thread_t
*
p_intf
;
...
...
@@ -108,7 +108,7 @@ class SPrefsPanel : public QWidget
{
Q_OBJECT
public:
SPrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
int
);
SPrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
int
,
bool
);
virtual
~
SPrefsPanel
();
void
apply
();
void
clean
();
...
...
modules/gui/qt4/dialogs/preferences.cpp
View file @
df98cd39
...
...
@@ -98,7 +98,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
main_layout
->
setColumnMinimumWidth
(
1
,
10
);
main_layout
->
setColumnStretch
(
0
,
1
);
main_layout
->
setColumnStretch
(
1
,
0
);
main_layout
->
setColumnStretch
(
2
,
3
);
main_layout
->
setColumnStretch
(
2
,
10
);
main_layout
->
setRowStretch
(
2
,
4
);
...
...
@@ -109,6 +109,9 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
tree_panel_l
->
setMargin
(
1
);
main_panel_l
->
setLayoutMargins
(
6
,
0
,
0
,
3
,
3
);
b_small
=
(
p_intf
->
p_sys
->
i_screenHeight
<
750
);
if
(
b_small
)
msg_Dbg
(
p_intf
,
"Small"
);
setMaximumHeight
(
p_intf
->
p_sys
->
i_screenHeight
);
for
(
int
i
=
0
;
i
<
SPrefsMax
;
i
++
)
simple_panels
[
i
]
=
NULL
;
if
(
config_GetInt
(
p_intf
,
"qt-advanced-pref"
)
==
1
)
...
...
@@ -123,7 +126,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
BUTTONACT
(
small
,
setSmall
()
);
BUTTONACT
(
all
,
setAdvanced
()
);
resize
(
7
5
0
,
sizeHint
().
height
()
);
resize
(
7
8
0
,
sizeHint
().
height
()
);
}
void
PrefsDialog
::
setAdvanced
()
...
...
@@ -176,7 +179,7 @@ void PrefsDialog::setSmall()
/* If no simple_tree, create one, connect it */
if
(
!
simple_tree
)
{
simple_tree
=
new
SPrefsCatList
(
p_intf
,
tree_panel
);
simple_tree
=
new
SPrefsCatList
(
p_intf
,
tree_panel
,
b_small
);
CONNECT
(
simple_tree
,
currentItemChanged
(
int
),
this
,
changeSimplePanel
(
int
)
);
...
...
@@ -193,7 +196,7 @@ void PrefsDialog::setSmall()
if
(
!
current_simple_panel
)
{
current_simple_panel
=
new
SPrefsPanel
(
p_intf
,
main_panel
,
SPrefsDefaultCat
);
new
SPrefsPanel
(
p_intf
,
main_panel
,
SPrefsDefaultCat
,
b_small
);
simple_panels
[
SPrefsDefaultCat
]
=
current_simple_panel
;
main_panel_l
->
addWidget
(
current_simple_panel
);
}
...
...
@@ -211,7 +214,7 @@ void PrefsDialog::changeSimplePanel( int number )
current_simple_panel
=
simple_panels
[
number
];
if
(
!
current_simple_panel
)
{
current_simple_panel
=
new
SPrefsPanel
(
p_intf
,
main_panel
,
number
);
current_simple_panel
=
new
SPrefsPanel
(
p_intf
,
main_panel
,
number
,
b_small
);
simple_panels
[
number
]
=
current_simple_panel
;
main_panel_l
->
addWidget
(
current_simple_panel
);
}
...
...
modules/gui/qt4/dialogs/preferences.hpp
View file @
df98cd39
...
...
@@ -81,6 +81,8 @@ private:
static
PrefsDialog
*
instance
;
bool
b_small
;
private
slots
:
void
setAdvanced
();
void
setSmall
();
...
...
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