Cleanup effectstack layout, fixing cut labels (f77b880d) · Commits · Multimedia / Kdenlive · GitLab
Admin message
Join us at
Akademy
to celebrate KDE's 30th anniversary!
Travel support requests
are open till May 31st.
Register now
Verified
Commit
f77b880d
authored
Nov 27, 2025
by
Jean-Baptiste Mardelle
Browse files
parent
dfa1bb3a
Loading
Loading
Loading
Loading
Changes
Pipelines
Loading
Original line number
Diff line number
Diff line
@@ -30,9 +30,7 @@ AssetParameterView::AssetParameterView(QWidget *parent)
m_lay
new
QFormLayout
this
);
m_lay
->
setContentsMargins
);
m_lay
->
setVerticalSpacing
);
m_lay
->
setHorizontalSpacing
m_lay
->
horizontalSpacing
()
);
// Presets Combo
m_presetMenu
new
QMenu
this
);
Original line number
Diff line number
Diff line
@@ -918,13 +918,6 @@ void CollapsibleEffectView::dragEnterEvent(QDragEnterEvent *event)
*/
void
CollapsibleEffectView
::
resizeEvent
QResizeEvent
event
QWidget
::
resizeEvent
event
);
m_view
->
adjustSize
();
m_view
->
updateGeometry
();
void
CollapsibleEffectView
::
dragLeaveEvent
QDragLeaveEvent
/*event*/
QPalette
pal
border_frame
->
palette
();
Original line number
Diff line number
Diff line
@@ -152,7 +152,6 @@ protected:
void
enterEvent
QEnterEvent
event
override
void
dragEnterEvent
QDragEnterEvent
event
override
void
dragLeaveEvent
QDragLeaveEvent
event
override
void
resizeEvent
QResizeEvent
event
override
Q_SIGNALS
void
parameterChanged
const
QDomElement
const
QDomElement
int
);
Original line number
Diff line number
Diff line
@@ -69,14 +69,6 @@ int WidgetDelegate::height(const QModelIndex &index) const
return
m_height
value
index
);
void
WidgetDelegate
::
paint
QPainter
painter
const
QStyleOptionViewItem
option
const
QModelIndex
index
const
QStyleOptionViewItem
opt
option
);
initStyleOption
opt
index
);
QStyle
style
opt
widget
opt
widget
->
style
()
QApplication
::
style
();
style
->
drawPrimitive
QStyle
::
PE_PanelItemViewItem
opt
painter
opt
widget
);
EffectStackView
::
EffectStackView
AssetPanel
parent
QWidget
parent
m_model
nullptr
@@ -100,8 +92,8 @@ EffectStackView::EffectStackView(AssetPanel *parent)
m_effectsTree
->
setHeaderHidden
true
);
m_effectsTree
->
setRootIsDecorated
false
);
m_effectsTree
->
setVerticalScrollBarPolicy
Qt
::
ScrollBarAlwaysOff
);
m_effectsTree
->
viewport
()
->
setAutoFillBackground
false
);
m_effectsTree
->
setItemDelegateForColumn
new
WidgetDelegate
this
));
m_effectsTree
->
viewport
()
->
setAutoFillBackground
false
);
m_lay
->
addWidget
m_effectsTree
);
m_lay
->
addStretch
10
);
@@ -401,6 +393,7 @@ void EffectStackView::loadEffects()
QMutexLocker
lock
m_mutex
);
m_model
->
plugBuiltinEffects
();
int
max
m_model
->
rowCount
();
m_effectsLoaded
false
int
active
if
max
active
qBound
m_model
->
getActiveEffect
(),
max
);
@@ -414,7 +407,6 @@ void EffectStackView::loadEffects()
Q_EMIT
effectsCountChanged
();
return
bool
hasLift
false
QModelIndex
activeIndex
connect
m_timerHeight
QTimer
::
timeout
this
EffectStackView
::
updateTreeHeight
Qt
::
UniqueConnection
);
for
int
max
++
@@ -425,10 +417,6 @@ 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
QModelIndex
ix
m_filter
->
mapFromSource
m_model
->
getIndexFromItem
effectModel
));
if
ix
isValid
())
continue
@@ -487,9 +475,6 @@ void EffectStackView::loadEffects()
view
->
buttonDown
->
setEnabled
max
);
lock
unlock
();
if
hasLift
updateTreeHeight
();
if
activeIndex
isValid
())
m_effectsTree
->
setCurrentIndex
activeIndex
);
auto
static_cast
CollapsibleEffectView
*>
m_effectsTree
->
indexWidget
activeIndex
));
@@ -497,12 +482,6 @@ void EffectStackView::loadEffects()
->
slotActivateEffect
true
);
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
();
Q_EMIT
effectsCountChanged
();
qDebug
()
<<
"MUTEX UNLOCK!!!!!!!!!!!! loadEffects"
@@ -540,6 +519,10 @@ void EffectStackView::updateTreeHeight()
m_effectsTree
->
setFixedHeight
totalHeight
);
m_scrollTimer
start
();
if
m_effectsLoaded
m_effectsLoaded
true
slotFocusEffect
();
void
EffectStackView
::
startDrag
const
QPixmap
pix
const
QString
assetId
ObjectId
sourceObject
int
row
bool
singleTarget
@@ -592,7 +575,7 @@ void EffectStackView::slotCollapseAllEffects(bool collapse)
void
EffectStackView
::
slotAdjustDelegate
const
std
::
shared_ptr
EffectItemModel
effectModel
int
newH
eight
void
EffectStackView
::
slotAdjustDelegate
const
std
::
shared_ptr
EffectItemModel
effectModel
int
eight
if
m_model
return
@@ -601,7 +584,7 @@ void EffectStackView::slotAdjustDelegate(const std::shared_ptr
if
ix
isValid
())
auto
del
static_cast
WidgetDelegate
*>
m_effectsTree
->
itemDelegateForIndex
ix
));
if
del
del
->
setHeight
ix
newH
eight
);
del
->
setHeight
ix
eight
);
m_timerHeight
start
();
@@ -963,21 +946,6 @@ void EffectStackView::keyPressEvent(QKeyEvent *event)
void
EffectStackView
::
activateAndScroll
int
row
m_model
->
setActiveEffect
row
);
int
scrollPos
for
int
ix
ix
row
ix
++
QModelIndex
index
m_filter
->
mapFromSource
m_model
->
index
ix
QModelIndex
()));
auto
del
static_cast
WidgetDelegate
*>
m_effectsTree
->
itemDelegateForIndex
index
));
if
del
scrollPos
+=
del
->
height
index
);
/*int height = 50;
QModelIndex index = m_filter->mapFromSource(m_model->index(row, 0, QModelIndex()));
m_effectsTree->setCurrentIndex(index);
auto *del = static_cast
if (del) {
height = del->height(index);
}*/
slotFocusEffect
();
Original line number
Diff line number
Diff line
@@ -36,7 +36,6 @@ public:
void
setHeight
const
QModelIndex
index
int
height
);
int
height
const
QModelIndex
index
const
QSize
sizeHint
const
QStyleOptionViewItem
option
const
QModelIndex
index
const
override
void
paint
QPainter
painter
const
QStyleOptionViewItem
option
const
QModelIndex
index
const
override
private:
QMap
QPersistentModelIndex
int
m_height
@@ -100,6 +99,7 @@ protected:
private:
QMutex
m_mutex
QVBoxLayout
m_lay
bool
m_effectsLoaded
false
};
QTreeView
m_effectsTree
std
::
shared_ptr
EffectStackModel
m_model
Loading
US