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

Move screen grab controls in its own widget, remove the ugly "+" ui in clip monitor

parent 350dc48f
......@@ -198,7 +198,6 @@
<Action name="mlt_mute" />
</Menu>
<Action name="switch_monitor" />
<Action name="switch_monitor_rec" />
<Action name="insert_project_tree" />
<Action name="insert_timeline" />
</Menu>
......
......@@ -273,11 +273,29 @@ void MainWindow::init()
m_timelineTabs = new TimelineTabs(this);
ctnLay->addWidget(m_timelineTabs);
// Screen grab widget
QWidget *grabWidget = new QWidget(this);
QVBoxLayout *grabLayout = new QVBoxLayout;
grabWidget->setLayout(grabLayout);
QToolBar *recToolbar = new QToolBar(grabWidget);
grabLayout->addWidget(recToolbar);
grabLayout->addStretch(10);
QAction *recAction = m_clipMonitor->recAction();
addAction(QStringLiteral("screengrab_record"), recAction);
recToolbar->addAction(recAction);
QAction *recConfig = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure Recording"), this);
recToolbar->addAction(recConfig);
connect(recConfig, &QAction::triggered, [&]() {
pCore->showConfigDialog(4, 0);
});
QDockWidget *screenGrabDock = addDock(i18n("Screen Grab"), QStringLiteral("screengrab"), grabWidget);
// Audio spectrum scope
m_audioSpectrum = new AudioGraphSpectrum(pCore->monitorManager());
QDockWidget *spectrumDock = addDock(i18n("Audio Spectrum"), QStringLiteral("audiospectrum"), m_audioSpectrum);
// Close library and audiospectrum on first run
screenGrabDock->close();
libraryDock->close();
spectrumDock->close();
......@@ -361,9 +379,6 @@ void MainWindow::init()
tabifyDockWidget(m_clipMonitorDock, m_projectMonitorDock);
bool firstRun = readOptions();
// Monitor Record action
addAction(QStringLiteral("switch_monitor_rec"), m_clipMonitor->recAction());
// Build effects menu
m_effectsMenu = new QMenu(i18n("Add Effect"), this);
m_effectActions = new KActionCategory(i18n("Effects"), actionCollection());
......
......@@ -332,9 +332,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
configButton->setMenu(m_configMenu);
configButton->setPopupMode(QToolButton::InstantPopup);
m_toolbar->addWidget(configButton);
if (m_recManager) {
m_toolbar->addAction(m_recManager->switchAction());
}
/*QWidget *spacer = new QWidget(this);
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
m_toolbar->addWidget(spacer);*/
......@@ -443,7 +440,7 @@ void Monitor::refreshIcons()
QAction *Monitor::recAction()
{
if (m_recManager) {
return m_recManager->switchAction();
return m_recManager->recAction();
}
return nullptr;
}
......
......@@ -51,7 +51,7 @@ RecManager::RecManager(Monitor *parent)
m_playAction->setCheckable(true);
connect(m_playAction, &QAction::toggled, this, &RecManager::slotPreview);
m_recAction = m_recToolbar->addAction(QIcon::fromTheme(QStringLiteral("media-record")), i18n("Record"));
m_recAction = new QAction(QIcon::fromTheme(QStringLiteral("media-record")), i18n("Record"));
m_recAction->setCheckable(true);
connect(m_recAction, &QAction::toggled, this, &RecManager::slotRecord);
......@@ -149,9 +149,9 @@ QToolBar *RecManager::toolbar() const
return m_recToolbar;
}
QAction *RecManager::switchAction() const
QAction *RecManager::recAction() const
{
return m_switchRec;
return m_recAction;
}
void RecManager::stopCapture()
......@@ -178,7 +178,7 @@ void RecManager::stop()
void RecManager::slotRecord(bool record)
{
if (m_device_selector->currentData().toInt() == Video4Linux) {
/*if (m_device_selector->currentData().toInt() == Video4Linux) {
if (record) {
m_checkAudio = m_recAudio->isChecked();
m_checkVideo = m_recVideo->isChecked();
......@@ -187,7 +187,7 @@ void RecManager::slotRecord(bool record)
stopCapture();
}
return;
}
}*/
if (!record) {
if (!m_captureProcess) {
return;
......
......@@ -62,7 +62,7 @@ public:
~RecManager() override;
QToolBar *toolbar() const;
void stopCapture();
QAction *switchAction() const;
QAction *recAction() const;
/** @brief: stop capture and hide rec panel **/
void stop();
......
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