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
9cd51319
Commit
9cd51319
authored
Nov 01, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt, sprefs: correctly implement freetype configurations
Close #5421
parent
aa1d5649
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
44 deletions
+111
-44
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+31
-2
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+2
-0
modules/gui/qt4/ui/sprefs_subtitles.ui
modules/gui/qt4/ui/sprefs_subtitles.ui
+78
-42
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
9cd51319
...
...
@@ -640,15 +640,25 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
encoding
);
CONFIG_GENERIC
(
"sub-language"
,
String
,
ui
.
subLangLabel
,
preferredLanguage
);
CONFIG_GENERIC
(
"freetype-rel-fontsize"
,
IntegerList
,
ui
.
fontSizeLabel
,
fontSize
);
CONFIG_GENERIC_NO_BOOL
(
"freetype-font"
,
Font
,
ui
.
fontLabel
,
font
);
CONFIG_GENERIC_NO_BOOL
(
"freetype-color"
,
Color
,
ui
.
fontColorLabel
,
fontColor
);
CONFIG_GENERIC
(
"freetype-rel-fontsize"
,
IntegerList
,
ui
.
fontSizeLabel
,
fontSize
);
CONFIG_GENERIC
(
"freetype-outline-thickness"
,
IntegerList
,
ui
.
fontEffectLabel
,
effect
);
CONFIG_GENERIC_NO_BOOL
(
"freetype-outline-color"
,
Color
,
ui
.
outlineColorLabel
,
outlineColor
);
CONFIG_GENERIC_NO_BOOL
(
"sub-margin"
,
Integer
,
ui
.
subsPosLabel
,
subsPosition
);
ui
.
shadowCheck
->
setChecked
(
config_GetInt
(
p_intf
,
"freetype-shadow-opacity"
)
>
0
);
ui
.
backgroundCheck
->
setChecked
(
config_GetInt
(
p_intf
,
"freetype-background-opacity"
)
>
0
);
optionWidgets
.
append
(
ui
.
shadowCheck
);
optionWidgets
.
append
(
ui
.
backgroundCheck
);
END_SPREFS_CAT
;
case
SPrefsHotkeys
:
...
...
@@ -827,6 +837,25 @@ void SPrefsPanel::apply()
config_PutPsz
(
p_intf
,
"audio-filter"
,
qtu
(
qs_filter
.
join
(
":"
)
)
);
break
;
}
case
SPrefsSubtitles
:
{
bool
b_checked
=
qobject_cast
<
QCheckBox
*>
(
optionWidgets
[
shadowCB
])
->
isChecked
();
if
(
b_checked
&&
config_GetInt
(
p_intf
,
"freetype-shadow-opacity"
)
==
0
)
{
config_PutInt
(
p_intf
,
"freetype-shadow-opacity"
,
128
);
}
else
if
(
!
b_checked
)
{
config_PutInt
(
p_intf
,
"freetype-shadow-opacity"
,
0
);
}
b_checked
=
qobject_cast
<
QCheckBox
*>
(
optionWidgets
[
backgroundCB
])
->
isChecked
();
if
(
b_checked
&&
config_GetInt
(
p_intf
,
"freetype-background-opacity"
)
==
0
)
{
config_PutInt
(
p_intf
,
"freetype-background-opacity"
,
128
);
}
else
if
(
!
b_checked
)
{
config_PutInt
(
p_intf
,
"freetype-background-opacity"
,
0
);
}
}
}
}
...
...
modules/gui/qt4/components/simple_preferences.hpp
View file @
9cd51319
...
...
@@ -81,6 +81,7 @@ enum {
};
enum
{
inputLE
,
cachingCoB
};
enum
{
skinRB
,
qtRB
,
styleCB
};
enum
{
shadowCB
,
backgroundCB
};
class
ConfigControl
;
class
QComboBox
;
...
...
@@ -115,6 +116,7 @@ public:
virtual
~
SPrefsPanel
();
void
apply
();
void
clean
();
private:
intf_thread_t
*
p_intf
;
QList
<
ConfigControl
*>
controls
;
...
...
modules/gui/qt4/ui/sprefs_subtitles.ui
View file @
9cd51319
...
...
@@ -7,17 +7,14 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
7
5
8
</width>
<height>
446
</height>
<width>
7
7
8
</width>
<height>
614
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QVBoxLayout"
>
<property
name=
"spacing"
>
<number>
10
</number>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox_3"
>
<property
name=
"title"
>
...
...
@@ -125,19 +122,9 @@
<property
name=
"title"
>
<string>
Subtitles effects
</string>
</property>
<layout
class=
"QGridLayout"
rowstretch=
"0,0,0,0,0"
columnstretch=
"0,0"
>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"effect"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontEffectLabel"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontLabel"
>
<property
name=
"minimumSize"
>
<size>
<width>
250
</width>
...
...
@@ -145,19 +132,18 @@
</size>
</property>
<property
name=
"text"
>
<string>
Outline thickness
</string>
<string>
Font
</string>
</property>
<property
name=
"buddy"
>
<cstring>
effec
t
</cstring>
<cstring>
fon
t
</cstring>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"fontColor"
>
</widget>
<item
row=
"0"
column=
"1"
colspan=
"3"
>
<widget
class=
"QFontComboBox"
name=
"font"
/>
</item>
<item
row=
"
2
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"font
Color
Label"
>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"font
Size
Label"
>
<property
name=
"minimumSize"
>
<size>
<width>
250
</width>
...
...
@@ -165,10 +151,10 @@
</size>
</property>
<property
name=
"text"
>
<string>
Font
color
</string>
<string>
Font
size
</string>
</property>
<property
name=
"buddy"
>
<cstring>
font
Color
</cstring>
<cstring>
font
Size
</cstring>
</property>
</widget>
</item>
...
...
@@ -182,24 +168,37 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontSizeLabel"
>
<property
name=
"minimumSize"
>
<item
row=
"1"
column=
"2"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Preferred
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
2
5
0
</width>
<height>
0
</height>
<width>
20
</width>
<height>
2
0
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QLabel"
name=
"fontColorLabel"
>
<property
name=
"text"
>
<string>
Font
size
</string>
<string>
Font
color
</string>
</property>
<property
name=
"buddy"
>
<cstring>
font
Size
</cstring>
<cstring>
font
Color
</cstring>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontLabel"
>
<item
row=
"1"
column=
"4"
>
<widget
class=
"QPushButton"
name=
"fontColor"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontEffectLabel"
>
<property
name=
"minimumSize"
>
<size>
<width>
250
</width>
...
...
@@ -207,10 +206,47 @@
</size>
</property>
<property
name=
"text"
>
<string>
Font
</string>
<string>
Outline thickness
</string>
</property>
<property
name=
"buddy"
>
<cstring>
font
</cstring>
<cstring>
effect
</cstring>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"effect"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"2"
column=
"3"
>
<widget
class=
"QLabel"
name=
"outlineColorLabel"
>
<property
name=
"text"
>
<string>
Outline color
</string>
</property>
<property
name=
"buddy"
>
<cstring>
outlineColor
</cstring>
</property>
</widget>
</item>
<item
row=
"2"
column=
"4"
>
<widget
class=
"QPushButton"
name=
"outlineColor"
/>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"shadowCheck"
>
<property
name=
"text"
>
<string>
Add a shadow
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QCheckBox"
name=
"backgroundCheck"
>
<property
name=
"text"
>
<string>
Add a background
</string>
</property>
</widget>
</item>
...
...
@@ -230,9 +266,6 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QFontComboBox"
name=
"font"
/>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"subsPosition"
>
<property
name=
"maximumSize"
>
...
...
@@ -270,6 +303,9 @@
<tabstop>
fontSize
</tabstop>
<tabstop>
fontColor
</tabstop>
<tabstop>
effect
</tabstop>
<tabstop>
outlineColor
</tabstop>
<tabstop>
shadowCheck
</tabstop>
<tabstop>
backgroundCheck
</tabstop>
<tabstop>
subsPosition
</tabstop>
</tabstops>
<resources/>
...
...
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