Commit 0fe2d82e authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

show/lock subtitle track now correctly uses undo/redo

parent 263af4bf
......@@ -3936,9 +3936,15 @@ void TimelineController::switchSubtitleDisable()
{
auto subtitleModel = pCore->getSubtitleModel();
if (subtitleModel) {
subtitleModel->switchDisabled();
emit subtitlesDisabledChanged();
pCore->requestMonitorRefresh();
bool disabled = subtitleModel->isDisabled();
Fun local_switch = [this, subtitleModel]() {
subtitleModel->switchDisabled();
emit subtitlesDisabledChanged();
pCore->requestMonitorRefresh();
return true;
};
local_switch();
pCore->pushUndo(local_switch, local_switch, disabled ? i18n("Show subtitle track") : i18n("Hide subtitle track"));
}
}
......@@ -3955,8 +3961,14 @@ void TimelineController::switchSubtitleLock()
{
auto subtitleModel = pCore->getSubtitleModel();
if (subtitleModel) {
subtitleModel->switchLocked();
emit subtitlesLockedChanged();
bool locked = subtitleModel->isLocked();
Fun local_switch = [this, subtitleModel]() {
subtitleModel->switchLocked();
emit subtitlesLockedChanged();
return true;
};
local_switch();
pCore->pushUndo(local_switch, local_switch, locked ? i18n("Unlock subtitle track") : i18n("Lock subtitle track"));
}
}
bool TimelineController::subtitlesLocked() const
......
......@@ -92,6 +92,7 @@ ColorPickerWidget::~ColorPickerWidget()
void ColorPickerWidget::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
QStylePainter painter(this);
QStyleOptionComplex option;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment