Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
fe566c07
Commit
fe566c07
authored
May 17, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dynamic text broken because of missing font & keyword params
Fixes
#185
parent
aeb55fce
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
284 additions
and
30 deletions
+284
-30
data/effects/dynamictext.xml
data/effects/dynamictext.xml
+2
-3
src/assets/CMakeLists.txt
src/assets/CMakeLists.txt
+2
-0
src/assets/view/widgets/abstractparamwidget.cpp
src/assets/view/widgets/abstractparamwidget.cpp
+10
-2
src/assets/view/widgets/boolparamwidget.cpp
src/assets/view/widgets/boolparamwidget.cpp
+0
-1
src/assets/view/widgets/fontparamwidget.cpp
src/assets/view/widgets/fontparamwidget.cpp
+54
-0
src/assets/view/widgets/fontparamwidget.hpp
src/assets/view/widgets/fontparamwidget.hpp
+54
-0
src/assets/view/widgets/keywordparamwidget.cpp
src/assets/view/widgets/keywordparamwidget.cpp
+78
-0
src/assets/view/widgets/keywordparamwidget.hpp
src/assets/view/widgets/keywordparamwidget.hpp
+54
-0
src/ui/fontval_ui.ui
src/ui/fontval_ui.ui
+12
-3
src/ui/keywordval_ui.ui
src/ui/keywordval_ui.ui
+18
-21
No files found.
data/effects/dynamictext.xml
View file @
fe566c07
...
...
@@ -38,9 +38,8 @@
<paramlistdisplay>
Top,Middle,Bottom
</paramlistdisplay>
<name>
Vertical Alignment
</name>
</parameter>
<parameter
type=
"keywords"
name=
"argument"
default=
"#timecode#"
>
<parameter
type=
"keywords"
name=
"argument"
default=
"#timecode#"
paramlist=
"#timecode#;#frame#;#filedate#;#localfiledate#;#meta.media.0.stream.frame_rate#;#meta.media.0.codec.name#;#meta.media.0.codec.bit_rate#;#meta.media.width#;#meta.media.height#;#meta.attr.comment.markup#"
>
<name>
Text
</name>
<keywords>
#timecode#;#frame#;#filedate#;#localfiledate#;#meta.media.0.stream.frame_rate#;#meta.media.0.codec.name#;#meta.media.0.codec.bit_rate#;#meta.media.width#;#meta.media.height#;#meta.attr.comment.markup#
</keywords>
<keywordsdisplay>
timecode;frame;file date;local file date;source frame rate;source codec;source bit rate;source width;source height;source comment
</keywordsdisplay>
<paramlistdisplay>
timecode,frame,file date,local file date,source frame rate,source codec,source bit rate,source width,source height,source comment
</paramlistdisplay>
</parameter>
</effect>
src/assets/CMakeLists.txt
View file @
fe566c07
...
...
@@ -33,6 +33,8 @@ set(kdenlive_SRCS
assets/view/widgets/coloreditwidget.cpp
assets/view/widgets/hideparamwidget.cpp
assets/view/widgets/clickablelabelwidget.cpp
assets/view/widgets/fontparamwidget.cpp
assets/view/widgets/keywordparamwidget.cpp
# curves widget
assets/view/widgets/curves/abstractcurvewidget.h
assets/view/widgets/curves/bezier/beziersplineeditor.cpp
...
...
src/assets/view/widgets/abstractparamwidget.cpp
View file @
fe566c07
...
...
@@ -21,6 +21,8 @@
#include "assets/model/assetparametermodel.hpp"
#include "buttonparamwidget.hpp"
#include "boolparamwidget.hpp"
#include "fontparamwidget.hpp"
#include "keywordparamwidget.hpp"
#include "coloreditwidget.hpp"
#include "curves/bezier/beziersplineeditor.h"
#include "curves/cubic/kis_cubic_curve.h"
...
...
@@ -135,6 +137,14 @@ AbstractParamWidget *AbstractParamWidget::construct(const std::shared_ptr<AssetP
widget
=
new
ClickableLabelParamWidget
(
model
,
index
,
parent
);
break
;
}
case
ParamType
::
Fontfamily
:
{
widget
=
new
FontParamWidget
(
model
,
index
,
parent
);
break
;
}
case
ParamType
::
Keywords
:
{
widget
=
new
KeywordParamWidget
(
model
,
index
,
parent
);
break
;
}
case
ParamType
::
Animated
:
case
ParamType
::
RestrictedAnim
:
// widget = new AnimationWidget(model, index, range, parent);
...
...
@@ -143,8 +153,6 @@ AbstractParamWidget *AbstractParamWidget::construct(const std::shared_ptr<AssetP
// widget = new KeyframeEdit(model, index, parent);
// break;
case
ParamType
::
Addedgeometry
:
case
ParamType
::
Keywords
:
case
ParamType
::
Fontfamily
:
// not reimplemented
widget
=
new
Unsupported
(
model
,
index
,
parent
);
static_cast
<
Unsupported
*>
(
widget
)
->
setText
(
name
);
...
...
src/assets/view/widgets/boolparamwidget.cpp
View file @
fe566c07
...
...
@@ -28,7 +28,6 @@ BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
setupUi
(
this
);
// setup the comment
QString
name
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
NameRole
).
toString
();
QString
comment
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
CommentRole
).
toString
();
setToolTip
(
comment
);
m_labelComment
->
setText
(
comment
);
...
...
src/assets/view/widgets/fontparamwidget.cpp
0 → 100644
View file @
fe566c07
/***************************************************************************
* Copyright (C) 2016 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "fontparamwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
FontParamWidget
::
FontParamWidget
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
)
:
AbstractParamWidget
(
std
::
move
(
model
),
index
,
parent
)
{
setupUi
(
this
);
// setup the comment
QString
comment
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
CommentRole
).
toString
();
setToolTip
(
comment
);
// setup the name
labelName
->
setText
(
m_model
->
data
(
m_index
,
Qt
::
DisplayRole
).
toString
());
// set check state
slotRefresh
();
// emit the signal of the base class when appropriate
connect
(
this
->
fontfamilywidget
,
&
QFontComboBox
::
currentFontChanged
,
[
this
](
const
QFont
&
font
)
{
emit
valueChanged
(
m_index
,
font
.
family
(),
true
);
});
}
void
FontParamWidget
::
slotShowComment
(
bool
show
)
{
Q_UNUSED
(
show
);
}
void
FontParamWidget
::
slotRefresh
()
{
const
QString
family
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
();
fontfamilywidget
->
setCurrentFont
(
QFont
(
family
));
}
src/assets/view/widgets/fontparamwidget.hpp
0 → 100644
View file @
fe566c07
/***************************************************************************
* Copyright (C) 2016 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef FONTPARAMWIDGET_H
#define FONTPARAMWIDGET_H
#include "abstractparamwidget.hpp"
#include "ui_fontval_ui.h"
#include <QWidget>
/** @brief This class represents a parameter that requires
the user to choose tick a checkbox
*/
class
FontParamWidget
:
public
AbstractParamWidget
,
public
Ui
::
Fontval_UI
{
Q_OBJECT
public:
/** @brief Constructor for the widgetComment
@param name String containing the name of the parameter
@param comment Optional string containing the comment associated to the parameter
@param checked Boolean indicating whether the checkbox should initially be checked
@param parent Parent widget
*/
FontParamWidget
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
);
public
slots
:
/** @brief Toggle the comments on or off
*/
void
slotShowComment
(
bool
show
)
override
;
/** @brief refresh the properties to reflect changes in the model
*/
void
slotRefresh
()
override
;
};
#endif
src/assets/view/widgets/keywordparamwidget.cpp
0 → 100644
View file @
fe566c07
/***************************************************************************
* Copyright (C) 2016 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "keywordparamwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
KeywordParamWidget
::
KeywordParamWidget
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
)
:
AbstractParamWidget
(
std
::
move
(
model
),
index
,
parent
)
{
setupUi
(
this
);
// setup the comment
QString
name
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
NameRole
).
toString
();
QString
comment
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
CommentRole
).
toString
();
setToolTip
(
comment
);
// setup the name
label
->
setText
(
m_model
->
data
(
m_index
,
Qt
::
DisplayRole
).
toString
());
QStringList
kwrdValues
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ListValuesRole
).
toStringList
();
QStringList
kwrdNames
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ListNamesRole
).
toStringList
();
comboboxwidget
->
addItems
(
kwrdNames
);
int
i
=
0
;
for
(
const
QString
&
keywordVal
:
kwrdValues
)
{
if
(
i
>=
comboboxwidget
->
count
())
{
break
;
}
comboboxwidget
->
setItemData
(
i
,
keywordVal
);
i
++
;
}
comboboxwidget
->
insertItem
(
0
,
i18n
(
"<select a keyword>"
));
comboboxwidget
->
setCurrentIndex
(
0
);
// set check state
slotRefresh
();
// emit the signal of the base class when appropriate
connect
(
lineeditwidget
,
&
QLineEdit
::
editingFinished
,
[
this
]()
{
emit
valueChanged
(
m_index
,
lineeditwidget
->
text
(),
true
);
});
connect
(
comboboxwidget
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
[
this
](
int
ix
)
{
if
(
ix
>
0
)
{
QString
comboval
=
comboboxwidget
->
itemData
(
ix
).
toString
();
this
->
lineeditwidget
->
insert
(
comboval
);
emit
valueChanged
(
m_index
,
lineeditwidget
->
text
(),
true
);
comboboxwidget
->
setCurrentIndex
(
0
);
}
});
}
void
KeywordParamWidget
::
slotShowComment
(
bool
show
)
{
Q_UNUSED
(
show
);
}
void
KeywordParamWidget
::
slotRefresh
()
{
lineeditwidget
->
setText
(
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
());
}
src/assets/view/widgets/keywordparamwidget.hpp
0 → 100644
View file @
fe566c07
/***************************************************************************
* Copyright (C) 2016 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef KEYWORDPARAMWIDGET_H
#define KEYWORDPARAMWIDGET_H
#include "abstractparamwidget.hpp"
#include "ui_keywordval_ui.h"
#include <QWidget>
/** @brief This class represents a parameter that requires
the user to choose tick a checkbox
*/
class
KeywordParamWidget
:
public
AbstractParamWidget
,
public
Ui
::
Keywordval_UI
{
Q_OBJECT
public:
/** @brief Constructor for the widgetComment
@param name String containing the name of the parameter
@param comment Optional string containing the comment associated to the parameter
@param checked Boolean indicating whether the checkbox should initially be checked
@param parent Parent widget
*/
KeywordParamWidget
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
);
public
slots
:
/** @brief Toggle the comments on or off
*/
void
slotShowComment
(
bool
show
)
override
;
/** @brief refresh the properties to reflect changes in the model
*/
void
slotRefresh
()
override
;
};
#endif
src/ui/fontval_ui.ui
View file @
fe566c07
...
...
@@ -6,19 +6,28 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
20
0
</width>
<width>
57
0
</width>
<height>
60
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
>
<property
name=
"margin"
>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
n
ame"
>
<widget
class=
"QLabel"
name=
"
labelN
ame"
>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
...
...
src/ui/keywordval_ui.ui
View file @
fe566c07
...
...
@@ -7,16 +7,31 @@
<x>
0
</x>
<y>
0
</y>
<width>
194
</width>
<height>
42
</height>
<height>
139
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"
verticalSpac
in
g
"
>
<property
name=
"
leftMarg
in"
>
<number>
0
</number>
</property>
<property
name=
"
m
argin"
>
<property
name=
"
topM
argin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QComboBox"
name=
"comboboxwidget"
/>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLineEdit"
name=
"lineeditwidget"
/>
</item>
<item
row=
"0"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
...
...
@@ -27,26 +42,8 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLineEdit"
name=
"lineeditwidget"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"KComboBox"
name=
"comboboxwidget"
/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
KComboBox
</class>
<extends>
QComboBox
</extends>
<header>
kcombobox.h
</header>
</customwidget>
<customwidget>
<class>
QLineEdit
</class>
<extends>
QLineEdit
</extends>
<header>
klineedit.h
</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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