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
c8986a40
Commit
c8986a40
authored
Aug 03, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Use a QFontComboBox instead of a QFontDialog.
parent
9f89ad42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
30 deletions
+34
-30
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+24
-14
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+7
-4
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+1
-2
modules/gui/qt4/ui/sprefs_subtitles.ui
modules/gui/qt4/ui/sprefs_subtitles.ui
+2
-10
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
c8986a40
...
...
@@ -368,27 +368,37 @@ void DirectoryConfigControl::updateField()
text
->
setText
(
toNativeSepNoSlash
(
dir
)
);
}
#include <QFont
Dialog
>
#include <QFont
ComboBox
>
/********* String / Font **********/
FontConfigControl
::
FontConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_p_widget
,
QGridLayout
*
_p_layout
,
int
&
_int
)
:
FileConfigControl
(
_p_this
,
_p_item
,
_p_widget
,
_p_layout
,
_int
)
{}
module_config_t
*
_p_item
,
QWidget
*
_parent
,
QGridLayout
*
_p_layout
,
int
&
line
)
:
VStringConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
label
=
new
QLabel
(
qtr
(
p_item
->
psz_text
)
);
font
=
new
QFontComboBox
(
_parent
);
if
(
!
_p_layout
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
font
,
1
);
widget
->
setLayout
(
layout
);
}
else
{
_p_layout
->
addWidget
(
label
,
line
,
0
);
_p_layout
->
addWidget
(
font
,
line
,
1
);
}
}
FontConfigControl
::
FontConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_p_label
,
QLineEdit
*
_p_line
,
QPushButton
*
_p_button
)
:
FileConfigControl
(
_p_this
,
_p_item
,
_p_label
,
_p_line
,
_p_button
)
{}
void
FontConfigControl
::
updateField
()
QFontComboBox
*
_p_font
)
:
VStringConfigControl
(
_p_this
,
_p_item
)
{
bool
ok
;
QFont
font
=
QFontDialog
::
getFont
(
&
ok
,
QFont
(
text
->
text
()
),
NULL
);
if
(
!
ok
)
return
;
text
->
setText
(
font
.
family
()
);
label
=
_p_label
;
font
=
_p_font
;
}
/********* String / choice list **********/
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
c8986a40
...
...
@@ -45,6 +45,7 @@
#include <QPushButton>
#include <QVector>
#include <QDialog>
#include <QFontComboBox>
class
QTreeWidget
;
class
QTreeWidgetItem
;
...
...
@@ -329,17 +330,19 @@ public slots:
virtual
void
updateField
();
};
class
FontConfigControl
:
public
File
ConfigControl
class
FontConfigControl
:
public
VString
ConfigControl
{
Q_OBJECT
;
public:
FontConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
&
);
FontConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QLabel
*
,
Q
LineEdit
*
,
QPushButton
*
);
Q
FontComboBox
*
);
virtual
~
FontConfigControl
()
{};
public
slots
:
virtual
void
updateField
();
virtual
QString
getValue
(){
return
font
->
currentFont
().
toString
();
}
protected:
QLabel
*
label
;
QFontComboBox
*
font
;
};
class
ModuleConfigControl
:
public
VStringConfigControl
...
...
modules/gui/qt4/components/simple_preferences.cpp
View file @
c8986a40
...
...
@@ -576,8 +576,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
encoding
);
CONFIG_GENERIC
(
"sub-language"
,
String
,
ui
.
subLangLabel
,
preferredLanguage
);
CONFIG_GENERIC_FILE
(
"freetype-font"
,
Font
,
ui
.
fontLabel
,
ui
.
font
,
ui
.
fontBrowse
);
CONFIG_GENERIC_NO_BOOL
(
"freetype-font"
,
Font
,
ui
.
fontLabel
,
font
);
CONFIG_GENERIC
(
"freetype-color"
,
IntegerList
,
ui
.
fontColorLabel
,
fontColor
);
CONFIG_GENERIC
(
"freetype-rel-fontsize"
,
IntegerList
,
...
...
modules/gui/qt4/ui/sprefs_subtitles.ui
View file @
c8986a40
...
...
@@ -8,7 +8,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
772
</width>
<height>
44
4
</height>
<height>
44
6
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -131,15 +131,8 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"fontBrowse"
>
<property
name=
"text"
>
<string>
Browse...
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"Q
LineEdit
"
name=
"font"
/>
<widget
class=
"Q
FontComboBox
"
name=
"font"
/>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"fontLabel"
>
...
...
@@ -187,7 +180,6 @@
<tabstop>
preferredLanguage
</tabstop>
<tabstop>
encoding
</tabstop>
<tabstop>
font
</tabstop>
<tabstop>
fontBrowse
</tabstop>
<tabstop>
fontSize
</tabstop>
<tabstop>
fontColor
</tabstop>
<tabstop>
effect
</tabstop>
...
...
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