Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
56fbf5f7
Commit
56fbf5f7
authored
Jan 08, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Fix preferences widgets layout to get more alignment.
parent
842d4437
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
31 deletions
+41
-31
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+41
-31
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
56fbf5f7
...
...
@@ -47,14 +47,18 @@
#include <QSignalMapper>
#include <QDialogButtonBox>
#define MINWIDTH_BOX 90
#define LAST_COLUMN 10
QString
formatTooltip
(
const
QString
&
tooltip
)
{
QString
formatted
=
"<html><head><meta name=
\"
qrichtext
\"
content=
\"
1
\"
/><style type=
\"
text/css
\"
>"
" p, li { white-space: pre-wrap; } </style></head><body style=
\"
font-family:'Sans Serif';"
" font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;
\"
>"
"<p style=
\"
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; "
"-qt-block-indent:0; text-indent:0px;
\"
>"
+
"<html><head><meta name=
\"
qrichtext
\"
content=
\"
1
\"
/>"
"<style type=
\"
text/css
\"
> p, li { white-space: pre-wrap; } </style></head>"
"<body style=
\"
font-family:'Sans Serif'; font-size:9pt; font-weight:400; "
"font-style:normal; text-decoration:none;
\"
>"
"<p style=
\"
margin-top:0px; margin-bottom:0px; margin-left:0px; "
"margin-right:0px; -qt-block-indent:0; text-indent:0px;
\"
>"
+
tooltip
+
"</p></body></html>"
;
return
formatted
;
...
...
@@ -64,7 +68,7 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
module_config_t
*
p_item
,
QWidget
*
parent
)
{
int
i
=
0
;
int
i
=
0
;
return
createControl
(
p_this
,
p_item
,
parent
,
NULL
,
i
);
}
...
...
@@ -208,12 +212,15 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
text
,
1
);
layout
->
addWidget
(
label
,
0
);
layout
->
insertSpacing
(
1
,
10
);
layout
->
addWidget
(
text
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
text
,
line
,
1
);
l
->
addWidget
(
label
,
line
,
0
);
l
->
setColumnMinimumWidth
(
1
,
10
);
l
->
addWidget
(
text
,
line
,
LAST_COLUMN
);
}
}
...
...
@@ -258,13 +265,15 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this,
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addLayout
(
textAndButton
,
1
);
layout
->
insertSpacing
(
1
,
10
);
layout
->
addLayout
(
textAndButton
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addLayout
(
textAndButton
,
line
,
1
);
l
->
setColumnMinimumWidth
(
1
,
10
);
l
->
addLayout
(
textAndButton
,
line
,
LAST_COLUMN
);
}
}
...
...
@@ -354,19 +363,19 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
combo
=
new
QComboBox
();
combo
->
setMinimumWidth
(
80
);
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
combo
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Preferred
);
finish
(
bycat
);
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBox
Layout
();
l
ayout
->
addWidget
(
label
);
layout
->
addWidget
(
combo
);
widget
->
setLayout
(
l
ayout
);
l
=
new
QGrid
Layout
();
l
->
addWidget
(
label
,
0
,
0
);
l
->
addWidget
(
combo
,
0
,
LAST_COLUMN
);
widget
->
setLayout
(
l
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
combo
,
line
,
1
,
Qt
::
AlignRight
);
l
->
addWidget
(
combo
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
if
(
p_item
->
i_action
)
...
...
@@ -380,7 +389,8 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
new
QPushButton
(
qfu
(
p_item
->
ppsz_action_text
[
i
]
));
CONNECT
(
button
,
clicked
(),
signalMapper
,
map
()
);
signalMapper
->
setMapping
(
button
,
i
);
l
->
addWidget
(
button
,
line
,
2
+
i
,
Qt
::
AlignRight
);
l
->
addWidget
(
button
,
line
,
LAST_COLUMN
-
p_item
->
i_action
+
i
,
Qt
::
AlignRight
);
}
CONNECT
(
signalMapper
,
mapped
(
int
),
this
,
actionRequested
(
int
)
);
...
...
@@ -466,18 +476,18 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *_p_this,
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
combo
=
new
QComboBox
();
combo
->
setMinimumWidth
(
80
);
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
finish
(
bycat
);
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
);
layout
->
addWidget
(
combo
);
layout
->
addWidget
(
label
);
layout
->
addWidget
(
combo
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
combo
,
line
,
1
,
Qt
::
AlignRight
);
l
->
addWidget
(
combo
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
}
...
...
@@ -708,21 +718,21 @@ IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
VIntConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
spin
=
new
QSpinBox
;
spin
->
setMinimumWidth
(
80
);
spin
=
new
QSpinBox
;
spin
->
setMinimumWidth
(
MINWIDTH_BOX
);
spin
->
setAlignment
(
Qt
::
AlignRight
);
spin
->
setMaximumWidth
(
90
);
spin
->
setMaximumWidth
(
MINWIDTH_BOX
);
finish
();
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
spin
,
1
);
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
spin
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
spin
,
line
,
1
,
Qt
::
AlignRight
);
l
->
addWidget
(
spin
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
}
IntegerConfigControl
::
IntegerConfigControl
(
vlc_object_t
*
_p_this
,
...
...
@@ -804,18 +814,18 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
combo
=
new
QComboBox
();
combo
->
setMinimumWidth
(
80
);
combo
->
setMinimumWidth
(
MINWIDTH_BOX
);
finish
(
bycat
);
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
);
layout
->
addWidget
(
combo
);
layout
->
addWidget
(
label
);
layout
->
addWidget
(
combo
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
combo
,
line
,
1
,
Qt
::
AlignRight
);
l
->
addWidget
(
combo
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
}
IntegerListConfigControl
::
IntegerListConfigControl
(
vlc_object_t
*
_p_this
,
...
...
@@ -904,22 +914,22 @@ FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
VFloatConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
spin
=
new
QDoubleSpinBox
;
spin
->
setMinimumWidth
(
80
);
spin
->
setMaximumWidth
(
90
);
spin
=
new
QDoubleSpinBox
;
spin
->
setMinimumWidth
(
MINWIDTH_BOX
);
spin
->
setMaximumWidth
(
MINWIDTH_BOX
);
spin
->
setAlignment
(
Qt
::
AlignRight
);
finish
();
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
spin
,
1
);
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
spin
,
LAST_COLUMN
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
spin
,
line
,
1
,
Qt
::
AlignRight
);
l
->
addWidget
(
spin
,
line
,
LAST_COLUMN
,
Qt
::
AlignRight
);
}
}
...
...
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