Save timeline status (shown/hidden) in layouts

parent 39799e91
Pipeline #22161 passed with stage
in 14 minutes and 28 seconds
......@@ -104,6 +104,12 @@ void LayoutManagement::slotLoadLayout(QAction *action)
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("kdenlive-layoutsrc"));
KConfigGroup layouts(config, "Layouts");
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toLatin1());
bool timelineVisible = true;
if (state.startsWith("NO-TL")) {
timelineVisible = false;
state.remove(0, 5);
}
pCore->window()->centralWidget()->setHidden(!timelineVisible);
pCore->window()->restoreState(state);
}
......@@ -122,6 +128,9 @@ void LayoutManagement::slotSaveLayout(QAction *action)
layouts.deleteEntry(originallayoutName);
QByteArray st = pCore->window()->saveState();
if (!pCore->window()->timelineVisible()) {
st.prepend("NO-TL");
}
layoutName.append('_' + QString::number(layoutId));
layouts.writeEntry(layoutName, st.toBase64());
initializeLayouts();
......
......@@ -4070,6 +4070,11 @@ void MainWindow::slotExpandClip()
getCurrentTimeline()->controller()->expandActiveClip();
}
bool MainWindow::timelineVisible() const
{
return !centralWidget()->isHidden();
}
#ifdef DEBUG_MAINW
#undef DEBUG_MAINW
......
......@@ -128,6 +128,9 @@ public:
/** @brief Returns a pointer to the current timeline */
TimelineWidget *getCurrentTimeline() const;
/** @brief Returns true if the timeline widget is visible */
bool timelineVisible() const;
protected:
/** @brief Closes the window.
......
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