Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
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
Multimedia
Kdenlive
Commits
9194ffee
Commit
9194ffee
authored
Dec 01, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression and lift layout flicker
Related to
#818
parent
3cdb86cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
src/assets/view/widgets/lumaliftgainparam.cpp
src/assets/view/widgets/lumaliftgainparam.cpp
+1
-1
src/effects/effectstack/view/effectstackview.cpp
src/effects/effectstack/view/effectstackview.cpp
+17
-6
src/utils/flowlayout.cpp
src/utils/flowlayout.cpp
+6
-3
No files found.
src/assets/view/widgets/lumaliftgainparam.cpp
View file @
9194ffee
...
...
@@ -32,7 +32,7 @@ static const double GAIN_FACTOR = 4.0;
LumaLiftGainParam
::
LumaLiftGainParam
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
)
:
AbstractParamWidget
(
std
::
move
(
model
),
index
,
parent
)
{
m_flowLayout
=
new
FlowLayout
(
this
,
2
,
2
,
2
);
m_flowLayout
=
new
FlowLayout
(
this
,
10
,
10
,
4
);
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
m_lift
=
new
ColorWheel
(
QStringLiteral
(
"lift"
),
i18n
(
"Lift"
),
NegQColor
(),
this
);
m_lift
->
setFactorDefaultZero
(
LIFT_FACTOR
,
0
,
0.5
);
...
...
src/effects/effectstack/view/effectstackview.cpp
View file @
9194ffee
...
...
@@ -187,7 +187,6 @@ void EffectStackView::dropEvent(QDropEvent *event)
void
EffectStackView
::
setModel
(
std
::
shared_ptr
<
EffectStackModel
>
model
,
const
QSize
frameSize
)
{
qDebug
()
<<
"MUTEX LOCK!!!!!!!!!!!! setmodel"
;
disconnect
(
&
m_timerHeight
,
&
QTimer
::
timeout
,
this
,
&
EffectStackView
::
updateTreeHeight
);
m_mutex
.
lock
();
unsetModel
(
false
);
m_effectsTree
->
setFixedHeight
(
0
);
...
...
@@ -236,7 +235,9 @@ void EffectStackView::loadEffects()
return
;
}
int
active
=
qBound
(
0
,
m_model
->
getActiveEffect
(),
max
-
1
);
bool
hasLift
=
false
;
QModelIndex
activeIndex
;
connect
(
&
m_timerHeight
,
&
QTimer
::
timeout
,
this
,
&
EffectStackView
::
updateTreeHeight
);
for
(
int
i
=
0
;
i
<
max
;
i
++
)
{
std
::
shared_ptr
<
AbstractEffectItem
>
item
=
m_model
->
getEffectStackRow
(
i
);
QSize
size
;
...
...
@@ -247,6 +248,9 @@ void EffectStackView::loadEffects()
std
::
shared_ptr
<
EffectItemModel
>
effectModel
=
std
::
static_pointer_cast
<
EffectItemModel
>
(
item
);
CollapsibleEffectView
*
view
=
nullptr
;
// We need to rebuild the effect view
if
(
effectModel
->
getAssetId
()
==
QLatin1String
(
"lift_gamma_gain"
))
{
hasLift
=
true
;
}
QImage
effectIcon
=
m_thumbnailer
->
requestImage
(
effectModel
->
getAssetId
(),
&
size
,
QSize
(
QStyle
::
PM_SmallIconSize
,
QStyle
::
PM_SmallIconSize
));
view
=
new
CollapsibleEffectView
(
effectModel
,
m_sourceFrameSize
,
effectIcon
,
this
);
connect
(
view
,
&
CollapsibleEffectView
::
deleteEffect
,
m_model
.
get
(),
&
EffectStackModel
::
removeEffect
);
...
...
@@ -275,10 +279,20 @@ void EffectStackView::loadEffects()
m_effectsTree
->
setCurrentIndex
(
activeIndex
);
}
}
if
(
!
hasLift
)
{
updateTreeHeight
();
}
if
(
activeIndex
.
isValid
())
{
doActivateEffect
(
active
,
activeIndex
,
true
);
if
(
active
>
0
)
{
if
(
hasLift
)
{
// Some effects have a complex timed layout, so we need to wait a bit before getting the correct position for the effect
QTimer
::
singleShot
(
100
,
this
,
&
EffectStackView
::
slotFocusEffect
);
}
else
{
slotFocusEffect
();
}
}
}
connect
(
&
m_timerHeight
,
&
QTimer
::
timeout
,
this
,
&
EffectStackView
::
updateTreeHeight
);
qDebug
()
<<
"MUTEX UNLOCK!!!!!!!!!!!! loadEffects"
;
}
...
...
@@ -386,6 +400,7 @@ void EffectStackView::unsetModel(bool reset)
disconnect
(
m_model
.
get
(),
&
EffectStackModel
::
dataChanged
,
this
,
&
EffectStackView
::
refresh
);
disconnect
(
m_model
.
get
(),
&
EffectStackModel
::
enabledStateChanged
,
this
,
&
EffectStackView
::
changeEnabledState
);
disconnect
(
this
,
&
EffectStackView
::
removeCurrentEffect
,
m_model
.
get
(),
&
EffectStackModel
::
removeCurrentEffect
);
disconnect
(
&
m_timerHeight
,
&
QTimer
::
timeout
,
this
,
&
EffectStackView
::
updateTreeHeight
);
}
if
(
reset
)
{
QMutexLocker
lock
(
&
m_mutex
);
...
...
@@ -465,10 +480,6 @@ void EffectStackView::doActivateEffect(int row, QModelIndex activeIx, bool force
if
(
w
)
{
w
->
slotActivateEffect
(
true
);
}
if
(
force
&&
row
>
0
)
{
// Some effects have a complex timed layout, so we need to wait a bit before getting the correct position for the effect
QTimer
::
singleShot
(
100
,
this
,
&
EffectStackView
::
slotFocusEffect
);
}
}
void
EffectStackView
::
slotFocusEffect
()
...
...
src/utils/flowlayout.cpp
View file @
9194ffee
...
...
@@ -42,6 +42,7 @@
#include <QWidget>
#include <QDebug>
#include <QtMath>
#include <QTimer>
FlowLayout
::
FlowLayout
(
QWidget
*
parent
,
int
margin
,
int
hSpacing
,
int
vSpacing
)
:
QLayout
(
parent
)
...
...
@@ -156,10 +157,12 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
QSize
min
=
wid
->
minimumSize
();
int
columns
=
qMin
(
qFloor
((
double
)
rect
.
width
()
/
min
.
width
()),
m_itemList
.
size
());
columns
=
qMax
(
1
,
columns
);
int
realWidth
=
rect
.
width
()
/
columns
-
horizontalSpacing
();
int
realWidth
=
qMin
(
wid
->
maximumWidth
(),
rect
.
width
()
/
columns
-
horizontalSpacing
());
realWidth
-=
realWidth
%
40
;
realWidth
=
qMax
(
realWidth
,
wid
->
minimumWidth
());
int
totalHeight
=
y
-
rect
.
y
()
+
mrg
.
bottom
()
+
qCeil
((
double
)
m_itemList
.
size
()
/
columns
)
*
(
realWidth
+
verticalSpacing
());
m_minimumSize
=
QSize
(
rect
.
width
()
,
totalHeight
);
QSize
hint
=
QSize
(
qMin
(
wid
->
maximumWidth
(),
realWidth
),
qMin
(
wid
->
maximumWidth
(),
realWidth
)
);
m_minimumSize
=
QSize
(
columns
*
realWidth
,
totalHeight
);
QSize
hint
=
QSize
(
realWidth
,
realWidth
);
if
(
testOnly
)
{
return
totalHeight
;
}
...
...
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